forked from react95-io/React95
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Table.stories.tsx
85 lines (81 loc) · 2.18 KB
/
Table.stories.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
import { ComponentMeta } from '@storybook/react';
import React from 'react';
import {
Table,
TableBody,
TableDataCell,
TableHead,
TableHeadCell,
TableRow,
Window,
WindowContent,
WindowHeader
} from 'react95';
import styled from 'styled-components';
const Wrapper = styled.div`
padding: 5rem;
background: ${({ theme }) => theme.desktopBackground};
`;
export default {
title: 'Controls/Table',
component: Table,
subcomponents: {
Table,
TableBody,
TableHead,
TableRow,
TableHeadCell,
TableDataCell
},
decorators: [story => <Wrapper>{story()}</Wrapper>]
} as ComponentMeta<typeof Table>;
export function Default() {
return (
<Window style={{ width: 320 }}>
<WindowHeader>Pokedex.exe</WindowHeader>
<WindowContent>
<Table>
<TableHead>
<TableRow>
<TableHeadCell>Type</TableHeadCell>
<TableHeadCell>Name</TableHeadCell>
<TableHeadCell disabled>Level</TableHeadCell>
</TableRow>
</TableHead>
<TableBody>
<TableRow>
<TableDataCell style={{ textAlign: 'center' }}>
<span role='img' aria-label='LEAF'>
🌿
</span>
</TableDataCell>
<TableDataCell>Bulbasaur</TableDataCell>
<TableDataCell>64</TableDataCell>
</TableRow>
<TableRow>
<TableDataCell style={{ textAlign: 'center' }}>
<span role='img' aria-label='fire'>
🔥
</span>
</TableDataCell>
<TableDataCell>Charizard</TableDataCell>
<TableDataCell>209</TableDataCell>
</TableRow>
<TableRow>
<TableDataCell style={{ textAlign: 'center' }}>
<span role='img' aria-label='lightning'>
⚡
</span>
</TableDataCell>
<TableDataCell>Pikachu</TableDataCell>
<TableDataCell>82</TableDataCell>
</TableRow>
</TableBody>
</Table>
</WindowContent>
</Window>
);
}
Default.story = {
name: 'default'
};