Skip to content

Commit

Permalink
fix: upload assets and update Ctas.tsx file
Browse files Browse the repository at this point in the history
  • Loading branch information
Meolocious committed Mar 14, 2024
1 parent e2e57b2 commit f2f07b4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 24 deletions.
Binary file added src/assets/images/app-store-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/google-play-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 57 additions & 24 deletions src/components/Editorial/Ctas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,28 @@ import Button, { type ButtonProps } from '@mui/material/Button';
import Stack from '@mui/material/Stack';
import { isValidElement } from 'react';
import { type CommonProps } from 'types/components';
import appleBadge from '../../assets/images/app-store-badge.png';
import googleBadge from '../../assets/images/google-play-badge.png';
import { ThemeProvider, createTheme } from '@mui/material';

interface CtaButtonProps extends Partial<ButtonProps> {
text: string;
}

type CtaButton = CtaButtonProps | JSX.Element;

const customTheme = createTheme({
breakpoints: {
values: {
xs: 0,
sm: 420,
md: 900,
lg: 1200,
xl: 1536,
},
},
});

export interface StoreButtonsProps {
hrefGoogle?: string;
hrefApple?: string;
Expand Down Expand Up @@ -41,30 +56,48 @@ export const Ctas = ({

if (storeButtons) {
return (
<Stack
direction={{ md: 'row-reverse', xs: 'row' }}
justifyContent="left"
spacing={2}
>
{storeButtons.hrefGoogle && (
<Button
sx={{ width: { md: 'auto', xs: '100%' } }}
key="google"
href={storeButtons.hrefGoogle}
>
Google Play
</Button>
)}
{storeButtons.hrefApple && (
<Button
sx={{ width: { md: 'auto', xs: '100%' } }}
key="apple"
href={storeButtons.hrefApple}
>
App Store
</Button>
)}
</Stack>
<ThemeProvider theme={customTheme}>
<Stack
direction={{ xs: 'column', sm: 'row-reverse' }}
justifyContent="left"
spacing={2}
>
{storeButtons.hrefGoogle && (
<Button
sx={{
padding: '0px',
margin: '0px',
justifyContent: 'start',
}}
key="google"
href={storeButtons.hrefGoogle}
>
<img
src={googleBadge}
alt="Download on the App Store"
style={{ height: '3em' }}
/>
</Button>
)}
{storeButtons.hrefApple && (
<Button
sx={{
padding: '0px',
margin: '0px',
justifyContent: 'start',
}}
key="apple"
href={storeButtons.hrefApple}
>
<img
src={appleBadge}
alt="Download on the App Store"
style={{ height: '3em' }}
/>
</Button>
)}
</Stack>
</ThemeProvider>
);
}

Expand Down

0 comments on commit f2f07b4

Please sign in to comment.