-
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.
Merge pull request #66 from modern-agile-team/feat/jsj/QYOG-94
�feat(QYOG-94): 자유, 공지 게시판 통합
- Loading branch information
Showing
41 changed files
with
722 additions
and
744 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
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,48 @@ | ||
import React, { forwardRef, Ref } from "react"; | ||
import { IconProps } from "../Icon"; | ||
import Svg from "../Svg"; | ||
const SvgCheckSquare35 = forwardRef( | ||
( | ||
{ size, title, desc, titleId, descId, ...props }: IconProps, | ||
ref: Ref<SVGSVGElement> | ||
) => { | ||
let ariaLabelledBy: string | undefined = titleId ? titleId : ""; | ||
ariaLabelledBy += desc && descId ? ` ${descId}` : ""; | ||
ariaLabelledBy = ariaLabelledBy ? ariaLabelledBy : undefined; | ||
props["aria-labelledby"] = ariaLabelledBy; | ||
return ( | ||
<Svg | ||
width={size} | ||
height={size} | ||
viewBox="0 0 24 24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
title={title} | ||
titleId={titleId} | ||
desc={desc} | ||
descId={descId} | ||
aria-labelledby={ariaLabelledBy} | ||
aria-hidden={!ariaLabelledBy} | ||
ref={ref} | ||
{...props} | ||
> | ||
{!!title && <title id={titleId}>{title}</title>} | ||
{!!desc && <desc id={descId}>{desc}</desc>} | ||
<path | ||
d="M12.3955 18.2292L15.3122 21.1458L22.6038 13.8542" | ||
stroke="#898989" | ||
stroke-width="2.1875" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</Svg> | ||
); | ||
} | ||
); | ||
SvgCheckSquare35.defaultProps = { | ||
size: 24, | ||
focusable: false, | ||
"aria-hidden": true, | ||
role: "img", | ||
fill: "currentcolor", | ||
}; | ||
export default SvgCheckSquare35; |
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,139 @@ | ||
/* | ||
* Created on Fri Jan 19 2024 | ||
* | ||
* Copyright (c) 2024 Your Company | ||
*/ | ||
|
||
import React from "react"; | ||
|
||
import * as S from "./emotion"; | ||
import { Button, Typography } from "@/components"; | ||
import { lightThemeColor } from "@/styles/theme"; | ||
import { Converter } from "@/utils"; | ||
|
||
interface PostData { | ||
id: number; | ||
type: string; | ||
} | ||
|
||
interface TableData { | ||
data: | ||
| Swagger.Api.FreePostFindAllAndCount.ResponseBody | ||
| Swagger.Api.NoticePostFindAllAndCount.ResponseBody; | ||
type: string; | ||
handleClickPostDetail: ({ id, type }: PostData) => void; | ||
} | ||
|
||
export default function Table({ | ||
data, | ||
type, | ||
handleClickPostDetail, | ||
}: TableData) { | ||
const slicedData = | ||
type === "free" ? data.contents : data.contents.slice(0, 5); | ||
|
||
const getAuthorType = ( | ||
post: Swagger.FreePostsItemDto | Swagger.NoticePostsItemDto | ||
) => { | ||
if (type === "free" && "isAnonymous" in post && post.isAnonymous) { | ||
return ( | ||
<S.Th | ||
style={{ | ||
width: 100, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head6"> | ||
익명 | ||
</Typography> | ||
</S.Th> | ||
); | ||
} else if (type === "free" && "isAnonymous" in post && !post.isAnonymous) { | ||
return ( | ||
<S.Th | ||
style={{ | ||
width: 100, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head6"> | ||
{post.userId} | ||
</Typography> | ||
</S.Th> | ||
); | ||
} else if (type === "notice") { | ||
return ( | ||
<S.Th | ||
style={{ | ||
width: 100, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head6"> | ||
운영자 | ||
</Typography> | ||
</S.Th> | ||
); | ||
} | ||
}; | ||
|
||
return ( | ||
<S.Tbody> | ||
{slicedData.map((post) => { | ||
return ( | ||
<S.Tr | ||
key={post.id} | ||
onClick={() => handleClickPostDetail({ id: post.id, type })} | ||
type={type} | ||
> | ||
<S.Th | ||
style={{ | ||
width: 100, | ||
}} | ||
> | ||
{type === "free" ? ( | ||
<Typography typoColor="neutral_90" typoSize="Head6"> | ||
{post.id} | ||
</Typography> | ||
) : ( | ||
<Button | ||
shape="square" | ||
backgroundColor="primary_20" | ||
style={{ | ||
border: `1px solid ${lightThemeColor.primary_50}`, | ||
}} | ||
> | ||
<Typography typoColor="primary_80" typoSize="Head7"> | ||
공지 | ||
</Typography> | ||
</Button> | ||
)} | ||
</S.Th> | ||
<S.ThTitle> | ||
<Typography typoColor="neutral_90" typoSize="Head6"> | ||
{post.title} | ||
</Typography> | ||
</S.ThTitle> | ||
|
||
{getAuthorType(post)} | ||
<S.Th | ||
style={{ | ||
width: 150, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head6"> | ||
{new Date(post.createdAt).toLocaleDateString()} | ||
</Typography> | ||
</S.Th> | ||
<S.Th | ||
style={{ | ||
width: 100, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head6"> | ||
{post.hit} | ||
</Typography> | ||
</S.Th> | ||
</S.Tr> | ||
); | ||
})} | ||
</S.Tbody> | ||
); | ||
} |
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,59 @@ | ||
/* | ||
* Created on Fri Jan 19 2024 | ||
* | ||
* Copyright (c) 2024 Your Company | ||
*/ | ||
|
||
import React from "react"; | ||
|
||
import * as S from "./emotion"; | ||
import { Typography } from "@/components"; | ||
import { Converter } from "@/utils"; | ||
|
||
interface PostData { | ||
id: number; | ||
} | ||
|
||
export default function TableHeader() { | ||
return ( | ||
<S.Thead> | ||
<S.Th style={{ padding: `${Converter.pxToRem(40)} 0px`, width: 100 }}> | ||
<Typography typoColor="neutral_90" typoSize="Head5"> | ||
순서 | ||
</Typography> | ||
</S.Th> | ||
<S.ThTitle> | ||
<Typography typoColor="neutral_90" typoSize="Head5"> | ||
제목 | ||
</Typography> | ||
</S.ThTitle> | ||
<S.Th | ||
style={{ | ||
width: 100, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head5"> | ||
작성자 | ||
</Typography> | ||
</S.Th> | ||
<S.Th | ||
style={{ | ||
width: 150, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head5"> | ||
작성일 | ||
</Typography> | ||
</S.Th> | ||
<S.Th | ||
style={{ | ||
width: 100, | ||
}} | ||
> | ||
<Typography typoColor="neutral_90" typoSize="Head5"> | ||
조회 | ||
</Typography> | ||
</S.Th> | ||
</S.Thead> | ||
); | ||
} |
Oops, something went wrong.