diff --git a/frontend/src/apis/trash.ts b/frontend/src/apis/trash.ts index ebcbf8cee..926e08e17 100644 --- a/frontend/src/apis/trash.ts +++ b/frontend/src/apis/trash.ts @@ -1,9 +1,10 @@ import { trashURL } from 'constants/apis/url'; import { http } from './fetch'; +import { GetDeletedWritingsResponse } from 'types/apis/trash'; // 글 휴지통으로 이동: POST export const moveToTrash = (writingIds: number[]) => - http.post(`${trashURL}`, { + http.post(trashURL, { json: { writingIds, isPermanentDelete: false, @@ -12,9 +13,16 @@ export const moveToTrash = (writingIds: number[]) => // 글 영구 삭제: POST export const deletePermanentWritings = (writingIds: number[]) => - http.post(`${trashURL}`, { + http.post(trashURL, { json: { writingIds, isPermanentDelete: true, }, }); + +// 휴지통에 있는 글 목록 조회: GET +export const getDeletedWritings = (): Promise => http.get(trashURL); + +// 휴지통에서 글 복구: POST +export const restoreDeletedWritings = (writingIds: number[]) => + http.post(`${trashURL}/restore`, { json: { writingIds } }); diff --git a/frontend/src/components/@common/Accordion/AccordionPanel.tsx b/frontend/src/components/@common/Accordion/AccordionPanel.tsx index e38d9c27c..57e56d115 100644 --- a/frontend/src/components/@common/Accordion/AccordionPanel.tsx +++ b/frontend/src/components/@common/Accordion/AccordionPanel.tsx @@ -18,6 +18,5 @@ const S = { display: flex; flex-direction: column; width: 100%; - padding-left: 2rem; `, }; diff --git a/frontend/src/components/@common/Accordion/AccordionTitle.tsx b/frontend/src/components/@common/Accordion/AccordionTitle.tsx index 1932d867f..d3d5807a4 100644 --- a/frontend/src/components/@common/Accordion/AccordionTitle.tsx +++ b/frontend/src/components/@common/Accordion/AccordionTitle.tsx @@ -40,9 +40,15 @@ export default AccordionTitle; const S = { Container: styled.div` display: flex; + gap: 0.8rem; align-items: center; width: 100%; + padding: 0 0.4rem; border-radius: 4px; + + &:hover { + background-color: ${({ theme }) => theme.color.gray4}; + } `, IconButton: styled.button>` diff --git a/frontend/src/components/Category/Category/Category.tsx b/frontend/src/components/Category/Category/Category.tsx index 00dde531e..a7242e1c6 100644 --- a/frontend/src/components/Category/Category/Category.tsx +++ b/frontend/src/components/Category/Category/Category.tsx @@ -1,4 +1,4 @@ -import { TrashCanIcon, PencilIcon } from 'assets/icons'; +import { PencilIcon } from 'assets/icons'; import { usePageNavigate } from 'hooks/usePageNavigate'; import { KeyboardEventHandler } from 'react'; import { styled } from 'styled-components'; @@ -95,15 +95,14 @@ const S = { justify-content: space-between; align-items: center; width: 100%; - height: 3.2rem; - padding: 0.8rem; - border-radius: 8px; + height: 3.6rem; + border-radius: 4px; font-size: 1.4rem; &:hover { div { display: inline-flex; - gap: 0.8rem; + gap: 0.4rem; } } `, @@ -111,6 +110,7 @@ const S = { CategoryButton: styled.button` flex: 1; min-width: 0; + height: 100%; text-align: left; `, @@ -136,6 +136,7 @@ const S = { IconContainer: styled.div` display: none; + margin-right: 0.4rem; `, Button: styled.button` @@ -144,7 +145,8 @@ const S = { align-items: center; width: 2rem; height: 2.4rem; - border-radius: 8px; + padding: 0.4rem; + border-radius: 4px; &:hover { background-color: ${({ theme }) => theme.color.gray5}; diff --git a/frontend/src/components/Category/Header/Header.tsx b/frontend/src/components/Category/Header/Header.tsx index 774f4875e..c8073aed5 100644 --- a/frontend/src/components/Category/Header/Header.tsx +++ b/frontend/src/components/Category/Header/Header.tsx @@ -4,7 +4,7 @@ import useCategoryInput from '../useCategoryInput'; import { useCategoryMutation } from '../useCategoryMutation'; import { isValidCategoryName } from '../isValidCategoryName'; import Input from 'components/@common/Input/Input'; -import { PlusCircleIcon } from 'assets/icons'; +import { PlusIcon } from 'assets/icons'; const Header = () => { const { @@ -50,7 +50,7 @@ const Header = () => { /> ) : ( - + )} @@ -64,10 +64,10 @@ const S = { display: flex; justify-content: space-between; align-items: center; - height: 2.8rem; + height: 3.6rem; + padding: 0.8rem; font-size: 1.2rem; font-weight: 400; - padding-right: 0.8rem; `, Title: styled.h1` @@ -80,8 +80,8 @@ const S = { justify-content: center; align-items: center; width: 2rem; - height: 2.4rem; - border-radius: 8px; + height: 2rem; + border-radius: 4px; &:hover { background-color: ${({ theme }) => theme.color.gray5}; diff --git a/frontend/src/components/Category/WritingList/WritingList.tsx b/frontend/src/components/Category/WritingList/WritingList.tsx index 56190820b..238fc5dd4 100644 --- a/frontend/src/components/Category/WritingList/WritingList.tsx +++ b/frontend/src/components/Category/WritingList/WritingList.tsx @@ -22,9 +22,8 @@ const WritingList = ({ categoryId, isOpen }: Props) => { return (