1
1
import React from "react"
2
- import styled from "@emotion/styled "
2
+ import { Flex } from "@chakra-ui/react "
3
3
4
- const Primary = styled . div < { color ?: string } > `
5
- display: flex;
6
- background: ${ ( props ) =>
7
- props . color
8
- ? props . theme . colors [ props . color ]
9
- : props . theme . colors . primary100 } ;
10
- color: ${ ( props ) => props . theme . colors . black300 } ;
11
- text-transform: uppercase;
12
- text-align: center;
13
- display: inline-block;
14
- padding: 0.25rem 0.5rem;
15
- margin-right: 0.5rem;
16
- font-size: 0.75rem;
17
- border-radius: 0.25rem;
18
- `
19
- const Secondary = styled . div `
20
- display: flex;
21
- border: 1px solid ${ ( props ) => props . theme . colors . primary100 } ;
22
- color: ${ ( props ) => props . theme . colors . text } ;
23
- text-transform: uppercase;
24
- text-align: center;
25
- display: inline-block;
26
- padding: 0.25rem 0.5rem;
27
- font-size: 0.75rem;
28
- border-radius: 0.25rem;
29
- `
30
4
export interface IProps {
31
5
children ?: React . ReactNode
32
6
className ?: string
@@ -41,11 +15,38 @@ const Pill: React.FC<IProps> = ({
41
15
color,
42
16
} ) => {
43
17
return isSecondary ? (
44
- < Secondary className = { className } > { children } </ Secondary >
18
+ < Flex
19
+ border = "1px"
20
+ borderStyle = "solid"
21
+ borderColor = "primary100"
22
+ color = "text"
23
+ textTransform = "uppercase"
24
+ textAlign = "center"
25
+ display = "inline-block"
26
+ py = { 1 }
27
+ px = { 2 }
28
+ borderRadius = "base"
29
+ fontSize = "xs"
30
+ className = { className }
31
+ >
32
+ { children }
33
+ </ Flex >
45
34
) : (
46
- < Primary color = { color } className = { className } >
35
+ < Flex
36
+ backgroundColor = { color ? color : "primary" }
37
+ display = "inline-block"
38
+ color = "black300"
39
+ textTransform = "uppercase"
40
+ textAlign = "center"
41
+ py = { 1 }
42
+ px = { 2 }
43
+ mr = { 2 }
44
+ fontSize = "xs"
45
+ borderRadius = "base"
46
+ className = { className }
47
+ >
47
48
{ children }
48
- </ Primary >
49
+ </ Flex >
49
50
)
50
51
}
51
52
0 commit comments