@@ -2,7 +2,7 @@ import styled from "@emotion/styled";
2
2
import { useQuery } from "@tanstack/react-query" ;
3
3
import type { NextPage } from "next" ;
4
4
import { useRouter } from "next/router" ;
5
- import { useState } from "react" ;
5
+ import { useState , useEffect } from "react" ;
6
6
import { Camera , Type , Search , Loader , Image } from "react-feather" ;
7
7
import { QRCode } from "react-qrcode-logo" ;
8
8
import { useZxing } from "react-zxing" ;
@@ -145,6 +145,8 @@ const Watchman: NextPage = (props) => {
145
145
const initialMode = router . query . mode as string ;
146
146
const [ text , setText ] = useState ( "" ) ;
147
147
const [ mode , setMode ] = useState ( initialMode ?? "" ) ;
148
+ const [ page , setPage ] = useState ( "" ) ;
149
+
148
150
const {
149
151
data : ticketList ,
150
152
refetch,
@@ -175,6 +177,10 @@ const Watchman: NextPage = (props) => {
175
177
await router . push ( `/watchman/${ ticketId } ` ) ;
176
178
} ;
177
179
180
+ useEffect ( ( ) => {
181
+ setPage ( `${ window . location . origin } /mytickets` ) ;
182
+ } , [ setPage ] ) ;
183
+
178
184
return (
179
185
< Wrapper >
180
186
< Container >
@@ -240,7 +246,7 @@ const Watchman: NextPage = (props) => {
240
246
< >
241
247
< p style = { { padding : "8px" } } > Escanea QR hacia Mis Tickets</ p >
242
248
< QRCode
243
- value = "https://jsconf.cl/watchman"
249
+ value = { page }
244
250
logoImage = "images/qr-images/logo-yellow.jpg"
245
251
size = { 350 }
246
252
bgColor = "#fff"
0 commit comments