-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e7142a
commit aef5b3e
Showing
5 changed files
with
171 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const IndexContainer = styled.div` | ||
background-color: #fff; | ||
display: flex; | ||
justify-content: center; | ||
align-content: center; | ||
margin-top: 3 00px; | ||
`; | ||
|
||
export const InnerContainer = styled.div` | ||
margin-top: 50px; | ||
width: 1626px; | ||
height: 701px; | ||
flex-shrink: 0; | ||
display: flex; | ||
flex-direction: column; | ||
border-radius: 30px; | ||
justify-content: center; | ||
`; | ||
export const SignButton = styled.div` | ||
width: 636px; | ||
height: 77px; | ||
flex-shrink: 0; | ||
border-radius: 59px; | ||
background: #3a6e67; | ||
color: #fff; | ||
text-align: center; | ||
font-feature-settings: "clig" off, "liga" off; | ||
font-family: Inter; | ||
font-size: 24px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 20px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-top: 30px; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
import React, { useState } from "react"; | ||
import styled from "@emotion/styled"; | ||
import { | ||
Container, | ||
Title, | ||
ButtonContainer, | ||
Button, | ||
} from "../../emotion/component"; | ||
const Community = () => { | ||
const OuterContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
flex-direction: row; | ||
`; | ||
|
||
const TableContainer = styled.div` | ||
margin-top: 40px; | ||
padding: 0 147px; | ||
table { | ||
width: 100%; | ||
border-collapse: collapse; | ||
th { | ||
border: 1px solid #fff; | ||
color: #fff; | ||
padding: 10px; | ||
background: #76c56f; | ||
} | ||
td { | ||
border: 1px solid #dfdfdf; | ||
padding: 10px; | ||
} | ||
th:nth-of-type(1) { | ||
width: 1361px; | ||
} | ||
th:nth-of-type(2) { | ||
width: 265px; | ||
} | ||
td { | ||
height: 60px; | ||
} | ||
input { | ||
width: 100%; | ||
height: 100%; | ||
border: none; | ||
background: transparent; | ||
color: #000; | ||
font-family: Inter; | ||
font-size: 14px; | ||
} | ||
} | ||
`; | ||
|
||
const [data, setData] = useState([ | ||
{ id: 1, title: "Sample Title 1", author: "John" }, | ||
{ id: 2, title: "Sample Title 2", author: "Jane" }, | ||
{ id: 3, title: "Sample Title 3", author: "Mike" }, | ||
{ id: 4, title: "Sample Title 4", author: "Emily" }, | ||
{ id: 5, title: "Sample Title 5", author: "Alice" }, | ||
{ id: 6, title: "", author: "" }, | ||
{ id: 7, title: "", author: "" }, | ||
{ id: 8, title: "", author: "" }, | ||
{ id: 9, title: "", author: "" }, | ||
{ id: 10, title: "", author: "" }, | ||
]); | ||
|
||
const handleTitleChange = (index, value) => { | ||
setData((prevData) => | ||
prevData.map((item, i) => | ||
index === i ? { ...item, title: value } : item | ||
) | ||
); | ||
}; | ||
|
||
const handleAuthorChange = (index, value) => { | ||
setData((prevData) => | ||
prevData.map((item, i) => | ||
index === i ? { ...item, author: value } : item | ||
) | ||
); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Container> | ||
<OuterContainer> | ||
<Title>커뮤니티</Title> | ||
<ButtonContainer> | ||
<Button>글쓰기</Button> | ||
<Button>내가쓴글</Button> | ||
</ButtonContainer> | ||
</OuterContainer> | ||
<TableContainer> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>제목</th> | ||
<th>글쓴이</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{data.map((item, index) => ( | ||
<tr key={index}> | ||
<td> | ||
<input | ||
type="text" | ||
value={item.title} | ||
onChange={(e) => handleTitleChange(index, e.target.value)} | ||
/> | ||
</td> | ||
<td> | ||
<input | ||
type="text" | ||
value={item.author} | ||
onChange={(e) => | ||
handleAuthorChange(index, e.target.value) | ||
} | ||
/> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</TableContainer> | ||
</Container> | ||
</> | ||
); | ||
}; | ||
|
||
export default Community; |
This file was deleted.
Oops, something went wrong.