Skip to content

Commit 664b57d

Browse files
committed
clesan up docu
1 parent e47a679 commit 664b57d

File tree

14 files changed

+25
-156
lines changed

14 files changed

+25
-156
lines changed

.storybook/stories/ClientVsServer/client.story.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import { usePagination } from '@table-library/react-table-library/pagination';
2222

2323
import { nodes } from '../data';
2424

25-
storiesOf('Client vs Server/Client-Side', module)
25+
storiesOf('Client vs Server', module)
2626
.addParameters({ component: Table })
27-
.add('base', () => {
27+
.add('Client-Side', () => {
2828
const data = {
2929
nodes,
3030
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Meta } from '@storybook/addon-docs/blocks';
2+
3+
<Meta title="Client vs Server/FAQ" />

.storybook/stories/ClientVsServer/server.story.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import {
2020
} from '@table-library/react-table-library/select';
2121
import { usePagination } from '@table-library/react-table-library/pagination';
2222

23-
storiesOf('Client vs Server/Server-Side', module)
23+
storiesOf('Client vs Server', module)
2424
.addParameters({ component: Table })
25-
.add('base', () => {
25+
.add('Server-Side', () => {
2626
const theme = useTheme({
2727
Table: `
2828
margin: 20px;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { Meta } from '@storybook/addon-docs/blocks';
22

3-
<Meta title="Compact Table/WIP" />
3+
<Meta title="Compact Table/FAQ" />

.storybook/stories/Crud/create.story.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313

1414
import { nodes } from '../data';
1515

16-
storiesOf('CRUD/Create', module)
16+
storiesOf('CRUD', module)
1717
.addParameters({ component: Table })
18-
.add('base', () => {
18+
.add('Create', () => {
1919
const [data, setData] = React.useState({ nodes });
2020
const [value, setValue] = React.useState('');
2121

@@ -83,13 +83,4 @@ storiesOf('CRUD/Create', module)
8383
</Table>
8484
</>
8585
);
86-
})
87-
.add('documentation', () => (
88-
<ul>
89-
<li>
90-
<a href="https://github.com/table-library/react-table-library/tree/master/.storybook/stories">
91-
Story Code
92-
</a>
93-
</li>
94-
</ul>
95-
));
86+
});

.storybook/stories/Crud/delete.story.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313

1414
import { nodes } from '../data';
1515

16-
storiesOf('CRUD/Delete', module)
16+
storiesOf('CRUD', module)
1717
.addParameters({ component: Table })
18-
.add('base', () => {
18+
.add('Delete', () => {
1919
const [data, setData] = React.useState({ nodes });
2020

2121
const handleRemove = (id) => {
@@ -66,13 +66,4 @@ storiesOf('CRUD/Delete', module)
6666
)}
6767
</Table>
6868
);
69-
})
70-
.add('documentation', () => (
71-
<ul>
72-
<li>
73-
<a href="https://github.com/table-library/react-table-library/tree/master/.storybook/stories">
74-
Story Code
75-
</a>
76-
</li>
77-
</ul>
78-
));
69+
});

.storybook/stories/Crud/faq.story.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Meta } from '@storybook/addon-docs/blocks';
2+
3+
<Meta title="CRUD/FAQ" />

.storybook/stories/Crud/update.story.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313

1414
import { nodes } from '../data';
1515

16-
storiesOf('CRUD/Update', module)
16+
storiesOf('CRUD', module)
1717
.addParameters({ component: Table })
18-
.add('base', () => {
18+
.add('Update', () => {
1919
const [data, setData] = React.useState({ nodes });
2020

2121
const handleUpdate = (value, id) => {
@@ -73,13 +73,4 @@ storiesOf('CRUD/Update', module)
7373
)}
7474
</Table>
7575
);
76-
})
77-
.add('documentation', () => (
78-
<ul>
79-
<li>
80-
<a href="https://github.com/table-library/react-table-library/tree/master/.storybook/stories">
81-
Story Code
82-
</a>
83-
</li>
84-
</ul>
85-
));
76+
});

.storybook/stories/FirstSteps/when-to-use.story.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Meta } from '@storybook/addon-docs/blocks';
22

3-
<Meta title="First Steps/When To Use ..." />
3+
<Meta title="First Steps/Which table should I use?" />
44

55
While navigating through the documentation, you will see both, `CompactTable`s and Composed Tables. Therefore you will need to know when to use which:
66

.storybook/stories/Kitchen/expand.story.js

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -103,80 +103,6 @@ storiesOf('Kitchen Sink/Expand', module)
103103
</Table>
104104
);
105105
})
106-
.add('base', () => {
107-
const data = { nodes };
108-
109-
const [ids, setIds] = React.useState([]);
110-
111-
const handleExpand = (item) => {
112-
if (ids.includes(item.id)) {
113-
setIds(ids.filter((id) => id !== item.id));
114-
} else {
115-
setIds(ids.concat(item.id));
116-
}
117-
};
118-
119-
return (
120-
<Table data={data}>
121-
{(tableList) => (
122-
<>
123-
<Header>
124-
<HeaderRow>
125-
<HeaderCell>Task</HeaderCell>
126-
<HeaderCell>Deadline</HeaderCell>
127-
<HeaderCell>Type</HeaderCell>
128-
<HeaderCell>Complete</HeaderCell>
129-
<HeaderCell>Tasks</HeaderCell>
130-
</HeaderRow>
131-
</Header>
132-
133-
<Body>
134-
{tableList.map((item) => (
135-
<React.Fragment key={item.id}>
136-
<Row item={item} onClick={handleExpand}>
137-
<Cell>{item.name}</Cell>
138-
<Cell>
139-
{item.deadline.toLocaleDateString('en-US', {
140-
year: 'numeric',
141-
month: '2-digit',
142-
day: '2-digit',
143-
})}
144-
</Cell>
145-
<Cell>{item.type}</Cell>
146-
<Cell>{item.isComplete.toString()}</Cell>
147-
<Cell>{item.nodes?.length}</Cell>
148-
</Row>
149-
150-
{ids.includes(item.id) && (
151-
<ul
152-
style={{
153-
margin: '0',
154-
padding: '0',
155-
backgroundColor: '#e0e0e0',
156-
}}
157-
>
158-
<li>
159-
<strong>Name:</strong> {item.name.toUpperCase()}
160-
</li>
161-
<li>
162-
<strong>Deadline:</strong> {item.deadline.toLocaleDateString('en-US')}
163-
</li>
164-
<li>
165-
<strong>Type:</strong> {item.type}
166-
</li>
167-
<li>
168-
<strong>Complete:</strong> {item.isComplete.toString()}
169-
</li>
170-
</ul>
171-
)}
172-
</React.Fragment>
173-
))}
174-
</Body>
175-
</>
176-
)}
177-
</Table>
178-
);
179-
})
180106
.add('documentation', () => (
181107
<ul>
182108
<li>

0 commit comments

Comments
 (0)