안형욱

style: GlobalStyle 추가

1 import React from 'react'; 1 import React from 'react';
2 +import { createGlobalStyle } from 'styled-components';
2 import { BrowserRouter, Route, Switch } from 'react-router-dom'; 3 import { BrowserRouter, Route, Switch } from 'react-router-dom';
3 import Home from './pages/Home'; 4 import Home from './pages/Home';
5 +import LoginPage from './pages/LoginPage';
6 +
7 +const GlobalStyle = createGlobalStyle`
8 + html,
9 + body,
10 + #root {
11 + margin: 0;
12 + padding: 0;
13 + height: 100%;
14 + }
15 + html {
16 + box-sizing: border-box;
17 +
18 + * {
19 + box-sizing: inherit;
20 + }
21 + }
22 +`;
4 23
5 const App = () => ( 24 const App = () => (
6 <BrowserRouter> 25 <BrowserRouter>
26 + <GlobalStyle />
7 <Switch> 27 <Switch>
8 <Route path="/" exact component={Home} /> 28 <Route path="/" exact component={Home} />
29 + <Route path="/login" exact component={LoginPage} />
9 </Switch> 30 </Switch>
10 </BrowserRouter> 31 </BrowserRouter>
11 ); 32 );
......