-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: create ui page for activate card and wipe card
- Loading branch information
Nicolas Burtey
committed
Sep 23, 2023
1 parent
85897b0
commit ca9554e
Showing
9 changed files
with
91 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import QRCode from "qrcode" | ||
import Image from "next/image" | ||
|
||
import { serverUrl } from "@/services/config" | ||
|
||
export default async function ActivateCard({ params }: { params: { a: string } }) { | ||
const { a } = params | ||
|
||
const url = `${serverUrl}/api/activate/?a=${a}` | ||
const res = await fetch(url, { cache: "no-store" }) | ||
const activationParams = await res.json() | ||
const warning = activationParams.warning | ||
|
||
const qrCode = await QRCode.toDataURL(url, { width: 400 }) | ||
|
||
return ( | ||
<> | ||
<div> | ||
<h1>Activate Card</h1> | ||
{warning && ( | ||
<p>{"card should not be programmed twice with the same sets of keys"}</p> | ||
)} | ||
<Image | ||
src={qrCode} | ||
alt={"qr code to activate"} | ||
width={400} | ||
height={400} | ||
unoptimized | ||
/> | ||
</div> | ||
</> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters