Skip to content

Commit

Permalink
Merge pull request #302 from SOPT-all/feat/#299/location-none
Browse files Browse the repository at this point in the history
[Feat] classCard ์žฅ์†Œ ์ˆ˜์ •
  • Loading branch information
heesunee authored Jan 24, 2025
2 parents f2a4b41 + df2ba28 commit 6d2168a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
18 changes: 18 additions & 0 deletions src/components/ClassCard/index.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,26 @@ export const cardContainerStyle = style({
export const cardImageStyle = style({
width: '8.4rem',
height: '8.4rem',
flexShrink: 0,

borderRadius: 3.4,

backgroundColor: vars.colors.gray04,
});

export const cardContentStyle = style({
flex: 1,
display: 'flex',
flexDirection: 'column',
gap: '0.8rem',
overflow: 'hidden',

width: '100%',
});

export const lessonNameStyle = style({
width: '100%',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
});
16 changes: 12 additions & 4 deletions src/components/ClassCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const ClassCard = ({
return '๋ชจ์ง‘์ค‘';
case 'completed':
return '๋ชจ์ง‘์™„๋ฃŒ';
case 'ongoing':
return '๋ชจ์ง‘์™„๋ฃŒ';
default:
return '';
}
Expand Down Expand Up @@ -96,7 +98,7 @@ const ClassCard = ({

<Flex gap="1.2rem" marginBottom="1.6rem">
<img src={lessonImageUrl} className={styles.cardImageStyle} alt={`${lessonName} ์ด๋ฏธ์ง€`} />
<Flex direction="column" gap="0.8rem">
<Flex direction="column" gap="0.8rem" className={styles.cardContentStyle}>
<Flex gap="0.3rem">
<Tag type="genre" size="small">
{lessonGenre && genreMapping[lessonGenre]}
Expand All @@ -105,7 +107,7 @@ const ClassCard = ({
{lessonLevel && levelMapping[lessonLevel]}
</Tag>
</Flex>
<Head level="h2" tag="h6">
<Head level="h2" tag="h6" className={styles.lessonNameStyle}>
{lessonName}
</Head>
<Flex direction="column" gap="0.4rem">
Expand All @@ -126,8 +128,14 @@ const ClassCard = ({
์žฅ์†Œ
</Text>
<Text tag="c1" color="gray9">
{lessonLocation}&nbsp;
{lessonDetailedAddress}
{lessonLocation || lessonDetailedAddress ? (
<>
{lessonLocation}&nbsp;
{lessonDetailedAddress}
</>
) : (
'๋ฏธ์ •'
)}
</Text>
</Flex>
</Flex>
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/components/LessonItem/index.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const titleStyle = style({
maxHeight: '4rem',

whiteSpace: 'normal',
wordBreak: 'break-all',
});

export const teacherImageStyle = style({
Expand Down

0 comments on commit 6d2168a

Please sign in to comment.