Skip to content

Commit

Permalink
Merge pull request #21 from yingpengsha/fix/apply-siteConfig
Browse files Browse the repository at this point in the history
🐛 fix: apply siteToken configuration
  • Loading branch information
canisminor1990 committed Oct 18, 2023
2 parents e7208f1 + 7a37f54 commit 730fbd5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/layouts/DocLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@ import { shallow } from 'zustand/shallow';
import Favicons from '@/components/Favicons';
import { StoreUpdater } from '@/components/StoreUpdater';
import GlobalStyle from '@/layouts/DocLayout/GlobalStyle';
import { useThemeStore } from '@/store';
import { siteSelectors, useSiteStore, useThemeStore } from '@/store';
import customToken from '@/styles/customToken';

import DocumentLayout from './DocumentLayout';

const App = memo(() => {
const themeMode = useThemeStore((st) => st.themeMode, shallow);
const userToken = useSiteStore(siteSelectors.token);

return (
<>
<Favicons />
<StoreUpdater />
<ThemeProvider customToken={customToken} themeMode={themeMode}>
<ThemeProvider
customToken={(themeToken) => Object.assign({}, customToken(themeToken), userToken)}
themeMode={themeMode}
>
<GlobalStyle />
<DocumentLayout />
</ThemeProvider>
Expand Down

0 comments on commit 730fbd5

Please sign in to comment.