@@ -4,7 +4,13 @@ import { useEffect, useState } from 'react'
44import { useRouter } from 'next/navigation'
55import { useSession } from 'next-auth/react'
66import { Button } from '@/components/ui/button'
7- import { Card , CardContent , CardDescription , CardHeader , CardTitle } from '@/components/ui/card'
7+ import {
8+ Card ,
9+ CardContent ,
10+ CardDescription ,
11+ CardHeader ,
12+ CardTitle ,
13+ } from '@/components/ui/card'
814import { Skeleton } from '@/components/ui/skeleton'
915import { CheckCircle , XCircle , Clock , Users } from 'lucide-react'
1016
@@ -54,7 +60,9 @@ export default function InvitationPage({ params }: PageProps) {
5460
5561 const acceptInvitation = async ( ) => {
5662 if ( ! session ) {
57- router . push ( `/login?callbackUrl=${ encodeURIComponent ( window . location . href ) } ` )
63+ router . push (
64+ `/login?callbackUrl=${ encodeURIComponent ( window . location . href ) } `
65+ )
5866 return
5967 }
6068
@@ -85,7 +93,7 @@ export default function InvitationPage({ params }: PageProps) {
8593
8694 if ( loading ) {
8795 return (
88- < div className = "min-h-screen flex items-center justify-center bg-black text-white" >
96+ < div className = "flex items-center justify-center bg-black text-white" >
8997 < Card className = "w-full max-w-md bg-gray-900 border border-gray-700 shadow-xl" >
9098 < CardHeader >
9199 < Skeleton className = "h-6 w-3/4 bg-gray-700" />
@@ -101,7 +109,7 @@ export default function InvitationPage({ params }: PageProps) {
101109
102110 if ( error ) {
103111 return (
104- < div className = "min-h-screen flex items-center justify-center bg-black text-white" >
112+ < div className = "flex items-center justify-center bg-black text-white" >
105113 < Card className = "w-full max-w-md bg-gray-900 border border-red-500 shadow-xl" >
106114 < CardHeader >
107115 < div className = "flex items-center gap-2" >
@@ -111,9 +119,9 @@ export default function InvitationPage({ params }: PageProps) {
111119 < CardDescription className = "text-gray-400" > { error } </ CardDescription >
112120 </ CardHeader >
113121 < CardContent >
114- < Button
115- onClick = { ( ) => router . push ( '/' ) }
116- variant = "outline"
122+ < Button
123+ onClick = { ( ) => router . push ( '/' ) }
124+ variant = "outline"
117125 className = "w-full border-gray-600 hover:bg-gray-700 text-white"
118126 >
119127 Go to Homepage
@@ -126,12 +134,14 @@ export default function InvitationPage({ params }: PageProps) {
126134
127135 if ( success ) {
128136 return (
129- < div className = "min-h-screen flex items-center justify-center bg-black text-white" >
137+ < div className = "flex items-center justify-center bg-black text-white" >
130138 < Card className = "w-full max-w-md bg-gray-900 border border-green-500 shadow-xl" >
131139 < CardHeader >
132140 < div className = "flex items-center gap-2" >
133141 < CheckCircle className = "h-5 w-5 text-green-400" />
134- < CardTitle className = "text-green-400" > Welcome to { invitation ?. organization_name } !</ CardTitle >
142+ < CardTitle className = "text-green-400" >
143+ Welcome to { invitation ?. organization_name } !
144+ </ CardTitle >
135145 </ div >
136146 < CardDescription className = "text-gray-400" >
137147 You've successfully joined the organization. Redirecting...
@@ -149,15 +159,16 @@ export default function InvitationPage({ params }: PageProps) {
149159 const isExpired = new Date ( invitation . expires_at ) < new Date ( )
150160
151161 return (
152- < div className = "min-h-screen flex items-center justify-center bg-black text-white relative overflow-hidden" >
162+ < div className = "flex items-center justify-center bg-black text-white relative overflow-hidden py-12 " >
153163 < Card className = "w-full max-w-md bg-gray-900 border border-gray-700 shadow-xl z-10" >
154164 < CardHeader >
155165 < div className = "flex items-center gap-2" >
156166 < Users className = "h-5 w-5 text-blue-400" />
157167 < CardTitle > Organization Invitation</ CardTitle >
158168 </ div >
159169 < CardDescription className = "text-gray-400" >
160- { invitation . inviter_name } has invited you to join { invitation . organization_name }
170+ { invitation . inviter_name } has invited you to join{ ' ' }
171+ { invitation . organization_name }
161172 </ CardDescription >
162173 </ CardHeader >
163174 < CardContent className = "space-y-4" >
@@ -182,9 +193,9 @@ export default function InvitationPage({ params }: PageProps) {
182193 { isExpired ? (
183194 < div className = "text-center" >
184195 < p className = "text-red-400 mb-4" > This invitation has expired.</ p >
185- < Button
186- onClick = { ( ) => router . push ( '/' ) }
187- variant = "outline"
196+ < Button
197+ onClick = { ( ) => router . push ( '/' ) }
198+ variant = "outline"
188199 className = "w-full border-gray-600 hover:bg-gray-700 text-white"
189200 >
190201 Go to Homepage
@@ -199,28 +210,33 @@ export default function InvitationPage({ params }: PageProps) {
199210 < p className = "text-gray-400 mb-4" >
200211 Please sign in to accept this invitation.
201212 </ p >
202- < Button
203- onClick = { ( ) => router . push ( `/login?callbackUrl=${ encodeURIComponent ( window . location . href ) } ` ) }
213+ < Button
214+ onClick = { ( ) =>
215+ router . push (
216+ `/login?callbackUrl=${ encodeURIComponent ( window . location . href ) } `
217+ )
218+ }
204219 className = "w-full bg-blue-600 hover:bg-blue-700 text-white"
205220 >
206221 Sign In to Accept
207222 </ Button >
208223 </ div >
209224 ) : session . user ?. email !== invitation . email ? (
210- < div className = "text-center " >
225+ < div className = "text-left " >
211226 < p className = "text-red-400 mb-4" >
212- This invitation is for { invitation . email } , but you're signed in as { session . user ?. email } .
227+ This invitation is for { invitation . email } , but you're signed
228+ in as { session . user ?. email } .
213229 </ p >
214- < Button
230+ < Button
215231 onClick = { ( ) => router . push ( '/login' ) }
216- variant = "outline"
232+ variant = "outline"
217233 className = "w-full border-gray-600 hover:bg-gray-700 text-white"
218234 >
219235 Sign in with correct account
220236 </ Button >
221237 </ div >
222238 ) : (
223- < Button
239+ < Button
224240 onClick = { acceptInvitation }
225241 disabled = { accepting }
226242 className = "w-full bg-green-600 hover:bg-green-700 text-white"
@@ -234,4 +250,4 @@ export default function InvitationPage({ params }: PageProps) {
234250 </ Card >
235251 </ div >
236252 )
237- }
253+ }
0 commit comments