-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Challenge and Code: Interactive Instructions
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { expandInstructions, collapseInstructions } from '../actions/settings'; | ||
|
||
const Instructions = props => { | ||
const { instructionsExpanded, expandInstructions, collapseInstructions } = props; | ||
|
||
if (instructionsExpanded) { | ||
return ( | ||
<div> | ||
<h3>Instructions</h3> | ||
<p>Welcome to evens or odds. The game goes like this</p> | ||
<p>The deck is shuffled. Then choose. will the next card be even or odd?</p> | ||
<p>Make a choive on every draw, and see how many you get right!</p> | ||
<p>(Face cards don't count)</p> | ||
<br /> | ||
<button onClick={collapseInstructions}>Show less</button> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<div> | ||
<h3>Instructions</h3> | ||
<p>Welcome to evens or odds. The game goes like this...</p> | ||
<button onClick={expandInstructions}>Read more</button> | ||
</div> | ||
) | ||
} | ||
|
||
export default connect( | ||
state => ({ instructionsExpanded: state.instructionsExpanded }), | ||
{ expandInstructions, collapseInstructions } | ||
)(Instructions); |