Skip to content

Commit

Permalink
fix: renamed props
Browse files Browse the repository at this point in the history
  • Loading branch information
Meolocious committed Mar 13, 2024
1 parent 12869f0 commit 3f761bc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions src/components/Editorial/Ctas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ interface CtaButtonProps extends Partial<ButtonProps> {

type CtaButton = CtaButtonProps | JSX.Element;

export interface BadgeButtonProps {
export interface StoreButtonsProps {
hrefGoogle?: string;
hrefApple?: string;
}

export interface EditorialCtaProps extends CommonProps {
ctaButtons?: CtaButton[];
badgeButtons?: BadgeButtonProps;
storeButtons?: StoreButtonsProps;
}

const isButtonProps = (button: CtaButton): button is CtaButtonProps => {
Expand All @@ -25,7 +25,7 @@ const isButtonProps = (button: CtaButton): button is CtaButtonProps => {

export const Ctas = ({
ctaButtons,
badgeButtons,
storeButtons,
theme,
}: EditorialCtaProps) => {
const buttonsTheme: ButtonProps[] = [
Expand All @@ -39,27 +39,27 @@ export const Ctas = ({
},
];

if (badgeButtons) {
if (storeButtons) {
return (
<Stack
direction={{ md: 'row-reverse', xs: 'row' }}
justifyContent="left"
spacing={2}
>
{badgeButtons.hrefGoogle && (
{storeButtons.hrefGoogle && (
<Button
sx={{ width: { md: 'auto', xs: '100%' } }}
key="google"
href={badgeButtons.hrefGoogle}
href={storeButtons.hrefGoogle}
>
Google Play
</Button>
)}
{badgeButtons.hrefApple && (
{storeButtons.hrefApple && (
<Button
sx={{ width: { md: 'auto', xs: '100%' } }}
key="apple"
href={badgeButtons.hrefApple}
href={storeButtons.hrefApple}
>
App Store
</Button>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Editorial/Editorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import {
Ctas as EditorialCtas,
type EditorialCtaProps,
type BadgeButtonProps,
type StoreButtonsProps,
} from './Ctas';
import { Image as EditorialImage, type EditorialImageProps } from './Image';
import EContainer from '../EContainer';
Expand All @@ -22,7 +22,7 @@ export interface EditorialProps
EditorialImageProps {
reversed?: boolean;
width: 'wide' | 'standard' | 'center';
badgeButtons?: BadgeButtonProps;
storeButtons?: StoreButtonsProps;
}

export const Editorial = (props: EditorialProps) => {
Expand All @@ -33,7 +33,7 @@ export const Editorial = (props: EditorialProps) => {
body,
theme,
ctaButtons,
badgeButtons,
storeButtons,
pattern = 'none',
width = 'standard',
reversed = false,
Expand Down Expand Up @@ -93,7 +93,7 @@ export const Editorial = (props: EditorialProps) => {
<Grid item md={columns[width]} sx={gridItemStyles}>
<Stack gap={4}>
<EditorialContent {...{ eyelet, body, title, theme }} />
<EditorialCtas {...{ ctaButtons, badgeButtons, theme }} />
<EditorialCtas {...{ ctaButtons, storeButtons, theme }} />
</Stack>
</Grid>
<Grid item md={columns[width]}>
Expand Down
12 changes: 6 additions & 6 deletions src/stories/Editorial/dark.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ CtasElementExample.args = {
],
};

export const WithBadgeButtons = Template.bind({});
WithBadgeButtons.args = {
badgeButtons: {
export const WithstoreButtons = Template.bind({});
WithstoreButtons.args = {
storeButtons: {
hrefGoogle: 'https://play.google.com',
hrefApple: 'https://apple.com',
},
};

export const WithOneBadgeButtons = Template.bind({});
WithOneBadgeButtons.args = {
badgeButtons: {
export const WithOnestoreButtons = Template.bind({});
WithOnestoreButtons.args = {
storeButtons: {
hrefGoogle: 'https://play.google.com',
},
};
Expand Down
12 changes: 6 additions & 6 deletions src/stories/Editorial/light.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ CtasElementExample.args = {
],
};

export const WithBadgeButtons = Template.bind({});
WithBadgeButtons.args = {
badgeButtons: {
export const WithstoreButtons = Template.bind({});
WithstoreButtons.args = {
storeButtons: {
hrefGoogle: 'https://play.google.com',
hrefApple: 'https://apple.com',
},
};

export const WithOneBadgeButtons = Template.bind({});
WithOneBadgeButtons.args = {
badgeButtons: {
export const WithOnestoreButtons = Template.bind({});
WithOnestoreButtons.args = {
storeButtons: {
hrefGoogle: 'https://play.google.com',
},
};
Expand Down

0 comments on commit 3f761bc

Please sign in to comment.