From aad3cab9e390a49a262dfd489c1a607eb3938894 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Tue, 3 Oct 2023 14:17:27 -0400 Subject: [PATCH 1/6] chore: re-organize react package folder structure. Keep components in components, keep stories in stories. --- packages/react-components/src/components/Badge.jsx | 7 +++++++ .../react-components/src/components/Badge/index.jsx | 9 --------- .../src/components/{Button/index.jsx => Button.jsx} | 11 ++--------- packages/react-components/src/main.js | 4 ++-- .../{components/Badge => stories}/Badge.stories.js | 2 +- .../{components/Button => stories}/Button.stories.js | 2 +- 6 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 packages/react-components/src/components/Badge.jsx delete mode 100644 packages/react-components/src/components/Badge/index.jsx rename packages/react-components/src/components/{Button/index.jsx => Button.jsx} (74%) rename packages/react-components/src/{components/Badge => stories}/Badge.stories.js (75%) rename packages/react-components/src/{components/Button => stories}/Button.stories.js (79%) diff --git a/packages/react-components/src/components/Badge.jsx b/packages/react-components/src/components/Badge.jsx new file mode 100644 index 00000000..ac2372a9 --- /dev/null +++ b/packages/react-components/src/components/Badge.jsx @@ -0,0 +1,7 @@ +import PropTypes from 'prop-types'; + +export const Badge = ({ label }) =>
{label}
; + +Badge.propTypes = { + label: PropTypes.string, +}; \ No newline at end of file diff --git a/packages/react-components/src/components/Badge/index.jsx b/packages/react-components/src/components/Badge/index.jsx deleted file mode 100644 index 079ec14c..00000000 --- a/packages/react-components/src/components/Badge/index.jsx +++ /dev/null @@ -1,9 +0,0 @@ -import PropTypes from 'prop-types'; - -const Badge = ({ label }) =>
{label}
; - -Badge.propTypes = { - label: PropTypes.string, -}; - -export default Badge; diff --git a/packages/react-components/src/components/Button/index.jsx b/packages/react-components/src/components/Button.jsx similarity index 74% rename from packages/react-components/src/components/Button/index.jsx rename to packages/react-components/src/components/Button.jsx index 54e96c6d..f2f00a6e 100644 --- a/packages/react-components/src/components/Button/index.jsx +++ b/packages/react-components/src/components/Button.jsx @@ -1,11 +1,6 @@ import PropTypes from 'prop-types'; -const Button = ({ - attributes, - children, - 'aria-label': ariaLabel, - disabled, -}) => { +export const Button = ({ attributes, children, 'aria-label': ariaLabel, disabled, }) => { return (