Skip to content

Commit

Permalink
change(copyright): removed color variant
Browse files Browse the repository at this point in the history
- the copyright will be styled according to the parent component, there is
  no need to give it a different color from the copyright
  • Loading branch information
ichim-david committed Dec 5, 2022
1 parent 7b6c0ae commit 747b8a2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
5 changes: 1 addition & 4 deletions src/ui/Banner/Banner.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ const Template = (args) => (
</>
</Banner.Metadata>
)}
<Copyright
copyrightPosition={args.copyrightPosition}
colorVariant={args.copyrightVariant}
>
<Copyright copyrightPosition={args.copyrightPosition}>
<Copyright.Icon>
<Icon className={args.copyrightIcon} />
</Copyright.Icon>
Expand Down
16 changes: 1 addition & 15 deletions src/ui/Copyright/Copyright.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,12 @@ import PropTypes from 'prop-types';

Copyright.propTypes = {
copyrightPosition: PropTypes.oneOf(['left', 'right']),
colorVariant: PropTypes.oneOf([
'default',
'primary',
'secondary',
'tertiary',
]),
};

function Copyright({ children, ...rest }) {
return (
<div className={`eea copyright ${rest.copyrightPosition}`}>
<div
className={`${
rest.colorVariant === 'default'
? 'wrapper'
: 'wrapper color-fg-' + rest.colorVariant
}`}
>
{children}
</div>
<div className={'wrapper'}>{children}</div>
</div>
);
}
Expand Down
18 changes: 2 additions & 16 deletions src/ui/Copyright/Copyright.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ export default {
title: 'Components/Copyright',
component: Copyright,
argTypes: {
colorVariant: {
name: 'Variation',
defaultValue: 'default',
options: ['default', 'primary', 'secondary', 'tertiary'],
control: { type: 'select' },
table: {
defaultValue: { summary: 'default' },
type: { summary: 'string' },
},
},
copyrightPosition: {
name: 'Position',
control: {
Expand All @@ -32,11 +22,8 @@ export default {

export const Default = (args) => (
<Container>
<Segment className={args.colorVariant === 'default' ? 'inverted' : ''}>
<Copyright
copyrightPosition={args.copyrightPosition}
colorVariant={args.colorVariant}
>
<Segment className={'inverted'}>
<Copyright copyrightPosition={args.copyrightPosition}>
<Copyright.Icon>
<Icon className={args.icon} />
</Copyright.Icon>
Expand All @@ -47,7 +34,6 @@ export const Default = (args) => (
);

Default.args = {
colorVariant: 'default',
copyrightPosition: 'left',
icon: 'ri-copyright-line',
text: 'Image copyright: Velit fusce sed sem ut.',
Expand Down
5 changes: 1 addition & 4 deletions src/ui/Hero/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ function Hero({
{children}

{has_copyright && (
<Copyright
copyrightPosition={copyrightPosition}
colorVariant={copyrightVariant}
>
<Copyright copyrightPosition={copyrightPosition}>
<Copyright.Icon>
<Icon className={copyrightIcon} />
</Copyright.Icon>
Expand Down

0 comments on commit 747b8a2

Please sign in to comment.