Skip to content

Commit

Permalink
[blog] Fix display on Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jun 10, 2022
1 parent 1a30806 commit 4c2e681
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
5 changes: 1 addition & 4 deletions docs/pages/blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,7 @@ export default function Blog(props: InferGetStaticPropsType<typeof getStaticProp
/>
<AppHeader />
<main>
<Section
bg="gradient"
sx={{ backgroundSize: 'auto 300px ', backgroundRepeat: 'no-repeat' }}
>
<Section bg="gradient" sx={{ backgroundSize: '100% 300px', backgroundRepeat: 'no-repeat' }}>
<Typography variant="body2" color="primary.600" fontWeight="bold" textAlign="center">
Blog
</Typography>
Expand Down
6 changes: 2 additions & 4 deletions docs/src/components/home/HeroEnd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Container from '@mui/material/Container';
const Placeholder = () => <Box sx={{ height: { xs: 587, sm: 303, md: 289 } }} />;
const StartToday = dynamic(() => import('./StartToday'), { loading: Placeholder });

const HeroEnd = () => {
export default function HeroEnd() {
const { ref, inView } = useInView({
triggerOnce: true,
threshold: 0,
Expand All @@ -28,6 +28,4 @@ const HeroEnd = () => {
</Container>
</Box>
);
};

export default HeroEnd;
}
17 changes: 10 additions & 7 deletions docs/src/layouts/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import * as React from 'react';
import Container from '@mui/material/Container';
import Box, { BoxProps } from '@mui/material/Box';

export default function Section({
bg = 'white',
...props
}: { bg?: 'white' | 'comfort' | 'dim' | 'gradient' } & BoxProps) {
interface SelectionProps extends BoxProps {
bg?: 'white' | 'comfort' | 'dim' | 'gradient';
}

export default function Section(props: SelectionProps) {
const { bg = 'white', children, sx, ...other } = props;

const map = {
white: {
light: 'common.white',
Expand All @@ -22,7 +25,7 @@ export default function Section({
};
return (
<Box
{...props}
{...other}
sx={{
...(bg === 'gradient'
? {
Expand All @@ -36,10 +39,10 @@ export default function Section({
}),
py: { xs: 4, sm: 6, md: 8 },
overflow: 'hidden',
...props.sx,
...sx,
}}
>
<Container>{props.children}</Container>
<Container>{children}</Container>
</Box>
);
}
2 changes: 1 addition & 1 deletion docs/src/modules/components/TopLayoutBlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const styles = ({ theme }) => ({
theme.palette.mode === 'dark'
? `linear-gradient(180deg, ${theme.palette.primaryDark[900]} 0%, #001E3C 100%)`
: `linear-gradient(180deg, ${theme.palette.grey[50]} 0%, #FFFFFF 100%)`,
backgroundSize: 'auto 250px ',
backgroundSize: '100% 300px',
backgroundRepeat: 'no-repeat',
[`& .${classes.back}`]: {
display: 'flex',
Expand Down

0 comments on commit 4c2e681

Please sign in to comment.