FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
react-modal-component/example/browser.js at master · elsewhencode/react-modal-component · GitHub
This repository was archived by the owner on Mar 14, 2024. It is now read-only.
elsewhencode
react-modal-component
Repository navigation
Code
Pull requests
1
(1)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
react-modal-component
/
example
/
browser.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (37 loc) · 1.12 KB
Breadcrumbs
react-modal-component
/
example
/
browser.js
Copy path
File metadata and controls
41 lines (37 loc) · 1.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
var
insertCSS
=
require
(
'insert-css'
)
;
var
domReady
=
require
(
'domready'
)
;
var
domify
=
require
(
'domify'
)
;
var
React
=
require
(
'react'
)
var
Modal
=
require
(
'../src/index'
)
;
var
fs
=
require
(
'fs'
)
;
var
style
=
fs
.
readFileSync
(
__dirname
+
'/style.css'
,
'utf8'
)
;
insertCSS
(
style
)
;
var
SomePage
=
React
.
createClass
(
{
getInitialState
:
function
(
)
{
return
{
showDialog
:
false
}
;
}
,
showDialog
:
function
(
)
{
this
.
setState
(
{
showDialog
:
!
this
.
state
.
showDialog
}
)
;
}
,
closeDialog
:
function
(
)
{
this
.
setState
(
{
showDialog
:
false
}
)
;
}
,
render
:
function
(
)
{
if
(
this
.
state
.
showDialog
)
{
node
=
(
<
Modal
transitionName
=
'zoom'
closeOnEsc
=
{
true
}
closeOnOutsideClick
=
{
true
}
close
=
{
this
.
closeDialog
}
>
<
h3
>
Plain old Modal
</
h3
>
<
button
onClick
=
{
this
.
closeDialog
}
>
Close Dialog
</
button
>
</
Modal
>
)
}
else
{
node
=
null
}
return
<
div
>
<
button
onClick
=
{
this
.
showDialog
}
>
Show Dialog
</
button
>
{
node
}
</
div
>
}
}
)
;
domReady
(
function
(
)
{
document
.
body
.
appendChild
(
domify
(
'<div class="container"></div>'
)
)
;
React
.
render
(
<
SomePage
/>
,
document
.
querySelector
(
'.container'
)
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL