Skip to content

Commit 3398240

Browse files
committed
desing: content 개행 받아올 수 있게 수정, 사이드바 높이 100% 수정
1 parent 1786a5c commit 3398240

File tree

7 files changed

+32
-19
lines changed

7 files changed

+32
-19
lines changed

src/components/admin/adminInquiry/AdminInquiryAnswer.styled.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import { SendButton } from '../../user/customerService/inquiry/Inquiry.styled';
1010

1111
export const InquiryAnswerContentContainer = styled(
1212
AdminInquiryContentContainer
13-
)``;
13+
)`
14+
margin-bottom: 5rem;
15+
`;
1416

1517
export const InquiryAnswerContentWrapper = styled(AdminInquiryContentWrapper)``;
1618

src/components/admin/adminInquiry/AdminInquiryAnswer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function AdminInquiryAnswer() {
1515
useOutletContext();
1616

1717
const [answer, setAnswer] = useState<string>('');
18-
const selectButton: LinkType = answer === null ? '작성하기' : '수정하기';
18+
const selectButton: LinkType = answerData === null ? '작성하기' : '수정하기';
1919

2020
useEffect(() => {
2121
if (answerData === null) {

src/components/admin/adminInquiry/AdminInquiryAnswerWrite.styled.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export const SpinnerWrapper = styled(SpinnerWrapperStyled)``;
1515

1616
export const InquiryAnswerContentContainer = styled(
1717
AdminInquiryContentContainer
18-
)``;
18+
)`
19+
margin-bottom: 5rem;
20+
`;
1921

2022
export const InquiryAnswerWriteWrapper = styled(AdminInquiryContentWrapper)``;
2123

@@ -39,7 +41,6 @@ export const InquiryAnswerWriteButton = styled(InquiryAnswerButton)`
3941
export const InquiryAnswerWriteButtonSpan = styled.span``;
4042

4143
export const InquiryAnswerWrite = styled(InquiryContent)`
42-
resize: none;
4344
border: 1px solid ${({ theme }) => theme.color.placeholder};
4445
border-radius: ${({ theme }) => theme.borderRadius.primary};
4546
padding: 1rem;

src/components/admin/adminInquiry/AdminInquiryAnswerWrite.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ export default function AdminInquiryAnswerWrite() {
4545
}
4646
}, [answerData]);
4747

48+
useEffect(() => {
49+
if (inputRef && inputRef.current) {
50+
inputRef.current.style.height = 'auto';
51+
inputRef.current.style.height = `${inputRef.current.scrollHeight}px`;
52+
}
53+
}, [answer]);
54+
4855
if (isLoading) {
4956
return (
5057
<S.SpinnerWrapper $isAdmin={true}>
@@ -94,7 +101,7 @@ export default function AdminInquiryAnswerWrite() {
94101
value={answer}
95102
ref={inputRef}
96103
onChange={handleChangeAnswer}
97-
></S.InquiryAnswerWrite>
104+
/>
98105
</S.InquiryAnswerWriteWrapper>
99106
<Modal isOpen={isOpen} onClose={handleModalClose}>
100107
{message}

src/components/admin/adminInquiry/AdminInquiryDetailContent.styled.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export const InquiryDeleteButton = styled(SendButton)`
4545
export const InquiryContent = styled.div`
4646
font-size: 1.1rem;
4747
width: 100%;
48+
white-space: pre-line;
49+
overflow: hidden;
4850
`;
4951

5052
export const InquiryFileImgBlowUpButton = styled.button``;

src/components/common/admin/sidebar/AdminSidebar.styled.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const SidebarContainer = styled.section`
1717
position: fixed;
1818
padding: 1rem;
1919
width: 15rem;
20+
height: 100%;
2021
border-right: 1px solid ${({ theme }) => theme.color.grey};
2122
`;
2223

src/hooks/admin/useAdminInquiry.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ export const useAdminInquiry = ({
2727
const handleButtonState = (state: State, isDeleteApi: boolean = false) => {
2828
switch (state) {
2929
case 'success':
30-
{
31-
if (!isDeleteApi) {
32-
handleModalOpen(ADMIN_MODAL_MESSAGE.writeSuccess);
30+
if (!isDeleteApi) {
31+
handleModalOpen(ADMIN_MODAL_MESSAGE.writeSuccess);
32+
} else {
33+
handleConfirm?.();
34+
handleModalOpen(ADMIN_MODAL_MESSAGE.writeDeleteSuccess);
35+
}
36+
setTimeout(() => {
37+
if (id) {
38+
console.log('제대로 탐');
39+
40+
return navigate(`/admin/inquiries/detail/${id}`);
3341
} else {
34-
handleConfirm?.();
35-
handleModalOpen(ADMIN_MODAL_MESSAGE.writeDeleteSuccess);
42+
console.log('??');
43+
return navigate(-1);
3644
}
37-
const timer = setTimeout(() => {
38-
if (id) {
39-
return navigate(`/admin/inquiries/detail/${id}`);
40-
} else {
41-
return navigate(-1);
42-
}
43-
}, 1000);
44-
clearTimeout(timer);
45-
}
45+
}, 1000);
4646
break;
4747
case 'fail':
4848
if (!isDeleteApi) {

0 commit comments

Comments
 (0)