Skip to content

Commit 3f00fa0

Browse files
authored
feat(WatchmanQR): show mytickets page (#232)
1 parent 884340e commit 3f00fa0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pages/watchman/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styled from "@emotion/styled";
22
import { useQuery } from "@tanstack/react-query";
33
import type { NextPage } from "next";
44
import { useRouter } from "next/router";
5-
import { useState } from "react";
5+
import { useState, useEffect } from "react";
66
import { Camera, Type, Search, Loader, Image } from "react-feather";
77
import { QRCode } from "react-qrcode-logo";
88
import { useZxing } from "react-zxing";
@@ -145,6 +145,8 @@ const Watchman: NextPage = (props) => {
145145
const initialMode = router.query.mode as string;
146146
const [text, setText] = useState("");
147147
const [mode, setMode] = useState(initialMode ?? "");
148+
const [page, setPage] = useState("");
149+
148150
const {
149151
data: ticketList,
150152
refetch,
@@ -175,6 +177,10 @@ const Watchman: NextPage = (props) => {
175177
await router.push(`/watchman/${ticketId}`);
176178
};
177179

180+
useEffect(() => {
181+
setPage(`${window.location.origin}/mytickets`);
182+
}, [setPage]);
183+
178184
return (
179185
<Wrapper>
180186
<Container>
@@ -240,7 +246,7 @@ const Watchman: NextPage = (props) => {
240246
<>
241247
<p style={{ padding: "8px" }}>Escanea QR hacia Mis Tickets</p>
242248
<QRCode
243-
value="https://jsconf.cl/watchman"
249+
value={page}
244250
logoImage="images/qr-images/logo-yellow.jpg"
245251
size={350}
246252
bgColor="#fff"

0 commit comments

Comments
 (0)