Skip to content

Commit 64348c4

Browse files
author
Patricio Vargas
committed
app shel functionality
1 parent df092a5 commit 64348c4

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/App.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import logo from './logo.svg';
1+
import logo from './logo.png';
22
import './App.css';
33
import Scan from './containers/Scan';
44
import Write from './containers/Write';
@@ -8,11 +8,24 @@ function App() {
88
const [isScan, setScan] = useState(false);
99
const [isWrite, setWrite] = useState(false);
1010

11+
const onHandleScan =()=>{
12+
setScan(!isScan);
13+
setWrite(false)
14+
}
15+
16+
const onHandleWrite =()=>{
17+
setScan(false);
18+
setWrite(!isWrite)
19+
}
20+
1121
return (
1222
<div className="App">
1323
<img src={logo} className="App-logo" alt="logo" />
14-
<button onClick={()=>setScan(!isScan)} className="">Scan</button>
15-
<button onClick={()=>setWrite(!isWrite)} className="">Write</button>
24+
<h1>NFC Tool</h1>
25+
<div className="App-container">
26+
<button onClick={onHandleScan} className="App-button">Scan</button>
27+
<button onClick={onHandleWrite} className="App-button">Write</button>
28+
</div>
1629
{isScan && <Scan/>}
1730
{isWrite && <Write/>}
1831

0 commit comments

Comments
 (0)