@@ -3,31 +3,35 @@ import styled from 'styled-components'
33import type { TGtdType } from '@/spec'
44import { GTD_TYPE } from '@/constant'
55
6- import css from '@/utils/css'
6+ import css , { theme } from '@/utils/css'
77
88import GtdWipSVG from '@/icons/GtdWip'
99import GtdDoneSVG from '@/icons/GtdDone'
1010import GtdTodoSVG from '@/icons/GtdTodo'
1111
12- export const Wrapper = styled . div < { type : TGtdType } > `
12+ type TType = { type : TGtdType }
13+
14+ export const Wrapper = styled . div < TType > `
1315 ${ css . size ( 18 ) } ;
1416 ${ css . flex ( 'align-both' ) } ;
15- background: ${ ( { type } ) => ( type === GTD_TYPE . BUG ? '#eb6a6a' : '#3871e0' ) } ;
17+ background: ${ ( { type } ) =>
18+ type === GTD_TYPE . BUG ? theme ( 'gtdBadge.bugBg' ) : theme ( 'gtdBadge.featBg' ) } ;
1619 border-top-left-radius: 6px;
1720 border-bottom-left-radius: 6px;
21+ margin-right: -4px;
1822`
19- export const WipIcon = styled ( GtdWipSVG ) `
23+ export const WipIcon = styled ( GtdWipSVG ) < TType > `
2024 ${ css . size ( 9 ) } ;
21- fill: white;
22- /* fill: #3871e0; */
25+ fill: ${ ( { type } ) =>
26+ type === GTD_TYPE . BUG ? theme ( 'gtdBadge.bug' ) : theme ( 'gtdBadge.feat' ) } ;
2327`
24- export const DoneIcon = styled ( GtdDoneSVG ) `
28+ export const DoneIcon = styled ( GtdDoneSVG ) < TType > `
2529 ${ css . size ( 10 ) } ;
26- fill: white;
27- /* fill: #3871e0; */
30+ fill: ${ ( { type } ) =>
31+ type === GTD_TYPE . BUG ? theme ( 'gtdBadge.bug' ) : theme ( 'gtdBadge.feat' ) } ;
2832`
29- export const TODOIcon = styled ( GtdTodoSVG ) `
33+ export const TODOIcon = styled ( GtdTodoSVG ) < TType > `
3034 ${ css . size ( 10 ) } ;
31- fill: white;
32- /* fill: #3871e0; */
35+ fill: ${ ( { type } ) =>
36+ type === GTD_TYPE . BUG ? theme ( 'gtdBadge.bug' ) : theme ( 'gtdBadge.feat' ) } ;
3337`
0 commit comments