[enh][m]: update theme (#40)

This commit is contained in:
Tavares Hansen
2020-08-02 19:29:25 -07:00
parent 18d7039dc9
commit ba68632805
12 changed files with 362 additions and 16 deletions

View File

@@ -1,11 +1,23 @@
/* istanbul ignore file */
import '../styles/index.css';
import { useEffect, useState } from 'react';
import { ApolloProvider } from '@apollo/react-hooks';
import { useApollo } from '../lib/apolloClient';
import { DEFAULT_THEME } from '../themes';
import { applyTheme } from '../themes/utils';
import './App.css';
export default function MyApp({ Component, pageProps }) {
const apolloClient = useApollo(pageProps.initialApolloState);
const [theme, setTheme] = useState(DEFAULT_THEME);
useEffect(() => {
/**
* We can switch theme.
* e.g. setTheme('primary');
* */
applyTheme(theme);
}, [theme]);
return (
<ApolloProvider client={apolloClient}>