-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Antoine Lelaisant
committed
Mar 8, 2021
1 parent
52c71f8
commit 993e71a
Showing
17 changed files
with
125 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": "src" | ||
}, | ||
"include": [ | ||
"src" | ||
], | ||
"paths": { | ||
"assets": ["./assets/*"], | ||
"components": ["./components/*"] | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
import React from 'react' | ||
|
||
export class Checkbox extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
|
||
this.state = { | ||
check: false, | ||
}; | ||
} | ||
|
||
render() { | ||
const { name, label } = this.props | ||
|
||
return ( | ||
<div> | ||
<input | ||
name={name} | ||
type="checkbox" | ||
checked={this.state.checked ? 'checked' : ''} | ||
/> | ||
<label>{label}</label> | ||
</div> | ||
); | ||
} | ||
} |
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,6 @@ | ||
.game { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: 40%; | ||
} |
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,29 @@ | ||
import React from 'react' | ||
import './Game.css' | ||
import { Gitcoin } from './Gitcoin' | ||
import { Score } from './Score' | ||
|
||
export class Game extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
|
||
this.state = { | ||
clicks: 0 | ||
} | ||
} | ||
|
||
handleClick() { | ||
this.setState({ | ||
clicks: this.state.clicks + 1 | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<main className="game"> | ||
<Score clicks={this.state.clicks} /> | ||
<Gitcoin onClick={this.handleClick.bind(this)} /> | ||
</main> | ||
); | ||
} | ||
} |
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,13 @@ | ||
.gitcoin { | ||
display: block; | ||
width: 15rem; | ||
height: 15rem; | ||
border: none; | ||
background: transparent; | ||
outline: none; | ||
cursor: pointer; | ||
} | ||
|
||
.gitcoin > img { | ||
width: 100%; | ||
} |
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,18 @@ | ||
import React from 'react' | ||
import './Gitcoin.css' | ||
import githubIcon from 'assets/Github.png' | ||
|
||
export class Gitcoin extends React.Component { | ||
render() { | ||
const { onClick } = this.props | ||
|
||
return ( | ||
<button | ||
className="gitcoin" | ||
onClick={onClick} | ||
> | ||
<img src={githubIcon} alt="Gitcoin" /> | ||
</button> | ||
); | ||
} | ||
} |
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,11 @@ | ||
import React from 'react' | ||
|
||
export class Score extends React.Component { | ||
render() { | ||
const { clicks } = this.props | ||
|
||
return ( | ||
<h3>{clicks} Clicks</h3> | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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