mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 15:05:35 +00:00
refactor: split theme file
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
import styled from '@emotion/styled';
|
||||
import TransitionLayout from '~/components/layouts/_transition_layout';
|
||||
|
||||
const DropdownContainer = styled.div<{ show: boolean }>(({ show, theme }) => ({
|
||||
zIndex: 99,
|
||||
position: 'absolute',
|
||||
top: 'calc(100% + 0.5em)',
|
||||
right: 0,
|
||||
minWidth: '175px',
|
||||
backgroundColor: show ? theme.colors.secondary : theme.colors.background,
|
||||
border: `2px solid ${theme.colors.secondary}`,
|
||||
borderRadius: theme.border.radius,
|
||||
boxShadow: theme.colors.boxShadow,
|
||||
display: show ? 'flex' : 'none',
|
||||
flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
}));
|
||||
const DropdownContainer = styled(TransitionLayout)<{ show: boolean }>(
|
||||
({ show, theme }) => ({
|
||||
zIndex: 99,
|
||||
position: 'absolute',
|
||||
top: 'calc(100% + 0.5em)',
|
||||
right: 0,
|
||||
minWidth: '175px',
|
||||
backgroundColor: show ? theme.colors.secondary : theme.colors.background,
|
||||
border: `2px solid ${theme.colors.secondary}`,
|
||||
borderRadius: theme.border.radius,
|
||||
boxShadow: theme.colors.boxShadow,
|
||||
display: show ? 'flex' : 'none',
|
||||
flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
})
|
||||
);
|
||||
|
||||
export default DropdownContainer;
|
||||
|
||||
@@ -7,7 +7,6 @@ import DarkThemeContextProvider from '~/contexts/dark_theme_context';
|
||||
export default function BaseLayout({ children }: { children: ReactNode }) {
|
||||
const { i18n } = useTranslation();
|
||||
dayjs.locale(i18n.language);
|
||||
console.log('a');
|
||||
return (
|
||||
<DarkThemeContextProvider key="a">
|
||||
<ContextThemeProvider>{children}</ContextThemeProvider>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Global, ThemeProvider, css, useTheme } from '@emotion/react';
|
||||
import { ReactNode } from 'react';
|
||||
import useDarkTheme from '~/hooks/use_dark_theme';
|
||||
import { darkTheme, lightTheme } from '~/styles/theme';
|
||||
import { darkTheme } from '~/styles/themes/dark_theme';
|
||||
import { lightTheme } from '~/styles/themes/light_theme';
|
||||
|
||||
export default function ContextThemeProvider({
|
||||
children,
|
||||
|
||||
Reference in New Issue
Block a user