/
Text.tsx
42 lines (34 loc) · 877 Bytes
/
Text.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
const sizes = {
default: 14,
small: 12
}
const colors = {
default: "#24292e",
"gray-light": "#e1e4e8",
"gray": '#586069',
"gray-dark": "#24292e",
};
const families = {
default: "-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji",
mono: "SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace",
};
const weights = {
default: 400,
bold: 600,
};
const Text: React.FC<any> = ({ children = '', weight = 'default', family = 'default', color = 'default', size = 'default', ...props }) => {
return (
<p
style={{
fontSize: `${sizes[size]}px`,
lineHeight: 1.5,
fontFamily: families[family],
color: colors[color],
fontWeight: weights[weight]
}}>
{children}
</p>
);
};
export default Text;