-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
427 additions
and
413 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,107 @@ | ||
import React from 'react'; | ||
import styled from '@emotion/styled'; | ||
import { BsTrashFill,BsThreeDotsVertical } from 'react-icons/bs'; | ||
import { BsTrashFill, BsThreeDotsVertical } from 'react-icons/bs'; | ||
|
||
interface BoardHeader{ | ||
boardName : string; | ||
} | ||
|
||
const Header:React.FC<BoardHeader> = ({ boardName }) => { | ||
|
||
const handleEditButton = () =>{ | ||
|
||
/* 추후 api 연동 */ | ||
alert('수정하기 버튼을 눌렀습니다.') | ||
}; | ||
|
||
const handleDeleteButton = () => { | ||
|
||
/* 추후 api 연동 */ | ||
alert('삭제하기 버튼을 눌렀습니다.') | ||
} | ||
|
||
const handleCreateButton = () => { | ||
|
||
/* 추후 api 연동 */ | ||
alert('생성하기 버튼을 눌렀습니다.') | ||
} | ||
|
||
return ( | ||
|
||
<Container> | ||
<Info> | ||
<Title> | ||
<Board>{boardName}</Board> | ||
</Title> | ||
<EditButton | ||
onClick={handleEditButton} | ||
/> | ||
<DeleteButton | ||
onClick={handleDeleteButton} | ||
/> | ||
</Info> | ||
<CreateButton onClick={handleCreateButton}>수업 생성</CreateButton> | ||
</Container> | ||
) | ||
interface BoardHeader { | ||
boardName: string; | ||
} | ||
|
||
const Header: React.FC<BoardHeader> = ({ boardName }) => { | ||
const handleEditButton = () => { | ||
/* 추후 api 연동 */ | ||
alert('수정하기 버튼을 눌렀습니다.'); | ||
}; | ||
|
||
const handleDeleteButton = () => { | ||
/* 추후 api 연동 */ | ||
alert('삭제하기 버튼을 눌렀습니다.'); | ||
}; | ||
|
||
const handleCreateButton = () => { | ||
/* 추후 api 연동 */ | ||
alert('생성하기 버튼을 눌렀습니다.'); | ||
}; | ||
|
||
export default Header; | ||
|
||
const Container=styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
width: 100%; | ||
`; | ||
|
||
const Info=styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
width: 100%; | ||
`; | ||
|
||
const Title = styled.div` | ||
display: flex; | ||
margin-right: 1.19rem; | ||
`; | ||
|
||
const Board = styled.p` | ||
color: var(--white); | ||
margin: 0; /* 기본 마진 제거 */ | ||
text-shadow: 0px 0px 4px var(--black); | ||
font-family: "Pretendard"; | ||
font-size: 4.0625rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: normal; | ||
`; | ||
|
||
const EditButton=styled(BsThreeDotsVertical)` | ||
color: var(--light-gray); | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const DeleteButton=styled(BsTrashFill)` | ||
color: var(--light-gray); | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const CreateButton=styled.button` | ||
color: var(--white); | ||
text-align: center; | ||
font-family: "Pretendard"; | ||
font-size: 1.375rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: normal; | ||
width: 9.92306rem; | ||
height: 3.25rem; | ||
flex-shrink: 0; | ||
border: none; | ||
border-radius: 3.125rem; | ||
background: var(--gray); | ||
margin-top: 3rem; | ||
&:hover { | ||
background: var(--black); | ||
} | ||
`; | ||
|
||
return ( | ||
<Container> | ||
<Info> | ||
<Title> | ||
<Board>{boardName}</Board> | ||
</Title> | ||
<EditButton onClick={handleEditButton} /> | ||
<DeleteButton onClick={handleDeleteButton} /> | ||
</Info> | ||
<CreateButton onClick={handleCreateButton}>수업 생성</CreateButton> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default Header; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
width: 100%; | ||
`; | ||
|
||
const Info = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
width: 100%; | ||
`; | ||
|
||
const Title = styled.div` | ||
display: flex; | ||
margin-right: 1.19rem; | ||
`; | ||
|
||
const Board = styled.p` | ||
color: var(--white); | ||
margin: 0; /* 기본 마진 제거 */ | ||
text-shadow: 0px 0px 4px var(--black); | ||
font-family: 'Pretendard'; | ||
font-size: 4.0625rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: normal; | ||
`; | ||
|
||
const EditButton = styled(BsThreeDotsVertical)` | ||
color: var(--light-gray); | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const DeleteButton = styled(BsTrashFill)` | ||
color: var(--light-gray); | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
flex-shrink: 0; | ||
`; | ||
|
||
const CreateButton = styled.button` | ||
color: var(--white); | ||
text-align: center; | ||
font-family: 'Pretendard'; | ||
font-size: 1.375rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: normal; | ||
width: 9.92306rem; | ||
height: 3.25rem; | ||
flex-shrink: 0; | ||
border: none; | ||
border-radius: 3.125rem; | ||
background: var(--gray); | ||
margin-top: 3rem; | ||
&:hover { | ||
background: var(--black); | ||
} | ||
`; |
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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
import React from "react"; | ||
import React from 'react'; | ||
import { PostCardProps } from '../../../models/PostCard'; | ||
import { CardContainer, Title, Badge, Date } from "./style"; | ||
import { CardContainer, Title, Badge, Date } from './style'; | ||
|
||
const PostCard: React.FC<PostCardProps> = ({ postName, badgeCount, date }) => { | ||
return ( | ||
<CardContainer> | ||
{/* 게시글 제목 */} | ||
<Title> | ||
{postName} | ||
{badgeCount > 0 && <Badge>{badgeCount > 99 ? "99+" : badgeCount}</Badge>} | ||
</Title> | ||
{/* 게시글 생성 시간 */} | ||
<Date>{date}</Date> | ||
</CardContainer> | ||
); | ||
}; | ||
|
||
return ( | ||
<CardContainer> | ||
{/* 게시글 제목 */} | ||
<Title> | ||
{postName} | ||
{badgeCount > 0 && ( | ||
<Badge>{badgeCount > 99 ? '99+' : badgeCount}</Badge> | ||
)} | ||
</Title> | ||
{/* 게시글 생성 시간 */} | ||
<Date>{date}</Date> | ||
</CardContainer> | ||
); | ||
}; | ||
|
||
export default PostCard; |
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 |
---|---|---|
@@ -1,52 +1,52 @@ | ||
import styled from "@emotion/styled"; | ||
import styled from '@emotion/styled'; | ||
|
||
export const CardContainer = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 1.13rem 1.75rem; | ||
background-color: var(--post); | ||
border-radius: 0.9375rem; | ||
cursor: pointer; | ||
&:hover { | ||
background-color: var(--light-gray); | ||
} | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 1.13rem 1.75rem; | ||
background-color: var(--post); | ||
border-radius: 0.9375rem; | ||
cursor: pointer; | ||
&:hover { | ||
background-color: var(--light-gray); | ||
} | ||
`; | ||
|
||
export const Title = styled.div` | ||
display: flex; | ||
align-items: center; | ||
color: var(--background); | ||
font-family: "Pretendard"; | ||
font-size: 1.5625rem; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: normal; | ||
display: flex; | ||
align-items: center; | ||
color: var(--background); | ||
font-family: 'Pretendard'; | ||
font-size: 1.5625rem; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: normal; | ||
`; | ||
|
||
export const Badge = styled.span` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-left: 0.69rem; | ||
background-color: var(--red); | ||
color: var(--white); | ||
font-family: "Pretendard"; | ||
font-size: 1.25rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: normal; | ||
width: 2.8125rem; | ||
height: 2.8125rem; | ||
border-radius: 50%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
margin-left: 0.69rem; | ||
background-color: var(--red); | ||
color: var(--white); | ||
font-family: 'Pretendard'; | ||
font-size: 1.25rem; | ||
font-style: normal; | ||
font-weight: 700; | ||
line-height: normal; | ||
width: 2.8125rem; | ||
height: 2.8125rem; | ||
border-radius: 50%; | ||
`; | ||
|
||
export const Date = styled.span` | ||
color: var(--background); | ||
font-family: "Pretendard"; | ||
font-size: 1.25rem; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: normal; | ||
`; | ||
color: var(--background); | ||
font-family: 'Pretendard'; | ||
font-size: 1.25rem; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: normal; | ||
`; |
Oops, something went wrong.