feat: add basic admin dashboard

This commit is contained in:
Sonny
2024-05-26 03:18:25 +02:00
committed by Sonny
parent f3f7f6272f
commit 202f70b010
24 changed files with 324 additions and 33 deletions

View File

@@ -1,11 +1,15 @@
import dayjs from 'dayjs';
import { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import ContextThemeProvider from '~/components/layouts/_theme_layout';
import DarkThemeContextProvider from '~/contexts/dark_theme_context';
const BaseLayout = ({ children }: { children: ReactNode }) => (
<DarkThemeContextProvider>
<ContextThemeProvider>{children}</ContextThemeProvider>
</DarkThemeContextProvider>
);
export default BaseLayout;
export default function BaseLayout({ children }: { children: ReactNode }) {
const { i18n } = useTranslation();
dayjs.locale(i18n.language);
return (
<DarkThemeContextProvider>
<ContextThemeProvider>{children}</ContextThemeProvider>
</DarkThemeContextProvider>
);
}

View File

@@ -109,5 +109,35 @@ function GlobalStyles() {
},
});
return <Global styles={[cssReset, documentStyle, scrollbarStyle]} />;
const tableStyle = css({
table: {
height: 'auto',
width: '100%',
borderCollapse: 'collapse',
borderRadius: localTheme.border.radius,
overflow: 'hidden',
},
th: {
textAlign: 'center',
fontWeight: 400,
backgroundColor: localTheme.colors.secondary,
},
'td, th': {
padding: '0.45em',
},
'th, td': {
whiteSpace: 'nowrap',
},
'tr:nth-of-type(even)': {
backgroundColor: localTheme.colors.secondary,
},
});
return (
<Global styles={[cssReset, documentStyle, scrollbarStyle, tableStyle]} />
);
}