forked from reactstrap/reactstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModalsPage.js
More file actions
158 lines (149 loc) · 5.33 KB
/
Copy pathModalsPage.js
File metadata and controls
158 lines (149 loc) · 5.33 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */
import React from 'react';
import { PrismCode } from 'react-prism';
import Helmet from 'react-helmet';
import ModalExample from '../examples/Modal';
const ModalExampleSource = require('!!raw!../examples/Modal');
import ModalBackdropExample from '../examples/ModalBackdrop';
const ModalBackdropExampleSource = require('!!raw!../examples/ModalBackdrop');
import ModalNestedExample from '../examples/ModalNested';
const ModalNestedExampleSource = require('!!raw!../examples/ModalNested');
import ModalCustomTimeoutExample from '../examples/ModalCustomTimeout';
const ModalCustomTimeoutExampleSource = require('!!raw!../examples/ModalCustomTimeout');
import ModalFadelessExample from '../examples/ModalFadeless';
const ModalFadelessExampleSource = require('!!raw!../examples/ModalFadeless');
export default class ModalsPage extends React.Component {
render() {
return (
<div>
<Helmet title="Modals" />
<h3>Modals</h3>
<div className="docs-example">
<div className="btn-group">
<div className="btn">
<ModalExample buttonLabel="Launch Modal" />
</div>
<div className="btn">
<ModalExample
buttonLabel="Launch Modal with custom className"
className="my-custom-modal"
/>
</div>
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ModalExampleSource}
</PrismCode>
</pre>
<h4>Properties</h4>
<pre>
<PrismCode className="language-jsx">
{`Modal.propTypes = {
// boolean to control the state of the popover
isOpen: PropTypes.bool,
autoFocus: PropTypes.bool,
size: PropTypes.string,
// callback for toggling isOpen in the controlling component
toggle: PropTypes.func,
role: PropTypes.string, // defaults to "dialog"
// used to reference the ID of the title element in the modal
labelledBy: PropTypes.string,
keyboard: PropTypes.bool,
// control backdrop, see http://v4-alpha.getbootstrap.com/components/modal/#options
backdrop: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.oneOf(['static'])
]),
// called on componentDidMount
onEnter: PropTypes.func,
// called on componentWillUnmount
onExit: PropTypes.func,
onOpened: PropTypes.func,
onClosed: PropTypes.func,
className: PropTypes.string,
wrapClassName: PropTypes.string,
modalClassName: PropTypes.string,
backdropClassName: PropTypes.string,
contentClassName: PropTypes.string,
// boolean to control whether the fade transition occurs (default: true)
fade: PropTypes.bool,
cssModule: PropTypes.object,
// zIndex defaults to 1000.
zIndex: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
]),
// backdropTransitionTimeout - controls appear, enter, and leave (default: 150)
// If you need different values for appear v. enter v. leave, use the more
// specific props like backdropTransitionAppearTimeout.
backdropTransitionTimeout: PropTypes.number
backdropTransitionAppearTimeout: PropTypes.number,
backdropTransitionEnterTimeout: PropTypes.number,
backdropTransitionLeaveTimeout: PropTypes.number,
// modalTransitionTimeout - controls appear, enter, and leave (default: 300)
// If you need different values for appear v. enter v. leave, use the more
// specific props like modalTransitionAppearTimeout.
modalTransitionTimeout: PropTypes.number,
modalTransitionAppearTimeout: PropTypes.number,
modalTransitionEnterTimeout: PropTypes.number,
modalTransitionLeaveTimeout: PropTypes.number,
}`}
</PrismCode>
</pre>
<h4>Backdrop</h4>
<div className="docs-example">
<div className="btn-group">
<div className="btn">
<ModalBackdropExample buttonLabel="Launch Modal" />
</div>
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ModalBackdropExampleSource}
</PrismCode>
</pre>
<h4>Nested Modals</h4>
<div className="docs-example">
<div className="btn-group">
<div className="btn">
<ModalNestedExample buttonLabel="Launch Modal w/ Nested Example" />
</div>
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ModalNestedExampleSource}
</PrismCode>
</pre>
<h4>Modals with Custom Transition Timeouts</h4>
<div className="docs-example">
<div className="btn-group">
<div className="btn">
<ModalCustomTimeoutExample buttonLabel="Launch Modal with Custom Transition Timeouts Example" />
</div>
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ModalCustomTimeoutExampleSource}
</PrismCode>
</pre>
<h4>Modals without Fade Effect</h4>
<div className="docs-example">
<div className="btn-group">
<div className="btn">
<ModalFadelessExample buttonLabel="Launch Modal without Fade Effect Example" />
</div>
</div>
</div>
<pre>
<PrismCode className="language-jsx">
{ModalFadelessExampleSource}
</PrismCode>
</pre>
</div>
);
}
}