@@ -5,6 +5,7 @@ import { useSearchParams } from "next/navigation"
55import { Input } from "@/components/ui/input"
66import { Button } from "@/components/ui/button"
77import { Phone } from "lucide-react"
8+ import Image from "next/image"
89
910const allergiesList = [ "Pollen" , "Dust" , "Pet Dander" , "Peanuts" , "Shellfish" ]
1011const medicationsList = [ "Aspirin" , "Ibuprofen" , "Penicillin" , "Insulin" , "Metformin" ]
@@ -60,6 +61,7 @@ interface DecodedData {
6061
6162const DataDisplayPage = ( ) => {
6263 const searchParams = useSearchParams ( )
64+ const [ showModal , setShowModal ] = useState ( false )
6365 const [ pin , setPin ] = useState ( "" )
6466 const [ decodedData , setDecodedData ] = useState < DecodedData | null > ( null )
6567 const [ error , setError ] = useState < string | null > ( null )
@@ -141,30 +143,57 @@ const DataDisplayPage = () => {
141143 }
142144 }
143145 return (
144- < div className = "flex items-center justify-center min-h-screen p-4 sm:p-8 dark:bg-black" >
145- < div className = "w-full max-w-2xl" >
146+ < div className = "min-h-screen flex flex-col items-center justify-center md:my-auto p-4 sm:p-8 dark:bg-black" >
147+ < div className = "w-full max-w-2xl flex-grow" >
146148 < h1 className = "font-bold text-3xl text-center mb-8 dark:text-white" >
147- OpenTag < span className = "text-red-500 italic" > Serverless</ span >
149+ OpenTag < span className = "text-red-500 dark:text-red-600 italic" > Serverless</ span >
148150 </ h1 >
149151 { ! decodedData && (
150- < div className = "bg-white shadow-md rounded-lg p-6 dark:bg-stone-800" >
151- < h2 className = "text-xl font-semibold mb-4 dark:text-white" > Enter PIN</ h2 >
152- < div className = "space-y-4" >
153- < Input
154- type = "password"
155- inputMode = "numeric"
156- pattern = "[0-9]*"
157- placeholder = "Enter 4-digit PIN"
158- value = { pin }
159- onChange = { ( e ) => setPin ( e . target . value ) }
160- maxLength = { 4 }
161- />
162- < Button onClick = { handleDecrypt } className = "w-full" >
163- Verify PIN
164- </ Button >
165- { error && < p className = "text-red-500 dark:text-red-400" > { error } </ p > }
152+ < >
153+ { showModal && (
154+ < div className = "fixed inset-0 flex items-center justify-center bg-black bg-opacity-50" >
155+ < div className = "bg-white p-4 m-4 rounded-lg shadow-lg max-w-md w-full dark:bg-black dark:text-white" >
156+ < div className = "flex justify-end" >
157+ < button
158+ className = "text-red-500"
159+ onClick = { ( ) => setShowModal ( false ) }
160+ >
161+ Close
162+ </ button >
163+ </ div >
164+ < div className = "flex justify-center" >
165+ < Image src = "/instructions.png" alt = "OpenTag Instructions" width = { 400 } height = { 400 } />
166+ </ div >
167+ </ div >
168+ </ div >
169+ ) }
170+ < div className = "bg-white shadow-md rounded-lg p-6 dark:bg-stone-800" >
171+ < h2 className = "text-xl font-semibold mb-4 dark:text-white" > Enter PIN</ h2 >
172+ < div className = "space-y-4" >
173+ < Input
174+ type = "password"
175+ inputMode = "numeric"
176+ pattern = "[0-9]*"
177+ placeholder = "Enter 4-digit PIN"
178+ value = { pin }
179+ onChange = { ( e ) => setPin ( e . target . value ) }
180+ maxLength = { 4 }
181+ />
182+ < Button onClick = { handleDecrypt } className = "w-full" >
183+ Verify PIN
184+ </ Button >
185+ { error && < p className = "text-red-500 dark:text-red-600" > { error } </ p > }
186+ </ div >
166187 </ div >
167- </ div >
188+ < div className = "flex justify-center mt-4" >
189+ < button
190+ className = "text-red-500 underline"
191+ onClick = { ( ) => setShowModal ( true ) }
192+ >
193+ Can't find pin? Click here
194+ </ button >
195+ </ div >
196+ </ >
168197 ) }
169198 { decodedData && (
170199 < div className = "bg-white shadow-md rounded-lg p-6 dark:bg-stone-800" >
0 commit comments