forked from EFUB/efub4-first-react-study
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PostWritePage.jsx
58 lines (54 loc) Β· 1.31 KB
/
PostWritePage.jsx
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
56
57
58
import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import styled from "styled-components";
import TextInput from "../UI/TextInput";
import Button from "../UI/Button";
const Wrapper = styled.div`
width: calc(100%-32px);
padding: 16px;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
`;
const Container = styled.div`
width: 100%;
max-width: 720px;
& > * {
:not(:last-child) {
margin-bottom: 16px;
}
}
`;
function PostWritePage(props) {
const navigate = useNavigate();
const [title, setTItle] = useState("");
const [content, setContent] = useState("");
return (
<Wrapper>
<Container>
<TextInput
height={20}
value={title}
onChange={(event) => {
setTItle(event.target.value);
}}
></TextInput>
<TextInput
height={480}
value={content}
onChange={(event) => {
setContent(event.target.value);
}}
></TextInput>
<Button
title="κΈ μμ±νκΈ°"
onClick={() => {
navigate("/");
}}
></Button>
</Container>
</Wrapper>
);
}
export default PostWritePage;