Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mimarz committed Sep 24, 2024
1 parent 05511a5 commit c8a0601
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion apps/_components/src/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import cl from 'clsx/lite';
import classes from './Container.module.css';

type ContainerProps = {
children: React.ReactNode;
children?: React.ReactNode;
className?: string;
};

Expand Down
2 changes: 1 addition & 1 deletion apps/_components/src/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Header = ({ menu, betaTag }: HeaderProps) => {
onClick={() => setOpen(false)}
prefetch={false}
className={cl(
pathname.includes(item.href) && classes.active,
pathname?.includes(item.href) && classes.active,
classes.link,
'ds-paragraph--md',
'ds-focus',
Expand Down
64 changes: 33 additions & 31 deletions apps/storefront/layouts/MenuPageLayout/MenuPageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,39 +46,41 @@ const MenuPageLayout = ({ content, data, banner }: PageLayoutProps) => {
{banner.ingress && <BannerIngress>{banner.ingress}</BannerIngress>}
</Banner>
)}
<Container className={classes.page}>
<div className={classes.left}>
<SidebarMenu routerPath={pathname} />
</div>
<main id='main' className={classes.right}>
{data && (
<div className={classes.header}>
<div className={classes.headerText}>
<Heading size='lg' className={classes.title}>
{data.title}
</Heading>
{data.date && <div className={classes.date}>{data.date}</div>}
</div>
<div
className={cn(
classes.iconContainer,
data.color === 'red' && classes.red,
data.color === 'blue' && classes.blue,
data.color === 'yellow' && classes.yellow,
)}
>
{data.icon && data.icon}
{!data.icon && <ComponentIcon fontSize='4rem' />}
{pathname && (
<Container className={classes.page}>
<div className={classes.left}>
<SidebarMenu routerPath={pathname} />
</div>
<main id='main' className={classes.right}>
{data && (
<div className={classes.header}>
<div className={classes.headerText}>
<Heading size='lg' className={classes.title}>
{data.title}
</Heading>
{data.date && <div className={classes.date}>{data.date}</div>}
</div>
<div
className={cn(
classes.iconContainer,
data.color === 'red' && classes.red,
data.color === 'blue' && classes.blue,
data.color === 'yellow' && classes.yellow,
)}
>
{data.icon && data.icon}
{!data.icon && <ComponentIcon fontSize='4rem' />}
</div>
</div>
</div>
)}
)}

<div className={classes.content} id='content'>
<MdxContent>{content}</MdxContent>
<GithubLink className={classes.githubLink} />
</div>
</main>
</Container>
<div className={classes.content} id='content'>
<MdxContent>{content}</MdxContent>
<GithubLink className={classes.githubLink} />
</div>
</main>
</Container>
)}
</div>
);
};
Expand Down

0 comments on commit c8a0601

Please sign in to comment.