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 3 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>
Comment on lines +5 to +9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다른 부분도 그렇고, default도 이렇게 직접 default라는 것을 명시해야 하나요? 말 그대로 기본값이라 그냥 둬도 된다고 생각이 들어서 명시해야 하는 이유가 궁금합니다!!

Copy link
Collaborator Author

@llddang llddang Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 저부분은 IconBox를 지금은 default 로 사용하지만 나중에는 pointer 나 text로 사용할 가능성도 있을 거라 생각되어서 저렇게 만들어 두었습니다!

{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'];
}
2 changes: 1 addition & 1 deletion src/components/Modal/ActionModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ActionModal = ({
<Modal isCentered isOpen={isOpen} onClose={onClose} size={size || 'md'}>
<ModalOverlay />
<ModalContent rounded="2xl">
<Text textStyle="bold_2xl" px="4" pt="4">
<Text textStyle="bold_2xl" px="4" pt="4" cursor="default">
{title}
</Text>
<ModalBody p="4">{children}</ModalBody>
Expand Down
15 changes: 8 additions & 7 deletions src/containers/study/DocumentModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ const DocumentModal = ({ id, isOpen, setIsDocsModalOpen, setReload }: DocumentMo
>
<Flex textStyle="bold_md" gap="4">
<Box w={3 / 5} p="4" textColor="white" bgColor={colors.orange_dark} rounded="2xl">
<Text>{document?.description}</Text>
<Text cursor="default">{document?.description}</Text>
</Box>
<Flex justify="space-between" direction="column" w={2 / 5} p="4" bgColor={colors.orange_light} rounded="2xl">
<Flex justify="space-between">
<Text> 작성자</Text>
<Text> {document?.uploaderName} </Text>
<Text cursor="default"> 작성자</Text>
<Text cursor="default"> {document?.uploaderName} </Text>
</Flex>
<Flex justify="space-between">
<Text> 공개범위</Text>
<Text> {document?.accessType === 'ALL' ? '전체 공개' : '팀 공개'} </Text>
<Text cursor="default"> 공개범위</Text>
<Text cursor="default"> {document?.accessType === 'ALL' ? '전체 공개' : '팀 공개'} </Text>
</Flex>
</Flex>
</Flex>
<Text textStyle="bold_xl" mt="8">
<Text textStyle="bold_xl" mt="8" cursor="default">
첨부파일
</Text>
<Box className="scroll" overflowY="auto" maxH="72" mt="4">
Expand All @@ -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