이정민

기초적인 마크업

1 +import styled from "styled-components";
1 import Header from "./components/Header"; 2 import Header from "./components/Header";
3 +import Image from "./components/Image";
2 4
3 function App() { 5 function App() {
4 return ( 6 return (
5 - <div className="App"> 7 + <Container>
6 <Header /> 8 <Header />
7 - </div> 9 + <Image />
10 + </Container>
8 ); 11 );
9 } 12 }
10 13
14 +const Container = styled.div`
15 + display: flex;
16 + flex-direction: column;
17 + align-items: center;
18 +`;
19 +
11 export default App; 20 export default App;
......
1 import styled from "styled-components"; 1 import styled from "styled-components";
2 2
3 const Header = () => { 3 const Header = () => {
4 - return <Container></Container>; 4 + return <Container>Gif Generator</Container>;
5 }; 5 };
6 6
7 const Container = styled.div` 7 const Container = styled.div`
8 width: 100%; 8 width: 100%;
9 - height: 4rem; 9 + padding: 1.5rem;
10 background-color: white; 10 background-color: white;
11 box-shadow: ${({ theme }) => theme.boxShadow.normal}; 11 box-shadow: ${({ theme }) => theme.boxShadow.normal};
12 + text-align: center;
13 + font-size: 1.6rem;
14 + font-weight: 500;
15 + font-style: italic;
12 `; 16 `;
13 17
14 export default Header; 18 export default Header;
......
1 +import styled from "styled-components";
2 +
3 +const Image = () => {
4 + return (
5 + <Container>
6 + <ImgBox />
7 + <Menu />
8 + </Container>
9 + );
10 +};
11 +
12 +const Menu = () => {
13 + return (
14 + <div style={{ width: "15rem", marginLeft: "2rem" }}>
15 + <Box />
16 + <Box />
17 + <Box />
18 + <Box />
19 + </div>
20 + );
21 +};
22 +
23 +const Container = styled.div`
24 + width: 100%;
25 + display: flex;
26 + justify-content: center;
27 +`;
28 +const ImgBox = styled.div`
29 + width: 40rem;
30 + height: 30rem;
31 + background-color: white;
32 + box-shadow: ${({ theme }) => theme.boxShadow.normal};
33 + border-radius: 2rem;
34 + margin-top: 2rem;
35 +`;
36 +
37 +const Box = styled.div`
38 + width: 100%;
39 + height: 10rem;
40 + margin-top: 2rem;
41 + border-radius: 1rem;
42 + background-color: white;
43 + box-shadow: ${({ theme }) => theme.boxShadow.normal};
44 +`;
45 +
46 +export default Image;