diff --git a/frontend/src/assets/images/index.ts b/frontend/src/assets/images/index.ts index 7ae0f15f3..9c1d4f327 100644 --- a/frontend/src/assets/images/index.ts +++ b/frontend/src/assets/images/index.ts @@ -6,7 +6,7 @@ export { default as TrashcanIcon } from './trashcan.svg'; export { default as UserCircleIcon } from './userCircle.svg'; export { default as ChevronIcon } from './chevron.svg'; export { default as Chevron2Icon } from './chevron2.svg'; -export { default as XCircleIcon } from './xCircle.svg'; +export { default as XSignIcon } from './xSign.svg'; export { default as EyeIcon } from './eye.svg'; export { default as ArrowUpIcon } from './arrowUp.svg'; export { default as SettingIcon } from './setting.svg'; diff --git a/frontend/src/assets/images/xCircle.svg b/frontend/src/assets/images/xCircle.svg deleted file mode 100644 index 4fd227116..000000000 --- a/frontend/src/assets/images/xCircle.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/frontend/src/assets/images/xSign.svg b/frontend/src/assets/images/xSign.svg new file mode 100644 index 000000000..d1491b7ca --- /dev/null +++ b/frontend/src/assets/images/xSign.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/components/TagButton/TagButton.style.ts b/frontend/src/components/TagButton/TagButton.style.ts index aae250811..8a9f0d3db 100644 --- a/frontend/src/components/TagButton/TagButton.style.ts +++ b/frontend/src/components/TagButton/TagButton.style.ts @@ -1,28 +1,25 @@ import styled from '@emotion/styled'; -import { theme } from '@/style/theme'; - -export const TagButtonWrapper = styled.button<{ isFocused: boolean }>` +export const TagButtonWrapper = styled.button<{ background: string; border: string; isFocused: boolean }>` cursor: pointer; display: flex; - gap: 0.5rem; + gap: 0.75rem; align-items: center; justify-content: center; box-sizing: border-box; height: 1.75rem; + margin: 0.25rem; padding: 0 0.75rem; - background-color: ${({ isFocused }) => (isFocused ? theme.color.light.primary_400 : theme.color.light.tertiary_50)}; - border: 1px solid ${({ isFocused }) => (isFocused ? theme.color.light.primary_600 : theme.color.light.tertiary_200)}; - border-radius: 2.5rem; + opacity: ${({ isFocused }) => (isFocused ? '0.99' : '0.85')}; + background-color: ${({ background }) => background}; + border-radius: 0.5rem; + outline: ${({ isFocused }) => (isFocused ? '1.5' : '1')}px solid ${({ border }) => border}; + box-shadow: ${({ isFocused }) => isFocused && '0 0 3px #00000070'}; &:disabled { cursor: text; } - - &:not(:disabled):hover { - box-shadow: 0 1px 4px #00000030; - } `; diff --git a/frontend/src/components/TagButton/TagButton.tsx b/frontend/src/components/TagButton/TagButton.tsx index 99441fbf3..6d3a66996 100644 --- a/frontend/src/components/TagButton/TagButton.tsx +++ b/frontend/src/components/TagButton/TagButton.tsx @@ -1,9 +1,12 @@ -import { XCircleIcon } from '@/assets/images'; +import { XSignIcon } from '@/assets/images'; import { Text } from '@/components'; +import { TAG_COLORS, INPUT_TAG_COLOR } from '@/style/tagColors'; import { theme } from '@/style/theme'; + import * as S from './TagButton.style'; interface Props { + id?: number; name: string; isFocused?: boolean; disabled?: boolean; @@ -11,11 +14,23 @@ interface Props { onClick?: () => void; } -const TagButton = ({ name, isFocused = false, disabled = false, variant = 'default', onClick }: Props) => ( - onClick && onClick()}> - {name} - {variant === 'edit' && } - -); +const getTagColor = (id?: number) => (id ? TAG_COLORS[id % TAG_COLORS.length] : INPUT_TAG_COLOR); + +const TagButton = ({ id, name, isFocused = false, disabled = false, variant = 'default', onClick }: Props) => { + const { background, border } = getTagColor(id); + + return ( + onClick && onClick()} + > + {name} + {variant === 'edit' && } + + ); +}; export default TagButton; diff --git a/frontend/src/components/TemplateCard/TemplateCard.tsx b/frontend/src/components/TemplateCard/TemplateCard.tsx index f9ed1df91..0b3e8ded7 100644 --- a/frontend/src/components/TemplateCard/TemplateCard.tsx +++ b/frontend/src/components/TemplateCard/TemplateCard.tsx @@ -71,13 +71,13 @@ const TemplateCard = ({ template }: Props) => { - + {tags.map((tag: Tag) => ( - + ))} @@ -92,7 +92,7 @@ const TemplateCard = ({ template }: Props) => { {tags.length !== 0 && showAllTagList && ( {tags.map((tag: Tag) => ( - + ))} )} diff --git a/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.style.ts b/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.style.ts index d59bc530c..91205bc28 100644 --- a/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.style.ts +++ b/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.style.ts @@ -4,11 +4,11 @@ import { theme } from '@/style/theme'; export const TagFilterMenuContainer = styled.div` display: flex; - gap: 1rem; + gap: 0.5rem; align-items: flex-start; width: 100%; - padding: 1rem; + padding: 0.75rem 0.75rem 0 0.75rem; border: 1px solid ${theme.color.light.secondary_300}; border-radius: 8px; @@ -19,10 +19,11 @@ export const TagButtonsContainer = styled.div<{ height: string }>` display: flex; flex-wrap: wrap; gap: 0.5rem; - align-items: flex-start; + align-items: center; width: 100%; height: ${({ height }) => height}; + margin-bottom: 0.75rem; transition: height 0.3s ease-in-out; `; diff --git a/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.tsx b/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.tsx index 31bdbde22..d038bb9d5 100644 --- a/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.tsx +++ b/frontend/src/pages/MyTemplatesPage/components/TagFilterMenu/TagFilterMenu.tsx @@ -8,7 +8,7 @@ import { remToPx } from '@/utils'; import * as S from './TagFilterMenu.style'; -const LINE_HEIGHT_REM = 1.875; +const LINE_HEIGHT_REM = 2.25; interface Props { tagList: Tag[]; @@ -69,10 +69,23 @@ const TagFilterMenu = ({ tagList, selectedTagIds, onSelectTags }: Props) => { {selectedTags.map((tag) => ( - handleButtonClick(tag.id)} /> + handleButtonClick(tag.id)} + /> ))} {unselectedTags.map((tag) => ( - handleButtonClick(tag.id)} /> + handleButtonClick(tag.id)} + /> ))} {showMoreButton && ( diff --git a/frontend/src/pages/TemplatePage/TemplatePage.tsx b/frontend/src/pages/TemplatePage/TemplatePage.tsx index d05fde5f3..00f959243 100644 --- a/frontend/src/pages/TemplatePage/TemplatePage.tsx +++ b/frontend/src/pages/TemplatePage/TemplatePage.tsx @@ -148,7 +148,7 @@ const TemplatePage = () => { {template.tags.map((tag) => ( - + ))}