Skip to content

Commit

Permalink
Merge pull request #22 from flotiq/feature/fix-typo
Browse files Browse the repository at this point in the history
rename alignement to alignment
  • Loading branch information
CiotkaCierpienia authored Feb 21, 2022
2 parents 7e75da5 + 9e1c700 commit c5b270c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/components/Content/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
Expand All @@ -54,7 +54,7 @@ const Content = ({
return (
<Paragraph
text={block.data.text}
alignement={block.tunes?.alignementTuneTool?.alignement}
alignment={block.tunes?.alignmentTuneTool?.alignment}
{...paragraphProps}
key={block.id}
/>
Expand Down
14 changes: 7 additions & 7 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Header = ({
level,
text,
anchor,
alignement,
alignment,
additionalClasses,
h1AdditionalClasses,
h2AdditionalClasses,
Expand All @@ -28,7 +28,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',
Expand All @@ -37,15 +37,15 @@ const Header = ({
return (
React.isValidElement(text) ? (
<HeaderToRender
className={[sizeClass[safeLevel], alignementClass[alignement], ...additionalClasses].join(' ')}
className={[sizeClass[safeLevel], alignmentClass[alignment], ...additionalClasses].join(' ')}
id={anchor}
{...props}
>
{text}
</HeaderToRender>
) : (
<HeaderToRender
className={[sizeClass[safeLevel], alignementClass[alignement], ...additionalClasses].join(' ')}
className={[sizeClass[safeLevel], alignmentClass[alignment], ...additionalClasses].join(' ')}
dangerouslySetInnerHTML={{ __html: text }}
id={anchor}
{...props}
Expand All @@ -68,9 +68,9 @@ Header.propTypes = {
*/
anchor: PropTypes.string,
/**
* Header alignement
* Header alignment
*/
alignement: PropTypes.oneOf(['left', 'center', 'right']),
alignment: PropTypes.oneOf(['left', 'center', 'right']),
/**
* Additional classes for header (all levels)
*/
Expand Down Expand Up @@ -104,7 +104,7 @@ Header.propTypes = {
Header.defaultProps = {
level: 1,
anchor: '',
alignement: 'left',
alignment: 'left',
additionalClasses: [],
h1AdditionalClasses: [],
h2AdditionalClasses: [],
Expand Down
14 changes: 7 additions & 7 deletions src/components/Paragraph/Paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import PropTypes from 'prop-types';
/**
* Component for standard text
*/
const Paragraph = ({ text, alignement, additionalClasses, ...props }) => {
const alignementClass = {
const Paragraph = ({ text, alignment, additionalClasses, ...props }) => {
const alignmentClass = {
left: 'text-left',
center: 'text-center',
right: 'text-right',
};
return React.isValidElement(text) ? (
<p
className={['py-2', alignementClass[alignement], ...additionalClasses].join(' ')}
className={['py-2', alignmentClass[alignment], ...additionalClasses].join(' ')}
{...props}
>
{text}
</p>
) : (
<p
className={['py-2', alignementClass[alignement], ...additionalClasses].join(' ')}
className={['py-2', alignmentClass[alignment], ...additionalClasses].join(' ')}
dangerouslySetInnerHTML={{ __html: text }}
{...props}
/>
Expand All @@ -32,17 +32,17 @@ 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
*/
additionalClasses: PropTypes.arrayOf(PropTypes.string),
};

Paragraph.defaultProps = {
alignement: 'left',
alignment: 'left',
additionalClasses: [],
};

Expand Down
6 changes: 3 additions & 3 deletions src/stories/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
},
};

Expand All @@ -28,7 +28,7 @@ Level2.args = {
...Header.defaultProps,
level: 2,
text: 'What is a <b>CMS</b>',
alignement: 'center',
alignment: 'center',
};

export const Level3 = Template.bind({});
Expand All @@ -37,7 +37,7 @@ Level3.args = {
...Header.defaultProps,
level: 3,
text: 'Heading 3',
alignement: 'right',
alignment: 'right',
};

export const Level4 = Template.bind({});
Expand Down
2 changes: 1 addition & 1 deletion src/stories/Paragraph.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
},
};

Expand Down

0 comments on commit c5b270c

Please sign in to comment.