Skip to content

Commit 435b741

Browse files
authored
Merge pull request #143 from boostcampwm-2022/138-피드백-관련-컴포넌트-리팩토링-및-문서화
피드백 관련 컴포넌트 리팩토링 및 문서화
2 parents 16ba36c + d32796b commit 435b741

File tree

18 files changed

+191
-245
lines changed

18 files changed

+191
-245
lines changed

frontend/src/components/@drawer/RecordDrawer/RecordDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import DocsItem from '@components/@shared/DocsItem/DocsItem';
1+
import DocsItem from '@components/DocsItem/DocsItem';
22
import { REST_TYPE } from '@constants/rest.constant';
33
import { DocsItemDtoType } from '@customType/dto';
44
import axios from 'axios';

frontend/src/components/@shared/FeedbackBox/FeedbackBox.stories.tsx

Lines changed: 0 additions & 46 deletions
This file was deleted.

frontend/src/components/@shared/FeedbackBox/FeedbackBox.tsx

Lines changed: 0 additions & 83 deletions
This file was deleted.

frontend/src/components/FeedbackArea/FeedbackArea.style.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

frontend/src/components/FeedbackArea/FeedbackArea.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { css } from '@emotion/react';
2+
3+
export const fbBtnContainer = css`
4+
position: absolute;
5+
right: 10px;
6+
height: 100%;
7+
padding: 5px 0px;
8+
display: flex;
9+
flex-direction: column;
10+
justify-content: space-between;
11+
`;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React from 'react';
2+
3+
import useCrudFeedback from '@hooks/useCrudFeedback';
4+
5+
import { ReactComponent as DeleteIcon } from '@assets/icon/delete.svg';
6+
import { ReactComponent as EditIcon } from '@assets/icon/edit.svg';
7+
import { ReactComponent as CheckIcon } from '@assets/icon/check.svg';
8+
import { iconSmStyle } from '@styles/commonStyle';
9+
import { fbBtnContainer } from './FeedbackEditBtns.style';
10+
11+
interface Props {
12+
id: string;
13+
readOnly: boolean;
14+
}
15+
16+
const FeedbackEditBtn = ({ id, readOnly }: Props) => {
17+
const { handleStartEditFeedback, handleEndEditFeedback, handleDeleteFeedback } =
18+
useCrudFeedback(id);
19+
20+
return (
21+
<div css={fbBtnContainer}>
22+
{readOnly ? (
23+
<button onClick={handleStartEditFeedback}>
24+
<EditIcon {...iconSmStyle} fill="black" />
25+
</button>
26+
) : (
27+
<button onClick={handleEndEditFeedback}>
28+
<CheckIcon {...iconSmStyle} fill="black" />
29+
</button>
30+
)}
31+
<button onClick={handleDeleteFeedback}>
32+
<DeleteIcon {...iconSmStyle} fill="black" />
33+
</button>
34+
</div>
35+
);
36+
};
37+
38+
export default FeedbackEditBtn;

0 commit comments

Comments
 (0)