Skip to content

Commit

Permalink
refactor: 토픽 카드에 이미지 추가 및 blur 처리 구현 (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
GC-Park authored Aug 1, 2023
1 parent 836bc14 commit 2a6e5b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-storybook": "^0.6.12",
"html-webpack-plugin": "^5.5.3",
"msw": "1.2.1",
"msw": "^1.2.2",
"prettier": "^3.0.0",
"process": "^0.11.10",
"react-refresh": "^0.14.0",
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/TopicCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ const TopicCard = ({
$flexDirection="column"
$alignItems="center"
$justifyContent="center"
$backgroundColor="whiteGray"
$borderRadius="small"
$backgroundImage={topicImage}
$backgroundSize="360px 140px"
>
<MultiSelectButton
type="checkbox"
Expand All @@ -62,15 +63,15 @@ const TopicCard = ({
checked={Boolean(tagId.includes(topicId))}
/>
<Flex
width="100%"
height="65px"
$flexDirection="column"
$alignItems="center"
$justifyContent="center"
cursor="pointer"
onClick={goToSelectedTopic}
$backdropFilter="blur(20px)"
>
<Text color="black" $fontSize="extraLarge" $fontWeight="normal">
{topicImage}
</Text>
<Text color="black" $fontSize="medium" $fontWeight="normal">
{topicTitle}
</Text>
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/common/Box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { radiusKey } from '../../../themes/radius';
export type BoxProps = {
display?: string;
width?: string;
$minWidth?: string;
height?: string;
padding?: SpaceThemeKeys;
$backgroundColor?: colorThemeKey;
Expand All @@ -25,10 +26,14 @@ export type BoxProps = {
$borderBottom?: string;
$borderLeft?: string;
cursor?: string;
$backgroundImage?: string;
$backgroundSize?: string;
$backdropFilter?: string;
};

const Box = styled.div<BoxProps>`
display: ${({ display }) => display ?? 'block'};
min-width: ${({ $minWidth }) => $minWidth};
background-color: ${({ $backgroundColor }) =>
$backgroundColor && theme.color[$backgroundColor]};
color: ${({ color }) => color && theme.color[color]};
Expand All @@ -50,5 +55,8 @@ const Box = styled.div<BoxProps>`
border-bottom: ${({ $borderBottom }) => $borderBottom};
border-left: ${({ $borderLeft }) => $borderLeft};
cursor: ${({ cursor }) => cursor};
background-image: url(${({ $backgroundImage }) => $backgroundImage});
background-size: ${({ $backgroundSize }) => $backgroundSize};
backdrop-filter: ${({ $backdropFilter }) => $backdropFilter};
`;
export default Box;

0 comments on commit 2a6e5b9

Please sign in to comment.