Skip to content

Commit 3c1846d

Browse files
author
Patricio Vargas
committed
hide/show scan and write
1 parent b5584e3 commit 3c1846d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/App.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import logo from './logo.svg';
22
import './App.css';
3-
import Button from './components/Button/Button';
43
import Scan from './containers/Scan';
54
import Write from './containers/Write';
5+
import { useState } from 'react';
66

77
function App() {
8+
const [isScan, setScan] = useState(false);
9+
const [isWrite, setWrite] = useState(false);
10+
811
return (
912
<div className="App">
10-
<Button name="Scan"/>
11-
<Button name="Write"/>
12-
<Scan/>
13-
<Write/>
13+
<img src={logo} className="App-logo" alt="logo" />
14+
<button onClick={()=>setScan(!isScan)} className="">Scan</button>
15+
<button onClick={()=>setWrite(!isWrite)} className="">Write</button>
16+
{isScan && <Scan/>}
17+
{isWrite && <Write/>}
18+
1419
</div>
1520
);
1621
}

0 commit comments

Comments
 (0)