File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed
Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @nordcloud/gnui" ,
3- "version" : " 0.2.4 " ,
3+ "version" : " 0.2.5 " ,
44 "main" : " dist/index.js" ,
55 "types" : " dist/index.d.ts" ,
66 "repository" : " git://github.com/nordcloud/gnui.git" ,
Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ interface TagProps {
66 color ?: string ;
77 text ?: string ;
88}
9- const changeTagColor = ( color : string ) => css `
10- background-color: ${ theme . colors [ color ] } ;
11- ` ;
9+
1210export const StyledTag = styled . div `
1311 display: inline-block;
1412 text-transform: capitalize;
@@ -20,13 +18,8 @@ export const StyledTag = styled.div`
2018 margin: ${ theme . spacing . spacing01 } ;
2119 border-radius: 1rem;
2220 color: ${ theme . colors . lights [ 0 ] } ;
23- background-color: ${ theme . colors . lights [ 3 ] } ;
24-
25- ${ ( { color } ) =>
26- color &&
27- css `
28- ${ changeTagColor ( color ) }
29- ` }
21+ background-color: ${ ( { color } ) =>
22+ color ? theme . colors [ color ] || color : theme . colors . lights [ 3 ] } ;
3023` ;
3124
3225export const Tag : React . FC < TagProps > = ( { color, text } ) => {
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import { Container } from "../components/container";
2727 <Tag color = " danger" text = " failed" />
2828 <Tag color = " notification" text = " starting" />
2929 <Tag color = " primary" text = " primary" />
30+ <Tag color = " #daffad" text = " custom" />
3031 <Tag text = " No data" />
3132 </Container >
3233 </Story >
You can’t perform that action at this time.
0 commit comments