Merge Q-CAST-III-MR-721: Home 소스정리
This commit is contained in:
commit
f00ea2648a
@ -12,13 +12,10 @@ import { globalLocaleStore } from '@/store/localeAtom'
|
|||||||
import { queryStringFormatter } from '@/util/common-utils'
|
import { queryStringFormatter } from '@/util/common-utils'
|
||||||
import { useMainContentsController } from '@/hooks/main/useMainContentsController'
|
import { useMainContentsController } from '@/hooks/main/useMainContentsController'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
|
||||||
|
|
||||||
import { handleFileDown } from '@/util/board-utils'
|
import { handleFileDown } from '@/util/board-utils'
|
||||||
|
|
||||||
export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
||||||
const { swalFire } = useSwal()
|
|
||||||
|
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
@ -33,7 +30,7 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
|||||||
const { fetchObjectList, initObjectList } = useMainContentsController()
|
const { fetchObjectList, initObjectList } = useMainContentsController()
|
||||||
|
|
||||||
//첨부파일
|
//첨부파일
|
||||||
const [boardList, setBoardList] = useState([])
|
const [fileList, setFileList] = useState([])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchObjectList()
|
fetchObjectList()
|
||||||
fetchNoticeList()
|
fetchNoticeList()
|
||||||
@ -62,9 +59,7 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
|||||||
|
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
if (resultData.result.code === 200) {
|
if (resultData.result.code === 200) {
|
||||||
setBoardList(resultData.data)
|
setFileList(resultData.data)
|
||||||
} else {
|
|
||||||
alert(resultData.result.message)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,11 +200,11 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
|||||||
)}
|
)}
|
||||||
</ProductItem>
|
</ProductItem>
|
||||||
<ProductItem num={4} name={'Data Download'}>
|
<ProductItem num={4} name={'Data Download'}>
|
||||||
{boardList.length > 0 ? (
|
{fileList.length > 0 ? (
|
||||||
<div className="data-download-wrap">
|
<div className="data-download-wrap">
|
||||||
{boardList?.map((board) => (
|
{fileList?.map((file) => (
|
||||||
<button type="button" key={board.noticeNo} className="data-down" onClick={() => handleFileDown(board.noticeNo, 'Y')}>
|
<button type="button" key={file.noticeNo} className="data-down" onClick={() => handleFileDown(file.noticeNo, 'Y')}>
|
||||||
<span>{board.title}</span>
|
<span>{file.title}</span>
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user