|
1 | 1 | import { Layout } from '@cuhacking/portal/ui/layout' |
| 2 | +/* import { Scanner } from "@yudiel/react-qr-scanner"; */ |
| 3 | +import { Button } from '@cuhacking/shared/ui/button' |
| 4 | +import { GlassmorphicCard } from '@cuhacking/shared/ui/glassmorphic-card' |
| 5 | +import { cn } from '@cuhacking/shared/utils/cn' |
| 6 | +import * as TabsPrimitive from '@radix-ui/react-tabs' |
| 7 | +import { CodeXml, User } from 'lucide-react' |
2 | 8 | import { QRCodeCanvas } from 'qrcode.react' |
3 | 9 |
|
4 | | -export function QrPage({ user }) { |
5 | | - /* console.log(user) */ |
6 | | - const qrValue = 'https://yourwebsite.com' // Change this to your desired URL or text |
| 10 | +import * as React from 'react' |
| 11 | + |
| 12 | +const Tabs = TabsPrimitive.Root |
| 13 | + |
| 14 | +const TabsList = React.forwardRef< |
| 15 | + React.ElementRef<typeof TabsPrimitive.List>, |
| 16 | + React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> |
| 17 | +>(({ className, ...props }, ref) => ( |
| 18 | + <TabsPrimitive.List |
| 19 | + ref={ref} |
| 20 | + className={cn( |
| 21 | + 'inline-flex h-9 items-center justify-center rounded-lg p-1', |
| 22 | + className, |
| 23 | + )} |
| 24 | + {...props} |
| 25 | + /> |
| 26 | +)) |
| 27 | +TabsList.displayName = TabsPrimitive.List.displayName |
| 28 | + |
| 29 | +const TabsTrigger = React.forwardRef< |
| 30 | + React.ElementRef<typeof TabsPrimitive.Trigger>, |
| 31 | + React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> |
| 32 | +>(({ className, ...props }, ref) => ( |
| 33 | + <TabsPrimitive.Trigger |
| 34 | + ref={ref} |
| 35 | + className={cn( |
| 36 | + 'inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-black data-[state=active]:shadow', |
| 37 | + className, |
| 38 | + )} |
| 39 | + {...props} |
| 40 | + /> |
| 41 | +)) |
| 42 | +TabsTrigger.displayName = TabsPrimitive.Trigger.displayName |
| 43 | + |
| 44 | +const TabsContent = React.forwardRef< |
| 45 | + React.ElementRef<typeof TabsPrimitive.Content>, |
| 46 | + React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> |
| 47 | +>(({ className, ...props }, ref) => ( |
| 48 | + <TabsPrimitive.Content |
| 49 | + ref={ref} |
| 50 | + className={cn( |
| 51 | + 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', |
| 52 | + className, |
| 53 | + )} |
| 54 | + {...props} |
| 55 | + /> |
| 56 | +)) |
| 57 | +TabsContent.displayName = TabsPrimitive.Content.displayName |
| 58 | + |
| 59 | +export { Tabs, TabsContent, TabsList, TabsTrigger } |
| 60 | + |
| 61 | +export function QrPage({ |
| 62 | + user, |
| 63 | + /* events */ |
| 64 | +}) { |
| 65 | + const qrValue = 'https://yourwebsite.com' |
| 66 | + /* console.log(events); */ |
| 67 | + |
7 | 68 | return ( |
8 | | - <Layout isCompleteProfile={false}> |
9 | | - <section className="max-w-screen-xl mx-auto gap-5 p-5 sm:px-10 py-40 pt-20"> |
10 | | - <div> |
11 | | - <QRCodeCanvas value={qrValue} size={200} /> |
12 | | - Hi |
13 | | - {' '} |
14 | | - {user.preferredDisplayName} |
15 | | - {' '} |
16 | | - ur doing great! |
17 | | - </div> |
18 | | - </section> |
| 69 | + <Layout isCompleteProfile> |
| 70 | + <div className="w-full flex justify-center items-center h-screen"> |
| 71 | + <section className="mx-auto space-y-5"> |
| 72 | + <GlassmorphicCard className="flex flex-col items-center justify-center mx-auto space-y-2 p-5"> |
| 73 | + <Tabs defaultValue="qr" className="w-screen-sm"> |
| 74 | + <TabsList> |
| 75 | + <TabsTrigger value="qr"> |
| 76 | + <User /> |
| 77 | + {' '} |
| 78 | + QR Code |
| 79 | + </TabsTrigger> |
| 80 | + <TabsTrigger value="scanner"> |
| 81 | + <CodeXml /> |
| 82 | + {' '} |
| 83 | + Scanner |
| 84 | + </TabsTrigger> |
| 85 | + </TabsList> |
| 86 | + <TabsContent value="qr"> |
| 87 | + <GlassmorphicCard className="flex flex-col items-center justify-center mx-auto space-y-2 p-5"> |
| 88 | + <QRCodeCanvas value={qrValue} size={200} /> |
| 89 | + </GlassmorphicCard> |
| 90 | + </TabsContent> |
| 91 | + <TabsContent value="scanner"> |
| 92 | + {/* <Scanner onScan={(result) => console.log(result)} /> */} |
| 93 | + </TabsContent> |
| 94 | + </Tabs> |
| 95 | + </GlassmorphicCard> |
| 96 | + |
| 97 | + <GlassmorphicCard className="flex justify-center mx-auto p-5"> |
| 98 | + <span className="text-lg font-semibold"> |
| 99 | + Hi |
| 100 | + {' '} |
| 101 | + {user.preferredDisplayName} |
| 102 | + ! ur doing great! 🥗✨ Looking for |
| 103 | + QR code ... |
| 104 | + </span> |
| 105 | + </GlassmorphicCard> |
| 106 | + <Button>Confirm</Button> |
| 107 | + </section> |
| 108 | + </div> |
19 | 109 | </Layout> |
20 | 110 | ) |
21 | 111 | } |
0 commit comments