Skip to content

Commit

Permalink
Merge pull request #1014 from peer-42seoul/hotfix-1.0.4/admin-viewr
Browse files Browse the repository at this point in the history
[1.0.4 / admin] 어드민 공지 뷰에서 토스트에디터뷰어와 작성시간이 안보이는 문제 해결
  • Loading branch information
HiHoi authored Feb 14, 2024
2 parents 3b22cfc + 10c3400 commit b8889e8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/app/admin/announce/Announce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ const Announce = () => {
} = useModal()

const [currentNoticeStatus, setCurrentNoticeStatus] = useState('없음')
const [currentContent, setCurrentContent] = useState('')
const [currentDate, setCurrentDate] = useState('')

// 초기 페이지 진입시 공지사항 목록 불러오기
useEffect(() => {
Expand Down Expand Up @@ -331,7 +333,8 @@ const Announce = () => {
setValue('content', res.data.content)
setValue('date', res.data.date)
setValue('announcementStatus', res.data.announcementStatus)

setCurrentDate(res.data.date)
setCurrentContent(res.data.content)
let noticeStatusValue = '없음' // 기본값
if (
res.data.announcementStatus === '게제' ||
Expand Down Expand Up @@ -566,10 +569,15 @@ const Announce = () => {
: '게제된 시간'}
</Typography>
<TextField
// value={
// getValues('date')?.split('T')[0] +
// ' ' +
// getValues('date')?.split('T')[1]
// }
value={
getValues('date')?.split('T')[0] +
currentDate?.split('T')[0] +
' ' +
getValues('date')?.split('T')[1]
currentDate?.split('T')[1]
}
disabled={true}
/>
Expand All @@ -578,7 +586,8 @@ const Announce = () => {
{writeMode === 'view' ? (
<Box>
<DynamicToastViewer
initialValue={getValues('content')}
// initialValue={getValues('content')}
initialValue={currentContent}
sx={{
width: '100%',
wordBreak: 'break-word',
Expand Down

0 comments on commit b8889e8

Please sign in to comment.