Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
BalaSwecha
Water Cycle
Commits
54a7fa73
Commit
54a7fa73
authored
Mar 06, 2019
by
Jaya Simha Reddy Nandyala
Browse files
Added show/hide component feature in App.js
parent
e95c5631
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/App.js
View file @
54a7fa73
...
...
@@ -18,12 +18,18 @@ import "react-rain-animation/lib/style.css";
class
App
extends
Component
{
constructor
(){
super
();
this
.
state
=
{
childVisible
:
false
}
}
onClick
()
{
this
.
setState
({
childVisible
:
!
this
.
state
.
childVisible
});
}
render
()
{
return
(
<
div
id
=
"
hero
"
className
=
"
Cycle
"
style
=
{{
backgroundImage
:
'
url(
'
+
Hill
+
'
)
'
}}
>
...
...
@@ -51,7 +57,10 @@ class App extends Component {
<
Row
>
<
Col
xs
=
{
0.4
}
>
<
Sun
/>
{
this
.
state
.
childVisible
?
<
Sun
/>
:
null
}
<
/Col
>
<
Col
xs
=
{
2
}
>
...
...
@@ -65,7 +74,7 @@ class App extends Component {
<
/Col
>
<
Col
xs
=
{
4
}
>
<
Cloud
/>
<
Cloud
/>
<
/Col
>
...
...
@@ -77,7 +86,7 @@ class App extends Component {
<
Col
xs
=
{
8
}
>
<
/Col
>
<
Col
>
<
Button
className
=
"
B1
"
><
/Button
>
<
/Col
>
<
/Row
>
...
...
@@ -87,8 +96,8 @@ class App extends Component {
<
Col
xs
=
{
8
}
>
<
/Col
>
<
Col
>
<
Button
className
=
"
B2
"
>
PHASE
1
<
/Button
>
<
/Col
>
<
Button
onClick
=
{()
=>
this
.
onClick
()}
className
=
"
B2
"
>
Hide
/
Show
Sun
<
/Button
>
<
/Col
>
<
/Row
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment