File tree 1 file changed +1
-14
lines changed
1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,6 @@ import { useJsBarcodeEan13 } from './components/Barcode'
4
4
import { PageContainer } from './components/PageContainer'
5
5
import { Input } from './components/Input'
6
6
import { Label } from './components/Label'
7
- import { Button } from './components/Button'
8
-
9
- async function handleClick ( ) {
10
- document . querySelector ( '#barcode' ) . toBlob ( function ( blob ) {
11
- // eslint-disable-next-line no-undef
12
- const item = new ClipboardItem ( { 'image/png' : blob } )
13
- navigator . clipboard . write ( [ item ] )
14
- } )
15
- }
16
7
17
8
export function Home ( ) {
18
9
const [ ean13 , setEan13 ] = useState ( '' )
@@ -45,10 +36,6 @@ export function Home() {
45
36
onChange = { onInputChange }
46
37
/>
47
38
</ Label >
48
-
49
- < Button onClick = { handleClick } disabled = { ean13 ?. length !== 13 || error } >
50
- Copier le barcode
51
- </ Button >
52
39
</ x . div >
53
40
54
41
< x . div textAlign = "center" mt = { 4 } h = { 40 } p = { 3 } w = { 1 } >
@@ -58,7 +45,7 @@ export function Home() {
58
45
< x . span color = "red" > code invalide</ x . span >
59
46
</ p >
60
47
) : ean13 . length === 13 ? (
61
- < canvas id = "barcode" > </ canvas >
48
+ < img id = "barcode" alt = "generated-barcode" / >
62
49
) : (
63
50
< p >
64
51
Remplissez le champ avec 13 chiffres pour générer le code barre.
You can’t perform that action at this time.
0 commit comments