Showing
1 changed file
with
14 additions
and
0 deletions
... | @@ -3,10 +3,23 @@ import { ThemeProvider } from "styled-components"; | ... | @@ -3,10 +3,23 @@ import { ThemeProvider } from "styled-components"; |
3 | import GlobalStyles from "../Styles/GlobalStyles"; | 3 | import GlobalStyles from "../Styles/GlobalStyles"; |
4 | import Helmet from "./Helmet"; | 4 | import Helmet from "./Helmet"; |
5 | import Theme from "../Styles/Theme"; | 5 | import Theme from "../Styles/Theme"; |
6 | +import { gql } from "@apollo/client"; | ||
7 | +import { useQuery } from "@apollo/react-hooks"; | ||
6 | import { BrowserRouter } from "react-router-dom"; | 8 | import { BrowserRouter } from "react-router-dom"; |
7 | import Main from "../Routes/Main/MainPresenter"; | 9 | import Main from "../Routes/Main/MainPresenter"; |
10 | +import Router from "../Routes/Router"; | ||
11 | + | ||
12 | +const QUERY = gql` | ||
13 | + { | ||
14 | + isLoggedIn @client | ||
15 | + } | ||
16 | +`; | ||
8 | 17 | ||
9 | export default () => { | 18 | export default () => { |
19 | + const { | ||
20 | + data: { isLoggedIn }, | ||
21 | + } = useQuery(QUERY); | ||
22 | + | ||
10 | return ( | 23 | return ( |
11 | <ThemeProvider theme={Theme}> | 24 | <ThemeProvider theme={Theme}> |
12 | <> | 25 | <> |
... | @@ -14,6 +27,7 @@ export default () => { | ... | @@ -14,6 +27,7 @@ export default () => { |
14 | <Helmet /> | 27 | <Helmet /> |
15 | <BrowserRouter> | 28 | <BrowserRouter> |
16 | <Main /> | 29 | <Main /> |
30 | + <Router isLoggedIn={isLoggedIn} /> | ||
17 | </BrowserRouter> | 31 | </BrowserRouter> |
18 | </> | 32 | </> |
19 | </ThemeProvider> | 33 | </ThemeProvider> | ... | ... |
-
Please register or login to post a comment