forked from coingaming/moon-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavatar.tsx
102 lines (100 loc) · 3.07 KB
/
avatar.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import Preview from '../../components/codePreview/Preview';
import ComponentPageDescription from '../../components/ComponentPageDescription';
import DeprecationWarning from '../../components/facing/DeprecationWarning';
import PropsTable from '../../components/PropsTable';
import ActiveStatus from '../../public/examples/avatar/ActiveStatus';
import Colours from '../../public/examples/avatar/Colours';
import Sizes from '../../public/examples/avatar/Sizes';
import StatusOrigin from '../../public/examples/avatar/StatusOrigin';
import Variants from '../../public/examples/avatar/Variants';
import useExamples from '../../utils/useExamples';
const PageAvatar = () => {
const examples = useExamples('avatar');
return (
<>
<ComponentPageDescription title="Avatar">
<DeprecationWarning href="/core/avatar" name="Avatar" />
</ComponentPageDescription>
<Preview
title="Variants"
preview={<Variants />}
code={examples ? examples.Variants : 'Loading'}
/>
<Preview
title="Different colours"
preview={<Colours />}
code={examples ? examples.Colours : 'Loading'}
/>
<Preview
title="Different sizes"
preview={<Sizes />}
code={examples ? examples.Sizes : 'Loading'}
/>
<Preview
title="Active status"
preview={<ActiveStatus />}
code={examples ? examples.ActiveStatus : 'Loading'}
/>
<Preview
title="Status Origin"
preview={<StatusOrigin />}
code={examples ? examples.StatusOrigin : 'Loading'}
/>
<PropsTable
title="Props"
data={[
{
name: 'size',
type: 'xsmall | small | medium | large | xlarge | twoxlarge',
required: false,
default: 'medium',
description: 'Size for avatar',
},
{
name: 'name',
type: 'string | JSX.Element',
required: false,
default: '-',
description: 'Capital letters of name',
},
{
name: 'imageUrl',
type: 'string',
required: false,
default: '-',
description: 'Path to the image',
},
{
name: 'statusOrigin',
type: 'StatusOrigin',
required: false,
default: 'bottom, right',
description: 'Position for status indication',
},
{
name: 'isStatusActive',
type: 'boolean',
required: false,
default: 'false',
description: 'Active state for status indication',
},
{
name: 'color',
type: 'ColorProps',
required: false,
default: 'bulma.100',
description: 'Text color',
},
{
name: 'backgroundColor',
type: 'ColorProps',
required: false,
default: 'gohan.100',
description: 'Background color',
},
]}
/>
</>
);
};
export default PageAvatar;