forked from dnnsoftware/Dnn.Platform
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontentloadwrapper.stories.js
More file actions
83 lines (74 loc) · 2.06 KB
/
Copy pathcontentloadwrapper.stories.js
File metadata and controls
83 lines (74 loc) · 2.06 KB
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
import React, { Component } from "react";
import ContentLoadWrapper from "./index";
import { TableEmptyState } from "../SvgIcons";
class MyContentLoadWrapper extends Component {
constructor() {
super();
this.state = { loaded: false };
}
componentDidMount() {
setTimeout(function () {
this.setState({ loaded: true });
}.bind(this), 2000);
}
render() {
return (
<ContentLoadWrapper
loadComplete={this.state.loaded}
svgSkeleton={<div><TableEmptyState /></div>}
>
<div>
<div className="auditCheckItems">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>
</div>
</ContentLoadWrapper>
);
}
}
export default {
component: ContentLoadWrapper,
};
export const WithLoading = () => (
<ContentLoadWrapper
loadComplete={false}
svgSkeleton={<div><TableEmptyState /></div>}
>
<div>
<div className="auditcheck-topbar">Loading...</div>
<div className="auditCheckItems">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>
</div>
</ContentLoadWrapper>
);
export const WithContent = () => (
<ContentLoadWrapper
loadComplete={true}
svgSkeleton={<div><TableEmptyState /></div>}
>
<div>
<div className="auditcheck-topbar">
<h1>Content</h1>
</div>
<div className="auditCheckItems">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>
</div>
</ContentLoadWrapper>
);
export const LoadedAfterTwoSeconds= () => (
<MyContentLoadWrapper />
);