@@ -3,63 +3,82 @@ import { Button } from "@/components/ui/button";
3
3
import { Input } from "@/components/ui/input" ;
4
4
import Image from "next/image" ;
5
5
import { useRouter } from "next/navigation" ;
6
- import { useState } from "react" ;
6
+ import { useState } from "react" ;
7
7
import { toast } from "sonner" ;
8
- import { useSelector } from ' react-redux' ;
9
- import { RootState } from ' @/config/store' ;
8
+ import { useSelector } from " react-redux" ;
9
+ import { RootState } from " @/config/store" ;
10
10
import createAxiosInstance from "@/config/AxiosProtectedRoute" ;
11
11
import { createNewTeamUrl } from "@/lib/API-URLs" ;
12
12
13
13
function CreateTeam ( ) {
14
14
const [ teamName , setTeamName ] = useState ( "" ) ;
15
- const user = useSelector ( ( state :RootState ) => state . auth . user )
15
+ const user = useSelector ( ( state : RootState ) => state . auth . user ) ;
16
16
const router = useRouter ( ) ;
17
17
const axiosInstance = createAxiosInstance ( user . accessToken ) ;
18
18
19
- const createNewTeam = async ( ) => {
19
+ const createNewTeam = async ( ) => {
20
20
try {
21
- const res = await axiosInstance . post ( createNewTeamUrl , {
22
- teamName
21
+ const res = await axiosInstance . post ( createNewTeamUrl , {
22
+ teamName,
23
23
} ) ;
24
- if ( res . status === 200 ) {
25
- router . push ( ' /dashboard' ) ;
24
+ if ( res . status === 200 ) {
25
+ router . push ( " /dashboard" ) ;
26
26
toast . success ( "Team created Successfully" ) ;
27
27
}
28
28
} catch ( err ) {
29
-
30
29
console . log ( err ) ;
31
30
}
32
31
} ;
33
-
32
+
34
33
return (
35
- < div className = " px-6 md:px-16 my-16" >
36
- < Image src = "/android-chrome-512x512.png" alt = "logo" width = { 50 } height = { 50 } />
37
- < div className = "flex flex-col items-center mt-8 gap-4" >
38
- < h2 className = "font-bold text-[40px] py-3" >
39
- What should we call your team?
40
- </ h2 >
41
- < div className = "mt-7 w-[40%]" >
42
- < label className = "text-muted-foreground" > Team Name</ label >
43
- < Input
44
- placeholder = "Team Name"
45
- className = "mt-3"
46
- onChange = { ( e ) => setTeamName ( e . target . value ) }
47
- />
34
+ < >
35
+ < div className = "relative min-h-screen w-full lg:grid lg:grid-cols-2" >
36
+ < div className = "flex items-center justify-center py-12" >
37
+ < div className = "px-6 md:px-16 my-16" >
38
+ < Image
39
+ src = "/android-chrome-512x512.png"
40
+ alt = "logo"
41
+ width = { 50 }
42
+ height = { 50 }
43
+ />
44
+ < div className = "flex flex-col items-center mt-8 gap-4" >
45
+ < h2 className = "font-bold text-[40px] py-3 text-center" >
46
+ What should we call your team?
47
+ </ h2 >
48
+ < div className = "mt-7 w-full sm:px-8" >
49
+ < label className = "text-muted-foreground" > Team Name</ label >
50
+ < Input
51
+ placeholder = "Team Name"
52
+ className = "mt-3"
53
+ onChange = { ( e ) => setTeamName ( e . target . value ) }
54
+ />
55
+ </ div >
56
+ < div className = "flex gap-10 items-center" >
57
+ < Button
58
+ disabled = { ! ( teamName && teamName ?. length > 0 ) }
59
+ onClick = { ( ) => createNewTeam ( ) }
60
+ >
61
+ Create Team
62
+ </ Button >
63
+ < Button onClick = { ( ) => router . push ( "/dashboard" ) } >
64
+ Cancel
65
+ </ Button >
66
+ </ div >
67
+ </ div >
68
+ </ div >
48
69
</ div >
49
- < div className = "flex gap-10 items-center" >
50
- < Button
51
- disabled = { ! ( teamName && teamName ?. length > 0 ) }
52
- onClick = { ( ) => createNewTeam ( ) }
53
- >
54
- Create Team
55
- </ Button >
56
- < Button
57
- onClick = { ( ) => router . push ( "/dashboard" ) } >
58
- Cancel
59
- </ Button >
70
+ < div className = "hidden max-h-svh overflow-hidden bg-muted md:block" >
71
+ < Image
72
+ alt = "Image"
73
+ loading = "lazy"
74
+ width = { 500 }
75
+ height = { 500 }
76
+ src = "https://i.postimg.cc/26253f6m/ok-2.png"
77
+ className = "h-full w-full object-cover transition-all duration-500 hover:scale-110"
78
+ />
60
79
</ div >
61
80
</ div >
62
- </ div >
81
+ </ >
63
82
) ;
64
83
}
65
84
0 commit comments