From de2746e1d1ca85641df6059e3629efb2232b7c53 Mon Sep 17 00:00:00 2001 From: Karol Grochowalski Date: Fri, 18 Feb 2022 09:58:23 +0100 Subject: [PATCH] rename alignement to alignment --- src/components/Content/Content.js | 4 ++-- src/components/Header/Header.js | 14 +++++++------- src/components/Paragraph/Paragraph.js | 14 +++++++------- src/stories/Header.stories.js | 6 +++--- src/stories/Paragraph.stories.js | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/components/Content/Content.js b/src/components/Content/Content.js index 47c9d94..ddee772 100644 --- a/src/components/Content/Content.js +++ b/src/components/Content/Content.js @@ -45,7 +45,7 @@ const Content = ({ level={block.data.level} text={block.data.text} anchor={block.data.anchor} - alignement={block.tunes?.alignmentTuneTool?.alignment} + alignment={block.tunes?.alignmentTuneTool?.alignment} {...headerProps} key={block.id} /> @@ -54,7 +54,7 @@ const Content = ({ return ( diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index b2a5cf8..bd58767 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -9,7 +9,7 @@ const Header = ({ level, text, anchor, - alignement, + alignment, additionalClasses, h1AdditionalClasses, h2AdditionalClasses, @@ -29,7 +29,7 @@ const Header = ({ 5: ['text-lg font-bold pt-2 pb-1', ...h5AdditionalClasses].join(' '), 6: ['text-base font-bold pt-1', ...h6AdditionalClasses].join(' '), }; - const alignementClass = { + const alignmentClass = { left: 'text-left', center: 'text-center', right: 'text-right', @@ -38,7 +38,7 @@ const Header = ({ return ( React.isValidElement(text) ? ( @@ -46,7 +46,7 @@ const Header = ({ ) : ( { - const alignementClass = { +const Paragraph = ({ text, alignment, additionalClasses, ...props }) => { + const alignmentClass = { left: 'text-left', center: 'text-center', right: 'text-right', }; return React.isValidElement(text) ? (

{text}

) : (

@@ -33,9 +33,9 @@ Paragraph.propTypes = { */ text: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired, /** - * Paragraph alignement + * Paragraph alignment */ - alignement: PropTypes.oneOf(['left', 'center', 'right']), + alignment: PropTypes.oneOf(['left', 'center', 'right']), /** * Additional classes for paragraph */ @@ -43,7 +43,7 @@ Paragraph.propTypes = { }; Paragraph.defaultProps = { - alignement: 'left', + alignment: 'left', additionalClasses: [], }; diff --git a/src/stories/Header.stories.js b/src/stories/Header.stories.js index ca4e1d5..3b2fdbb 100644 --- a/src/stories/Header.stories.js +++ b/src/stories/Header.stories.js @@ -8,7 +8,7 @@ export default { component: Header, // More on argTypes: https://storybook.js.org/docs/react/api/argtypes argTypes: { - alignement: { control: 'select' }, + alignment: { control: 'select' }, }, }; @@ -28,7 +28,7 @@ Level2.args = { ...Header.defaultProps, level: 2, text: 'What is a CMS', - alignement: 'center', + alignment: 'center', }; export const Level3 = Template.bind({}); @@ -37,7 +37,7 @@ Level3.args = { ...Header.defaultProps, level: 3, text: 'Heading 3', - alignement: 'right', + alignment: 'right', }; export const Level4 = Template.bind({}); diff --git a/src/stories/Paragraph.stories.js b/src/stories/Paragraph.stories.js index 6da548f..6099720 100644 --- a/src/stories/Paragraph.stories.js +++ b/src/stories/Paragraph.stories.js @@ -8,7 +8,7 @@ export default { component: Paragraph, // More on argTypes: https://storybook.js.org/docs/react/api/argtypes argTypes: { - alignement: { control: 'select' }, + alignment: { control: 'select' }, }, };