Skip to content

Commit 7e4552c

Browse files
committed
request page discord
1 parent 57bfd45 commit 7e4552c

File tree

5 files changed

+485
-1
lines changed

5 files changed

+485
-1
lines changed

app/request/requestpage.tsx

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ import { Badge } from '@/components/ui/badge';
77
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
88
import { Github, Heart, Share2, Star, Check, AlertCircle } from 'lucide-react';
99

10+
const DiscordIcon = ({ className = "" }) => (
11+
<svg
12+
role="img"
13+
viewBox="0 0 24 24"
14+
xmlns="http://www.w3.org/2000/svg"
15+
className={className}
16+
width="24"
17+
height="24"
18+
fill="currentColor"
19+
>
20+
<path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/>
21+
</svg>
22+
);
23+
import {
24+
AlertDialog,
25+
AlertDialogAction,
26+
AlertDialogCancel,
27+
AlertDialogContent,
28+
AlertDialogDescription,
29+
AlertDialogFooter,
30+
AlertDialogHeader,
31+
AlertDialogTitle,
32+
} from "@/components/ui/alert-dialog";
33+
1034
const RequestPage = () => {
1135
const [projectRequest, setProjectRequest] = useState({
1236
title: '',
@@ -20,6 +44,8 @@ const RequestPage = () => {
2044
message: ''
2145
});
2246

47+
const [showDiscordDialog, setShowDiscordDialog] = useState(false);
48+
2349
const handleProjectRequest = async () => {
2450
if (!projectRequest.title.trim() ||
2551
!projectRequest.githubLink.trim() ||
@@ -28,6 +54,10 @@ const RequestPage = () => {
2854
return;
2955
}
3056

57+
setShowDiscordDialog(true);
58+
};
59+
60+
const handleFinalSubmit = async () => {
3161
try {
3262
setSubmissionStatus({ status: 'loading', message: 'Submitting your request...' });
3363

@@ -59,6 +89,11 @@ const RequestPage = () => {
5989
}
6090
};
6191

92+
const handleDiscordJoin = () => {
93+
window.open('https://discord.gg/QtnFGDQj5S', '_blank');
94+
handleFinalSubmit();
95+
};
96+
6297
return (
6398
<div className="min-h-screen bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 py-12 mt-10">
6499
<div className="container mx-auto px-4">
@@ -200,6 +235,51 @@ const RequestPage = () => {
200235
</div>
201236
</div>
202237
</div>
238+
239+
<AlertDialog open={showDiscordDialog} onOpenChange={setShowDiscordDialog}>
240+
<AlertDialogContent className="bg-slate-800 text-white border-slate-700">
241+
<AlertDialogHeader>
242+
<AlertDialogTitle className="text-2xl flex items-center gap-2">
243+
<DiscordIcon className="text-purple-500 w-6 h-6" />
244+
Join Our Discord Community!
245+
</AlertDialogTitle>
246+
<AlertDialogDescription className="text-gray-300 space-y-4">
247+
<p>
248+
Don't miss updates about your submission! Join our vibrant Discord community to:
249+
</p>
250+
<ul className="space-y-2">
251+
<li className="flex items-start gap-2">
252+
<Check className="text-green-500 mt-1 shrink-0" />
253+
Get notified when your project is reviewed
254+
</li>
255+
<li className="flex items-start gap-2">
256+
<Check className="text-green-500 mt-1 shrink-0" />
257+
Connect with like-minded developers
258+
</li>
259+
<li className="flex items-start gap-2">
260+
<Check className="text-green-500 mt-1 shrink-0" />
261+
Discover more amazing projects daily
262+
</li>
263+
<li className="flex items-start gap-2">
264+
<Check className="text-green-500 mt-1 shrink-0" />
265+
Share your knowledge and learn from others
266+
</li>
267+
</ul>
268+
</AlertDialogDescription>
269+
</AlertDialogHeader>
270+
<AlertDialogFooter>
271+
<AlertDialogCancel className="bg-slate-700 text-white hover:bg-slate-600 border-slate-600">
272+
Submit Without Joining
273+
</AlertDialogCancel>
274+
<AlertDialogAction
275+
onClick={handleDiscordJoin}
276+
className="bg-purple-500 hover:bg-purple-600 text-white"
277+
>
278+
Join Discord
279+
</AlertDialogAction>
280+
</AlertDialogFooter>
281+
</AlertDialogContent>
282+
</AlertDialog>
203283
</div>
204284
);
205285
};

components/ui/alert-dialog.tsx

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
"use client"
2+
3+
import * as React from "react"
4+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
5+
6+
import { cn } from "@/lib/utils"
7+
import { buttonVariants } from "@/components/ui/button"
8+
9+
const AlertDialog = AlertDialogPrimitive.Root
10+
11+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
12+
13+
const AlertDialogPortal = AlertDialogPrimitive.Portal
14+
15+
const AlertDialogOverlay = React.forwardRef<
16+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
17+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
18+
>(({ className, ...props }, ref) => (
19+
<AlertDialogPrimitive.Overlay
20+
className={cn(
21+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
22+
className
23+
)}
24+
{...props}
25+
ref={ref}
26+
/>
27+
))
28+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
29+
30+
const AlertDialogContent = React.forwardRef<
31+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
32+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
33+
>(({ className, ...props }, ref) => (
34+
<AlertDialogPortal>
35+
<AlertDialogOverlay />
36+
<AlertDialogPrimitive.Content
37+
ref={ref}
38+
className={cn(
39+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40+
className
41+
)}
42+
{...props}
43+
/>
44+
</AlertDialogPortal>
45+
))
46+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
47+
48+
const AlertDialogHeader = ({
49+
className,
50+
...props
51+
}: React.HTMLAttributes<HTMLDivElement>) => (
52+
<div
53+
className={cn(
54+
"flex flex-col space-y-2 text-center sm:text-left",
55+
className
56+
)}
57+
{...props}
58+
/>
59+
)
60+
AlertDialogHeader.displayName = "AlertDialogHeader"
61+
62+
const AlertDialogFooter = ({
63+
className,
64+
...props
65+
}: React.HTMLAttributes<HTMLDivElement>) => (
66+
<div
67+
className={cn(
68+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
69+
className
70+
)}
71+
{...props}
72+
/>
73+
)
74+
AlertDialogFooter.displayName = "AlertDialogFooter"
75+
76+
const AlertDialogTitle = React.forwardRef<
77+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
78+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
79+
>(({ className, ...props }, ref) => (
80+
<AlertDialogPrimitive.Title
81+
ref={ref}
82+
className={cn("text-lg font-semibold", className)}
83+
{...props}
84+
/>
85+
))
86+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
87+
88+
const AlertDialogDescription = React.forwardRef<
89+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
90+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
91+
>(({ className, ...props }, ref) => (
92+
<AlertDialogPrimitive.Description
93+
ref={ref}
94+
className={cn("text-sm text-muted-foreground", className)}
95+
{...props}
96+
/>
97+
))
98+
AlertDialogDescription.displayName =
99+
AlertDialogPrimitive.Description.displayName
100+
101+
const AlertDialogAction = React.forwardRef<
102+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
103+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
104+
>(({ className, ...props }, ref) => (
105+
<AlertDialogPrimitive.Action
106+
ref={ref}
107+
className={cn(buttonVariants(), className)}
108+
{...props}
109+
/>
110+
))
111+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
112+
113+
const AlertDialogCancel = React.forwardRef<
114+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
115+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
116+
>(({ className, ...props }, ref) => (
117+
<AlertDialogPrimitive.Cancel
118+
ref={ref}
119+
className={cn(
120+
buttonVariants({ variant: "outline" }),
121+
"mt-2 sm:mt-0",
122+
className
123+
)}
124+
{...props}
125+
/>
126+
))
127+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
128+
129+
export {
130+
AlertDialog,
131+
AlertDialogPortal,
132+
AlertDialogOverlay,
133+
AlertDialogTrigger,
134+
AlertDialogContent,
135+
AlertDialogHeader,
136+
AlertDialogFooter,
137+
AlertDialogTitle,
138+
AlertDialogDescription,
139+
AlertDialogAction,
140+
AlertDialogCancel,
141+
}

components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority"
55
import { cn } from "@/lib/utils"
66

77
const buttonVariants = cva(
8-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
99
{
1010
variants: {
1111
variant: {

0 commit comments

Comments
 (0)