Skip to content

Commit

Permalink
chore : Prettier 적용
Browse files Browse the repository at this point in the history
chore : Prettier 적용
  • Loading branch information
seungwoohan12 committed Jan 30, 2025
1 parent 6516c29 commit 6e87a0e
Show file tree
Hide file tree
Showing 10 changed files with 427 additions and 413 deletions.
1 change: 0 additions & 1 deletion src/components/Post/MessageCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const MessageCard: React.FC<Message> = ({
content,
time,
}) => {

// 임시 함수: userId를 가공하거나 기본 출력용으로 활용
const getUserIdDisplay = (id: string | number) => {
return `User: ${id}`;
Expand Down
215 changes: 103 additions & 112 deletions src/components/board/Header.tsx
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);
}
`;
32 changes: 17 additions & 15 deletions src/components/board/PostCard/index.tsx
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;
82 changes: 41 additions & 41 deletions src/components/board/PostCard/style.ts
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;
`;
Loading

0 comments on commit 6e87a0e

Please sign in to comment.