-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
55 lines (48 loc) · 935 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from "react";
import { render } from "react-dom";
import styled, { injectGlobal } from "styled-components";
import Buttons from "./buttons";
injectGlobal`
* {
box-sizing: border-box;
}
html, body {
height: 100%;
margin: 0;
font-family: 'Open Sans', sans-serif;
}
body {
padding: 10px;
}
#container {
height: 100%;
}
`;
const AppWrapper = styled.div`
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
`;
const AppTitle = styled.h1`
margin: 12px 6px;
`;
const ButtonsWrapper = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex-grow: 1;
& > * {
margin: 12px;
}
`;
const App = () => (
<AppWrapper>
<AppTitle>styled-components demo</AppTitle>
<ButtonsWrapper>
<Buttons />
</ButtonsWrapper>
</AppWrapper>
);
render(<App />, document.getElementById("container"));