sdy

change main page

1 import React from "react"; 1 import React from "react";
2 -import gql from "graphql-tag";
3 -import { useQuery } from "@apollo/react-hooks";
4 import { ThemeProvider } from "styled-components"; 2 import { ThemeProvider } from "styled-components";
5 import GlobalStyles from "../Styles/GlobalStyles"; 3 import GlobalStyles from "../Styles/GlobalStyles";
6 import Helmet from "./Helmet"; 4 import Helmet from "./Helmet";
7 import Theme from "../Styles/Theme"; 5 import Theme from "../Styles/Theme";
8 -import Router from "../Routes/Router";
9 import { BrowserRouter } from "react-router-dom"; 6 import { BrowserRouter } from "react-router-dom";
10 - 7 +import Main from "../Routes/Main/MainPresenter";
11 -const QUERY = gql`
12 - {
13 - isLoggedIn @client
14 - }
15 -`;
16 8
17 export default () => { 9 export default () => {
18 - const { data } = useQuery(QUERY);
19 - let isLoggedIn;
20 -
21 - if (data !== undefined) {
22 - isLoggedIn = data.isLoggedIn;
23 - }
24 -
25 return ( 10 return (
26 <ThemeProvider theme={Theme}> 11 <ThemeProvider theme={Theme}>
27 <> 12 <>
28 <GlobalStyles /> 13 <GlobalStyles />
29 <Helmet /> 14 <Helmet />
30 <BrowserRouter> 15 <BrowserRouter>
31 - <Router isLoggedIn={isLoggedIn} /> 16 + <Main />
17 + <h1>good</h1>
32 </BrowserRouter> 18 </BrowserRouter>
33 </> 19 </>
34 </ThemeProvider> 20 </ThemeProvider>
......