Skip to content

Commit

Permalink
[#103] feat: add and refactor icon and fix MultiSelect style (#105)
Browse files Browse the repository at this point in the history
* feat: add script

* feat: update design system

* feat: add icon

* feat: add renew design system and fix style

* fix: delete useless

* refactor: delete useles

* style: fix icon color

* fix: fix select style

* fix: delete useless

* refactor: delete dupl
  • Loading branch information
dohui-son authored Aug 26, 2024
1 parent a72cf94 commit 9804da9
Show file tree
Hide file tree
Showing 45 changed files with 165 additions and 322 deletions.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
"build:gongmuin-client": "nx run gongmuin-client:build",
"dev-client": "nx run gongmuin-client:dev",
"gen-icon-client": "nx run gongmuin-client:gen-icon",
"gen-design-system": "nx run gongmuin-client:gen-design-system"
"gen-design-system": "nx run gongmuin-client:gen-design-system",
"gen-api": "nx run gongmuin-client:gen-api",
"storybook": "nx run gmi-design-system:storybook",
"build-storybook": "nx run gmi-design-system:build-storybook",
"build-design-system": "nx run gmi-design-system:build"
}
}
2 changes: 2 additions & 0 deletions packages/client/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ textarea,
letter-spacing: inherit; /* 1 */
color: inherit; /* 1 */
background: transparent; /* 2 */
border: none;
text-decoration: none;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/clientPages/home/ui/ClientHomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function ClientHomePage() {
size: 10,
},
})

console.log(recommendQuestions, questions)
return (
<>
<MainLoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export function MultiSelect({
boxShadow: '0px 0px 4px 0px rgba(0, 0, 0, 0.25)',
backgroundColor: 'white',
overflow: 'hidden',
gap: '6px',
}}
>
{items.map((item) => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ButtonHTMLAttributes, ReactNode } from 'react'
import { color } from '@gds/token'
import * as styles from './SNSButton.css'
import { IconKakao } from '../../icon/default/IconKakao'
import { IconNaver } from '../../icon/default/IconNaver'
Expand All @@ -23,7 +24,11 @@ export function SNSButton({
{...props}
>
<div className={styles.LogoBox}>
{socialLoginType === 'kakao' ? <IconKakao /> : <IconNaver />}
{socialLoginType === 'kakao' ? (
<IconKakao />
) : (
<IconNaver color={color.white} />
)}
</div>
<div
className={styles.TxtBox({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ function IconCharacter(
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<g clipPath="url(#a)">
<g
clipPath={`
url(#${titleId})`}
>
<path
fill="#231815"
stroke="#231815"
Expand Down Expand Up @@ -84,7 +87,7 @@ function IconCharacter(
/>
</g>
<defs>
<clipPath id="a">
<clipPath id={titleId}>
<path fill="#fff" d="M.09 0h143.824v150H.09z" />
</clipPath>
</defs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function IconChat(
/>
</g>
<defs>
<clipPath id="a">
<clipPath id={titleId}>
<path fill="#fff" d="M0 0h16v16H0z" />
</clipPath>
</defs>
Expand Down
42 changes: 0 additions & 42 deletions packages/client/src/design-system/icon/default/IconCheckCircle.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { SVGProps } from 'react'
import { Ref, forwardRef } from 'react'
import type { IconProps } from '../shared/props'

function IconCheckCircleFilled(
function IconCheckFilled(
{
title = 'IconCheckCircleFilled',
titleId = 'GDS-IconCheckCircleFilled',
title = 'IconCheckFilled',
titleId = 'GDS-IconCheckFilled',
size = 20,
color = '#2A2A2A',
...props
Expand All @@ -31,12 +31,12 @@ function IconCheckCircleFilled(
/>
</g>
<defs>
<clipPath id="a">
<clipPath id={titleId}>
<path fill="#fff" d="M0 0h16v16H0z" />
</clipPath>
</defs>
</svg>
)
}
const ForwardRef = forwardRef(IconCheckCircleFilled)
export { ForwardRef as IconCheckCircleFilled }
const ForwardRef = forwardRef(IconCheckFilled)
export { ForwardRef as IconCheckFilled }

This file was deleted.

8 changes: 4 additions & 4 deletions packages/client/src/design-system/icon/default/IconNaver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ function IconNaver(
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<g clipPath="url(#a)">
<g clipPath={`url(#${titleId})`}>
<path
fill="#fff"
fill={color}
d="M11.35 8.563 5.416 0H.5v16h5.15V7.436L11.584 16H16.5V0h-5.15z"
/>
</g>
<defs>
<clipPath id="a">
<path fill="#fff" d="M.5 0h16v16H.5z" />
<clipPath id={titleId}>
<path fill={color} d="M.5 0h16v16H.5z" />
</clipPath>
</defs>
</svg>
Expand Down
8 changes: 4 additions & 4 deletions packages/client/src/design-system/icon/default/IconPlus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ function IconPlus(
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<g clipPath="url(#a)">
<g clipPath={`url(#${titleId})`}>
<path
fill="#fff"
fill={color}
d="M19.25 13H13v6.25c0 .688-.562 1.25-1.25 1.25s-1.25-.562-1.25-1.25V13H4.25C3.563 13 3 12.438 3 11.75s.563-1.25 1.25-1.25h6.25V4.25c0-.687.563-1.25 1.25-1.25S13 3.563 13 4.25v6.25h6.25c.688 0 1.25.563 1.25 1.25S19.938 13 19.25 13"
/>
</g>
<defs>
<clipPath id="a">
<path fill="#fff" d="M0 0h24v24H0z" />
<clipPath id={titleId}>
<path fill={color} d="M0 0h24v24H0z" />
</clipPath>
</defs>
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { SVGProps } from 'react'
import { Ref, forwardRef } from 'react'
import type { IconProps } from '../shared/props'

function IconWhiteLike(
function IconThumbUp(
{
title = 'IconWhiteLike',
titleId = 'GDS-IconWhiteLike',
title = 'IconThumbUp',
titleId = 'GDS-IconThumbUp',
size = 20,
color = '#2A2A2A',
...props
Expand All @@ -24,19 +24,19 @@ function IconWhiteLike(
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<g clipPath="url(#a)">
<g clipPath={`url(#${titleId})`}>
<path
fill="#fff"
fill={color}
d="M5.625 13.625h5.625c.519 0 .963-.312 1.15-.762l1.887-4.407q.087-.213.088-.456V6.75c0-.687-.562-1.25-1.25-1.25H9.181l.594-2.856.019-.2a.94.94 0 0 0-.275-.663l-.663-.656-4.118 4.119a1.24 1.24 0 0 0-.363.881v6.25c0 .688.563 1.25 1.25 1.25m0-7.5 2.713-2.712L7.5 6.75h5.625V8l-1.875 4.375H5.625zm-5 0h2.5v7.5h-2.5z"
/>
</g>
<defs>
<clipPath id="a">
<clipPath id={titleId}>
<path fill="#fff" d="M0 .5h15v15H0z" />
</clipPath>
</defs>
</svg>
)
}
const ForwardRef = forwardRef(IconWhiteLike)
export { ForwardRef as IconWhiteLike }
const ForwardRef = forwardRef(IconThumbUp)
export { ForwardRef as IconThumbUp }
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ function PrimarySmile(
strokeWidth={4}
rx={91}
/>
<g clipPath={titleId}>
<g
clipPath={`
url(#${titleId})`}
>
<path
fill="#231815"
stroke="#231815"
Expand Down
6 changes: 2 additions & 4 deletions packages/client/src/design-system/icon/default/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export { IconBookmarkFilled } from './IconBookmarkFilled'
export { IconCharacter } from './IconCharacter'
export { IconChat } from './IconChat'
export { IconCheck } from './IconCheck'
export { IconCheckCircle } from './IconCheckCircle'
export { IconCheckCircleFilled } from './IconCheckCircleFilled'
export { IconCheckFilled } from './IconCheckFilled'
export { IconClose } from './IconClose'
export { IconCredit } from './IconCredit'
export { IconCreditFill } from './IconCreditFill'
Expand All @@ -28,7 +27,6 @@ export { IconNaver } from './IconNaver'
export { IconPlus } from './IconPlus'
export { IconSearch } from './IconSearch'
export { IconThumbUpFilled } from './IconThumbUpFilled'
export { IconWhiteLike } from './IconWhiteLike'
export { IconThumbUp } from './IconThumbUp'
export { PrimarySmile } from './PrimarySmile'
export { SplashLogo } from './SplashLogo'
export { IconLikesDefault } from './IconLikesDefault'
13 changes: 0 additions & 13 deletions packages/client/src/entities/@types/question.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/client/src/entities/@types/signup.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/client/src/shared/ui/QuestionList/Question.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { IconBookmark, IconCredit, IconLikesDefault } from '@gds/icon'
import { IconBookmark, IconCredit, IconThumbUp } from '@gds/icon'
import { Badge } from '@gds/component'
import { color } from '@gds/token'
import { QuestionPostSimpleResponse } from '@server-api/api'
Expand Down Expand Up @@ -78,7 +78,7 @@ function Question({ data }: Props) {
{data.savedCount}
</div>
<div className={styles.QuestionIconBox} />
<IconLikesDefault color={color['gray-300']} />
<IconThumbUp color={color['gray-300']} />
<div className={styles.QuestionIconTxtBox}>
{data.recommendCount}
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/widgets/Home/ui/Recommend/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Image from 'next/image'
import { IconBookmark, IconCredit, IconWhiteLike } from '@gds/icon'
import { IconBookmark, IconCredit, IconThumbUp } from '@gds/icon'
import { Badge } from '@gds/component'
import { color } from '@gds/token'
import { QuestionPostSimpleResponse } from '@server-api/api'
Expand Down Expand Up @@ -53,7 +53,7 @@ function HomeRecommend({
</div>
<div className={styles.NumberBox}>{savedCount}</div>
<div>
<IconWhiteLike size={15} />
<IconThumbUp color={color.white} size={15} />
</div>
<div className={styles.NumberBox}>{recommendCount}</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/widgets/QuestionDetail/ui/AnswerCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { Button } from '@gds/component'
import { IconChat, IconCheckCircle, IconCheckCircleFilled } from '@gds/icon'
import { IconChat, IconCheck, IconCheckFilled } from '@gds/icon'
import { color, Typo } from '@gds/token'
import { AnswerDetailResponse } from '@server-api/api'
import {
Expand Down Expand Up @@ -79,9 +79,9 @@ export function AnswerCard({ answerSelectDone, answerData, userId }: Props) {
size="small"
rightIcon={
answerData?.isChosen ? (
<IconCheckCircle size={16} />
<IconCheck size={16} />
) : (
<IconCheckCircleFilled
<IconCheckFilled
size={16}
color={color['primary-main']}
/>
Expand Down
Loading

0 comments on commit 9804da9

Please sign in to comment.