Skip to content

Commit

Permalink
add alert page
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Feb 21, 2024
1 parent 86da856 commit 2f21ebc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/zero-runtime-next-app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const theme = extendTheme({
},
});

theme.palette = theme.colorSchemes.light;
theme.getColorSchemeSelector = (key) => {
return `[data-mui-color-scheme="${key}"]`;
};
Expand All @@ -97,6 +98,7 @@ const zeroPluginOptions = {
transformLibraries: ['local-ui-lib'],
sourceMap: true,
displayName: true,
transformSx: false,
};

/** @type {import('next').NextConfig} */
Expand Down
27 changes: 27 additions & 0 deletions apps/zero-runtime-next-app/src/app/alert/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { styled } from '@mui/zero-runtime';
import BasicAlerts from '../../../../../docs/data/material/components/alert/BasicAlerts';

const Main = styled('div')(({ theme }) => ({
display: 'flex',
flexDirection: 'column',
gap: '16px',
marginInline: 'auto',
maxWidth: '900px',
paddingBlock: '16px',
[theme.breakpoints.up('sm')]: {
paddingInline: '24px',
},
[theme.breakpoints.up('lg')]: {
paddingInline: '60px',
},
}));

export default function MaterialUILayout() {
return (
<Main>
<h1>Material-UI</h1>
<p>This is an example app using Material-UI.</p>
<BasicAlerts />
</Main>
);
}
5 changes: 4 additions & 1 deletion apps/zero-runtime-next-app/src/augment.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { ExtendTheme } from '@mui/zero-runtime';
import type { Theme } from '@mui/material/styles';
import type {} from '@mui/material/themeCssVarsAugmentation';

declare module '@mui/zero-runtime/theme' {
interface ThemeTokens {
Expand Down Expand Up @@ -29,6 +31,7 @@ declare module '@mui/zero-runtime/theme' {
theme: ExtendTheme<{
colorScheme: 'light' | 'dark';
tokens: ThemeTokens;
}>;
}> &
Theme;
}
}

0 comments on commit 2f21ebc

Please sign in to comment.