File tree Expand file tree Collapse file tree 7 files changed +32
-19
lines changed
Expand file tree Collapse file tree 7 files changed +32
-19
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ import { SendButton } from '../../user/customerService/inquiry/Inquiry.styled';
1010
1111export const InquiryAnswerContentContainer = styled (
1212 AdminInquiryContentContainer
13- ) `` ;
13+ ) `
14+ margin-bottom: 5rem;
15+ ` ;
1416
1517export const InquiryAnswerContentWrapper = styled ( AdminInquiryContentWrapper ) `` ;
1618
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ export const SpinnerWrapper = styled(SpinnerWrapperStyled)``;
1515
1616export const InquiryAnswerContentContainer = styled (
1717 AdminInquiryContentContainer
18- ) `` ;
18+ ) `
19+ margin-bottom: 5rem;
20+ ` ;
1921
2022export const InquiryAnswerWriteWrapper = styled ( AdminInquiryContentWrapper ) `` ;
2123
@@ -39,7 +41,6 @@ export const InquiryAnswerWriteButton = styled(InquiryAnswerButton)`
3941export const InquiryAnswerWriteButtonSpan = styled . span `` ;
4042
4143export 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;
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ export const InquiryDeleteButton = styled(SendButton)`
4545export const InquiryContent = styled . div `
4646 font-size: 1.1rem;
4747 width: 100%;
48+ white-space: pre-line;
49+ overflow: hidden;
4850` ;
4951
5052export const InquiryFileImgBlowUpButton = styled . button `` ;
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments