Skip to content

Commit abb2a37

Browse files
Fixed most type errors and bugs, added authentication
1 parent f1560e7 commit abb2a37

File tree

19 files changed

+10611
-433
lines changed

19 files changed

+10611
-433
lines changed

Frontend/app/auth/login/page.tsx

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function LoginPage() {
1717
const [email, setEmail] = useState("")
1818
const [password, setPassword] = useState("")
1919
const [isLoading, setIsLoading] = useState(false)
20-
const { signIn, signInWithGoogle } = useAuth()
20+
const { signIn } = useAuth()
2121
const { toast } = useToast()
2222
const router = useRouter()
2323

@@ -42,22 +42,6 @@ export default function LoginPage() {
4242
}
4343
}
4444

45-
const handleGoogleSignIn = async () => {
46-
try {
47-
await signInWithGoogle()
48-
toast({
49-
title: "Success!",
50-
description: "You have successfully logged in with Google.",
51-
})
52-
} catch (error) {
53-
toast({
54-
title: "Error",
55-
description: "Failed to sign in with Google. Please try again.",
56-
variant: "destructive",
57-
})
58-
}
59-
}
60-
6145
return (
6246
<div className="container flex items-center justify-center min-h-[calc(100vh-8rem)] py-12">
6347
<Card className="w-full max-w-md">
@@ -86,9 +70,9 @@ export default function LoginPage() {
8670
<div className="space-y-2">
8771
<div className="flex items-center justify-between">
8872
<Label htmlFor="password">Password</Label>
89-
<Link href="/auth/forgot-password" className="text-sm text-purple-600 hover:text-purple-700">
73+
{/* <Link href="/auth/forgot-password" className="text-sm text-purple-600 hover:text-purple-700">
9074
Forgot password?
91-
</Link>
75+
</Link> */}
9276
</div>
9377
<Input
9478
id="password"
@@ -110,23 +94,6 @@ export default function LoginPage() {
11094
)}
11195
</Button>
11296
</form>
113-
<div className="relative">
114-
<div className="absolute inset-0 flex items-center">
115-
<span className="w-full border-t" />
116-
</div>
117-
<div className="relative flex justify-center text-xs uppercase">
118-
<span className="bg-background px-2 text-muted-foreground">Or continue with</span>
119-
</div>
120-
</div>
121-
<Button variant="outline" type="button" className="w-full" onClick={handleGoogleSignIn}>
122-
<svg className="mr-2 h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
123-
<path
124-
fill="currentColor"
125-
d="M12 22q-2.05 0-3.875-.788t-3.188-2.15-2.137-3.175T2 12q0-2.075.788-3.887t2.15-3.175 3.175-2.138T12 2q2.075 0 3.887.788t3.175 2.15 2.138 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188-3.175 2.137T12 22Z"
126-
/>
127-
</svg>
128-
Google
129-
</Button>
13097
</CardContent>
13198
<CardFooter className="flex flex-col space-y-4">
13299
<div className="text-center text-sm">

Frontend/app/auth/register/page.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function RegisterPage() {
1818
const [password, setPassword] = useState("")
1919
const [confirmPassword, setConfirmPassword] = useState("")
2020
const [isLoading, setIsLoading] = useState(false)
21-
const { signUp, signInWithGoogle } = useAuth()
21+
const { signUp } = useAuth()
2222
const { toast } = useToast()
2323

2424
const handleSubmit = async (e: React.FormEvent) => {
@@ -112,23 +112,6 @@ export default function RegisterPage() {
112112
)}
113113
</Button>
114114
</form>
115-
<div className="relative">
116-
<div className="absolute inset-0 flex items-center">
117-
<span className="w-full border-t" />
118-
</div>
119-
<div className="relative flex justify-center text-xs uppercase">
120-
<span className="bg-background px-2 text-muted-foreground">Or continue with</span>
121-
</div>
122-
</div>
123-
<Button variant="outline" type="button" className="w-full" onClick={signInWithGoogle}>
124-
<svg className="mr-2 h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
125-
<path
126-
fill="currentColor"
127-
d="M12 22q-2.05 0-3.875-.788t-3.188-2.15-2.137-3.175T2 12q0-2.075.788-3.887t2.15-3.175 3.175-2.138T12 2q2.075 0 3.887.788t3.175 2.15 2.138 3.175T22 12q0 2.05-.788 3.875t-2.15 3.188-3.175 2.137T12 22Z"
128-
/>
129-
</svg>
130-
Google
131-
</Button>
132115
</CardContent>
133116
<CardFooter className="flex flex-col space-y-4">
134117
<div className="text-center text-sm">

Frontend/app/calendar/page.tsx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -417,20 +417,6 @@ export default function CalendarPage() {
417417
</SelectContent>
418418
</Select>
419419
</div>
420-
<div className="space-y-2">
421-
<Label htmlFor="tagged-persons">Tagged Persons</Label>
422-
<Input
423-
id="tagged-persons"
424-
placeholder="Enter names separated by commas"
425-
value={newEvent.taggedPersons}
426-
onChange={(e) =>
427-
setNewEvent({
428-
...newEvent,
429-
taggedPersons: e.target.value,
430-
})
431-
}
432-
/>
433-
</div>
434420
<Button className="w-full" onClick={addEvent}>
435421
Add Event
436422
</Button>
@@ -482,7 +468,7 @@ function CalendarGrid({
482468
(event) =>
483469
event.date.getDate() === date.getDate() &&
484470
event.date.getMonth() === date.getMonth() &&
485-
event.date.getFullYear() === date.getFullYear(),
471+
event.date.getFullYear() === date.getFullYear()
486472
)
487473
}
488474

@@ -540,13 +526,15 @@ function CalendarGrid({
540526

541527
{/* Calendar grid */}
542528
{days.map((date, index) => {
529+
if (!date) return null
530+
543531
const row = Math.floor(index / 7)
544532
const col = index % 7
545533
const x = (col - 3) * 1.2
546534
const y = -row * 1.2
547535
const dateEvents = getEventsByDate(date)
548536

549-
return date ? (
537+
return (
550538
<group key={index} position={[x, y, 0]}>
551539
{/* Day cell */}
552540
<mesh
@@ -584,6 +572,8 @@ function CalendarGrid({
584572

585573
{/* Event indicators */}
586574
{dateEvents.slice(0, 3).map((event, i) => {
575+
if (!event) return null
576+
587577
const eventColor = getEventColor(event.priority)
588578
return (
589579
<mesh key={i} position={[0, -0.1 - i * 0.15, 0]}>
@@ -602,8 +592,6 @@ function CalendarGrid({
602592
</Text>
603593
)}
604594
</group>
605-
) : (
606-
<group key={index} position={[x, y, 0]} />
607595
)
608596
})}
609597
</group>

Frontend/app/layout.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Navbar from "@/components/navbar"
77
import Footer from "@/components/footer"
88
import { Toaster } from "@/components/ui/toaster"
99
import { AuthProvider } from "@/hooks/use-auth"
10-
import { EthereumProvider } from "@/components/ethereum-provider"
1110
import { NotificationProvider } from "@/components/notification-provider"
1211

1312
const inter = Inter({ subsets: ["latin"] })
@@ -28,16 +27,14 @@ export default function RootLayout({
2827
<body className={inter.className}>
2928
<AuthProvider>
3029
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
31-
<EthereumProvider>
32-
<NotificationProvider>
30+
<NotificationProvider>
3331
<div className="flex min-h-screen flex-col">
3432
<Navbar />
3533
<main className="flex-1">{children}</main>
3634
<Footer />
3735
</div>
3836
<Toaster />
3937
</NotificationProvider>
40-
</EthereumProvider>
4138
</ThemeProvider>
4239
</AuthProvider>
4340
</body>

Frontend/app/page.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,27 +139,30 @@ export default function Home() {
139139
<div className="mx-auto grid max-w-5xl grid-cols-1 gap-8 py-12 md:grid-cols-3">
140140
{[
141141
{
142-
name: "Alex Johnson",
142+
name: "Apurba Roy",
143143
role: "Frontend Developer",
144-
bio: "Specializes in creating intuitive user interfaces with React and Three.js.",
144+
bio: "Specializes in creating intuitive user interfaces with React and Next.js.",
145+
img: '/apurba.jpg'
145146
},
146147
{
147-
name: "Samantha Chen",
148+
name: "Soumalya Ghosh",
148149
role: "Backend Developer",
149150
bio: "Expert in building robust APIs and database architectures.",
151+
img: '/soumalya.jpg'
150152
},
151153
{
152-
name: "Michael Rodriguez",
153-
role: "DevOps Engineer",
154-
bio: "Ensures smooth deployment and optimal performance across all platforms.",
154+
name: "Krishanu Roy",
155+
role: "Ideation Lead",
156+
bio: "A chill guy who brings innovative ideas to life.",
157+
img: '/krishanu.jpg'
155158
},
156159
].map((developer, index) => (
157160
<Card key={index}>
158161
<CardHeader>
159162
<div className="flex justify-center">
160163
<div className="relative h-24 w-24 rounded-full overflow-hidden bg-gray-100 dark:bg-gray-800">
161164
<Image
162-
src={`/placeholder.svg?height=96&width=96&text=${developer.name.charAt(0)}`}
165+
src={developer.img}
163166
alt={developer.name}
164167
fill
165168
className="object-cover"

0 commit comments

Comments
 (0)