Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#370 학습자료 모달에서 UI 수정 #383

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/IconBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Flex, IconButton, Text } from '@chakra-ui/react';

import { IconBoxProps } from './type';

const IconBox = ({ leftIcon, content, rightIcon, handleClick }: IconBoxProps) => {
const IconBox = ({ leftIcon, content, rightIcon, handleClick, cursor = 'default' }: IconBoxProps) => {
return (
<Flex align="center" gap="1" w="100%" h="40px" minH="40px" color="white" bg="orange_light" borderRadius="2xl">
<IconButton as="div" flexShrink="0" aria-label="" icon={leftIcon} size="icon_md" variant="transparent" />
<Text textStyle="bold_md" flex="auto" cursor="default" isTruncated>
<Text textStyle="bold_md" flex="auto" cursor={cursor} isTruncated>
{content}
</Text>
{rightIcon && (
Expand Down
1 change: 1 addition & 0 deletions src/components/IconBox/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export interface IconBoxProps {
content: string;
rightIcon?: React.ReactElement;
handleClick?: () => void;
cursor?: React.CSSProperties['cursor'];
}
3 changes: 2 additions & 1 deletion src/containers/study/DocumentModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ const DocumentModal = ({ id, isOpen, setIsDocsModalOpen, setReload }: DocumentMo
// leftIcon={data.type === 'pdf' ? <BiFile size={30} /> : <BsFolder2Open size={30} />}
leftIcon={<BiFile size={30} />}
content={data.url.toString()}
cursor="pointer"
/>
</Link>
))}
{document?.type === 'URL' &&
document.files.map((data) => (
<Link key={data.url} href={data.url} target="_blank" rel="noopener noreferrer">
<IconBox leftIcon={<BiLink size="30" />} content={data.url} />
<IconBox leftIcon={<BiLink size="30" />} content={data.url} cursor="pointer" />
</Link>
))}
</Flex>
Expand Down