2
2
import Head from 'next/head' ;
3
3
import Link from 'next/link' ;
4
4
import { useEffect , useState } from 'react' ;
5
- import { useRouter } from 'next/router' ;
6
- import { account } from '../lib/appwrite.config' ;
7
5
8
6
export default function Home ( ) {
9
- const router = useRouter ( ) ;
7
+
10
8
const [ userType , setUserType ] = useState < string | null > ( null ) ;
11
9
12
10
useEffect ( ( ) => {
@@ -28,17 +26,6 @@ export default function Home() {
28
26
fetchSession ( ) ;
29
27
} , [ ] ) ;
30
28
31
- const handleLogout = async ( ) => {
32
- try {
33
- await account . deleteSession ( 'current' ) ;
34
- localStorage . removeItem ( 'appwriteSession' ) ;
35
- localStorage . removeItem ( 'userType' ) ;
36
- router . push ( '/customer-login' ) ;
37
- } catch ( error ) {
38
- console . error ( 'Error logging out:' , error ) ;
39
- }
40
- } ;
41
-
42
29
return (
43
30
< div className = "min-h-[81vh] flex flex-col justify-center items-center homepage-background" >
44
31
< Head >
@@ -50,25 +37,17 @@ export default function Home() {
50
37
< main className = "relative z-10 flex flex-col md:flex-row justify-center items-center py-8 w-full flex-1" >
51
38
{ userType ? (
52
39
< div className = "flex flex-col items-center space-y-4 p-8 bg-white bg-opacity-80 rounded-md shadow-lg md:w-3/2" >
53
- < h1 className = "text-4xl font-bold mb-2" > Welcome, { userType } </ h1 >
54
- { userType === 'Customer' && (
40
+ { userType === 'Customer' ? (
55
41
< >
56
- < p > Customer-specific content here. </ p >
57
- { /* Add other customer-specific components or content */ }
42
+ < h1 className = "text-4xl font-bold mb-2" > Looking for inspirations?! </ h1 >
43
+ < p className = "text-lg" > Check out our latest services and offers tailored just for you. </ p >
58
44
</ >
59
- ) }
60
- { userType === 'Provider' && (
45
+ ) : (
61
46
< >
62
- < p > Provider-specific content here. </ p >
63
- { /* Add other provider-specific components or content */ }
47
+ < h1 className = "text-4xl font-bold mb-2" > Hey there, Pro! </ h1 >
48
+ < p className = "text-lg" > Wanna check out some tips and resources to help grow your business? </ p >
64
49
</ >
65
50
) }
66
- < button
67
- onClick = { handleLogout }
68
- className = "mt-4 bg-red-500 text-white py-2 px-4 rounded"
69
- >
70
- Logout
71
- </ button >
72
51
</ div >
73
52
) : (
74
53
< div className = "flex flex-col items-center space-y-4 p-8 bg-white bg-opacity-80 rounded-md shadow-lg md:w-3/2" >
0 commit comments