Skip to content

Commit

Permalink
feat: 첨부된 학습자료 클릭 시 새탭으로 띄워지도록 수정 (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonddori authored Nov 24, 2024
1 parent 9b9b13c commit 552c344
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/containers/study/DocumentModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,20 @@ const DocumentModal = ({ id, isOpen, setIsDocsModalOpen, setReload }: DocumentMo
<Flex direction="column" gap="2">
{document?.type === 'IMAGE' &&
document?.files.map((data) => (
<Link key={data.url} href={S3_URL(data.url)} download>
<Link key={data.url} href={S3_URL(data.url)} download target="_blank" rel="noopener noreferrer">
<Image alt={data.id.toString()} id={data.id.toString()} rounded="2xl" src={S3_URL(data.url)} />
</Link>
))}
{document?.type === 'DOCUMENT' &&
document?.files.map((data) => (
<Link key={data.url} href={S3_URL(data.url)} download id={data.id.toString()}>
<Link
key={data.url}
href={S3_URL(data.url)}
download
id={data.id.toString()}
target="_blank"
rel="noopener noreferrer"
>
<IconBox
// leftIcon={data.type === 'pdf' ? <BiFile size={30} /> : <BsFolder2Open size={30} />}
leftIcon={<BiFile size={30} />}
Expand All @@ -83,7 +90,7 @@ const DocumentModal = ({ id, isOpen, setIsDocsModalOpen, setReload }: DocumentMo
))}
{document?.type === 'URL' &&
document.files.map((data) => (
<Link key={data.url} href={data.url}>
<Link key={data.url} href={data.url} target="_blank" rel="noopener noreferrer">
<IconBox leftIcon={<BiLink size="30" />} content={data.url} />
</Link>
))}
Expand Down

0 comments on commit 552c344

Please sign in to comment.