File tree 4 files changed +62
-15
lines changed
4 files changed +62
-15
lines changed Original file line number Diff line number Diff line change 1
- /**
2
- * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
3
- * for Docker builds.
4
- */
5
1
await import ( "./src/env.js" ) ;
6
2
7
3
/** @type {import("next").NextConfig } */
8
- const config = { } ;
4
+ const config = {
5
+ images : {
6
+ remotePatterns : [
7
+ {
8
+ protocol : "https" ,
9
+ hostname : "cdn.discordapp.com" ,
10
+ port : "" ,
11
+ pathname : "/embed/avatars/**" ,
12
+ } ,
13
+ ] ,
14
+ } ,
15
+ } ;
9
16
10
17
export default config ;
Original file line number Diff line number Diff line change @@ -54,14 +54,15 @@ model Session {
54
54
}
55
55
56
56
model User {
57
- id String @id @default (cuid () )
58
- name String ?
59
- email String ? @unique
60
- emailVerified DateTime ?
61
- image String ?
62
- accounts Account []
63
- sessions Session []
64
- tasks Task []
57
+ id String @id @default (cuid () )
58
+ name String ?
59
+ email String ? @unique
60
+ emailVerified DateTime ?
61
+ image String ?
62
+ accounts Account []
63
+ sessions Session []
64
+ tasks Task []
65
+ completedTasks Int @default (0 )
65
66
}
66
67
67
68
model VerificationToken {
Original file line number Diff line number Diff line change @@ -29,14 +29,19 @@ const Navbar = () => {
29
29
</ div >
30
30
< ul
31
31
tabIndex = { 0 }
32
- className = "menu menu-sm dropdown-content rounded-box z-[1] mt-3 w-52 bg-violet-50 p-2 shadow"
32
+ className = "menu dropdown-content menu-sm z-[1] mt-3 w-52 rounded-box bg-violet-50 p-2 shadow"
33
33
>
34
34
< li className = "text-2xl text-orange-500" >
35
35
< Link href = "/" > Home</ Link >
36
36
</ li >
37
37
< li className = "text-orange-500" >
38
38
< Link href = "/create-task" > Create Task</ Link >
39
39
</ li >
40
+ { user !== undefined && (
41
+ < li className = "text-orange-500" >
42
+ < Link href = "/completed-tasks" > Completed</ Link >
43
+ </ li >
44
+ ) }
40
45
{ user !== undefined && (
41
46
< li className = "text-orange-500" >
42
47
< Link href = { `/profiles/${ user ?. id } ` } > Profile</ Link >
@@ -61,7 +66,12 @@ const Navbar = () => {
61
66
</ li >
62
67
{ user !== undefined && (
63
68
< li className = "rounded text-lg font-medium text-zinc-950 hover:bg-orange-200" >
64
- < Link href = { `/profiles/${ user ?. id } ` } > Profile</ Link >
69
+ < Link href = "/completed-tasks" > Completed</ Link >
70
+ </ li >
71
+ ) }
72
+ { user !== undefined && (
73
+ < li className = "rounded text-lg font-medium text-zinc-950 hover:bg-orange-200" >
74
+ < Link href = { `/profile/${ user ?. id } ` } > Profile</ Link >
65
75
</ li >
66
76
) }
67
77
</ ul >
Original file line number Diff line number Diff line change
1
+ "use client" ;
2
+
3
+ import { useSession } from "next-auth/react" ;
4
+ import Image from "next/image" ;
5
+ import React from "react" ;
6
+
7
+ const Profile = ( ) => {
8
+ const session = useSession ( ) ;
9
+ const user = { ...session . data ?. user } ;
10
+
11
+ console . log ( session . data ?. user . name ) ;
12
+
13
+ return (
14
+ < div className = "mt-16 flex flex-col items-center" >
15
+ < Image
16
+ src = { user . image ?? "" }
17
+ alt = "user avatar"
18
+ width = { 200 }
19
+ height = { 200 }
20
+ className = "rounded-full"
21
+ />
22
+ < div >
23
+ < h1 className = "mt-4 text-4xl" > { user . name } </ h1 >
24
+ </ div >
25
+ </ div >
26
+ ) ;
27
+ } ;
28
+
29
+ export default Profile ;
You can’t perform that action at this time.
0 commit comments