37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import "../styles/globals.css";
|
|
import "tailwindcss/tailwind.css";
|
|
import React from "react";
|
|
import { GlobalSidebar } from "../components/layouts/global-sidebar";
|
|
import styles from "./_app.module.css";
|
|
import { ApolloProvider } from "@apollo/client";
|
|
import { useApollo } from "../commons/graphql/client";
|
|
import { ThemeProvider, useTheme } from '../commons/theme';
|
|
import { SwitchTheme } from '../components/switch-theme';
|
|
import "./articles/article.css";
|
|
|
|
function MyApp({ Component, pageProps }) {
|
|
const apolloClient = useApollo(pageProps);
|
|
return (
|
|
<ApolloProvider client={apolloClient}>
|
|
<ThemeProvider>
|
|
<div className={styles.page}>
|
|
<GlobalSidebar className={styles.sidebar} />
|
|
<div className={styles.primary}>
|
|
<header className={styles.pageHeader}>
|
|
<h1>{"Ivan Li 的个人博客"}</h1>
|
|
<div className={styles.actions}>
|
|
<SwitchTheme />
|
|
</div>
|
|
</header>
|
|
<div className={styles.wrapper}>
|
|
<Component {...pageProps} />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</ThemeProvider>
|
|
</ApolloProvider>
|
|
);
|
|
}
|
|
|
|
export default MyApp;
|