File tree Expand file tree Collapse file tree 8 files changed +50
-19
lines changed Expand file tree Collapse file tree 8 files changed +50
-19
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { useSession } from 'next-auth/client'
5
5
import { useMutation , useQueryClient } from 'react-query'
6
6
import toast , { Toaster } from 'react-hot-toast'
7
7
import { useRef , useState } from 'react'
8
- import { Markdown } from '@/components'
8
+ import { Markdown , A } from '@/components'
9
9
10
10
type Inputs = {
11
11
description : string
@@ -80,7 +80,9 @@ export default function EditUpdate({
80
80
< div className = "flex space-x-3" >
81
81
< div className = "flex-shrink-0" >
82
82
< div className = "relative" >
83
- < Avatar src = { ( session . user as User ) . image } />
83
+ < A href = { `/${ ( session . user as User ) . username } ` } >
84
+ < Avatar src = { ( session . user as User ) . image } />
85
+ </ A >
84
86
</ div >
85
87
</ div >
86
88
< div className = "min-w-0 flex-1" >
Original file line number Diff line number Diff line change 1
1
import { User } from 'src/pages/members'
2
2
import { Avatar } from '@/ui'
3
3
import { DateTime } from 'luxon'
4
+ import { A } from '@/components'
4
5
5
6
export default function GoalMeta ( {
6
7
className = '' ,
@@ -81,14 +82,21 @@ export default function GoalMeta({
81
82
< ul className = "mt-3 space-y-3" >
82
83
{ participants . map ( ( participant ) => (
83
84
< li className = "flex justify-start" key = { participant . id } >
84
- < a href = "/" className = "flex items-end space-x-3" >
85
+ < A
86
+ href = { `/${ participant . username } ` }
87
+ className = "flex items-end space-x-3"
88
+ >
85
89
< div className = "flex-shrink-0" >
86
- < Avatar src = { participant . image } size = "2xs" />
90
+ < Avatar
91
+ src = { participant . image }
92
+ size = "2xs"
93
+ alt = { participant . account ?. firstName }
94
+ />
87
95
</ div >
88
96
< div className = "text-sm font-medium text-gray-900" >
89
97
{ participant . account ?. firstName ?? participant . name }
90
98
</ div >
91
- </ a >
99
+ </ A >
92
100
</ li >
93
101
) ) }
94
102
</ ul >
Original file line number Diff line number Diff line change 1
1
import { Avatar } from '@/ui'
2
2
import React from 'react'
3
3
import { User } from 'src/pages/members'
4
- import { Markdown } from '@/components'
4
+ import { Markdown , A } from '@/components'
5
5
import { DateTime } from 'luxon'
6
6
7
7
export type GoalUpdateType = {
@@ -33,7 +33,9 @@ export default function GoalUpdate({
33
33
34
34
< div className = "relative flex items-start space-x-3" >
35
35
< div className = "relative" >
36
- < Avatar src = { postedBy . image } />
36
+ < A href = { `/${ postedBy . username } ` } >
37
+ < Avatar src = { postedBy . image } alt = { postedBy . account ?. firstName } />
38
+ </ A >
37
39
</ div >
38
40
< div className = "min-w-0 flex-1" >
39
41
< div >
Original file line number Diff line number Diff line change @@ -63,7 +63,12 @@ export default function NewComment({ updateId }: { updateId: string }) {
63
63
< div className = "flex space-x-3" >
64
64
< div className = "flex-shrink-0" >
65
65
< div className = "relative" >
66
- < Avatar src = { ( session . user as User ) . image } />
66
+ < A href = { `/${ ( session . user as User ) . username } ` } >
67
+ < Avatar
68
+ src = { ( session . user as User ) . image }
69
+ alt = { ( session . user as User ) . account ?. firstName }
70
+ />
71
+ </ A >
67
72
</ div >
68
73
</ div >
69
74
< div className = "min-w-0 flex-1" >
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { useSession } from 'next-auth/client'
5
5
import { useMutation , useQueryClient } from 'react-query'
6
6
import toast , { Toaster } from 'react-hot-toast'
7
7
import { useRef , useState } from 'react'
8
- import { Markdown } from '@/components'
8
+ import { Markdown , A } from '@/components'
9
9
10
10
type Inputs = {
11
11
description : string
@@ -73,7 +73,12 @@ export default function NewUpdate({
73
73
< div className = "flex space-x-3" >
74
74
< div className = "flex-shrink-0" >
75
75
< div className = "relative" >
76
- < Avatar src = { ( session . user as User ) . image } />
76
+ < A href = { `/${ ( session . user as User ) . username } ` } >
77
+ < Avatar
78
+ src = { ( session . user as User ) . image }
79
+ alt = { ( session . user as User ) . account ?. firstName }
80
+ />
81
+ </ A >
77
82
</ div >
78
83
</ div >
79
84
< div className = "min-w-0 flex-1" >
Original file line number Diff line number Diff line change 1
1
import { Avatar } from '@/ui'
2
2
import React from 'react'
3
3
import { User } from 'src/pages/members'
4
- import { Markdown } from '@/components'
4
+ import { Markdown , A } from '@/components'
5
5
import { DateTime } from 'luxon'
6
6
7
7
export type GoalUpdateType = {
@@ -26,12 +26,17 @@ export default function UpdateComment({
26
26
< div className = "relative pb-6" >
27
27
< div className = "relative flex items-start space-x-3" >
28
28
< div className = "relative" >
29
- < Avatar src = { postedBy . image } />
29
+ < A href = { `/${ postedBy . username } ` } >
30
+ < Avatar src = { postedBy . image } alt = { postedBy . account ?. firstName } />
31
+ </ A >
30
32
</ div >
31
33
< div className = "min-w-0 flex-1" >
32
34
< div >
33
35
< div className = "text-sm" >
34
- < a href = "/" className = "font-medium text-gray-900" >
36
+ < a
37
+ href = { `/${ postedBy . username } ` }
38
+ className = "font-medium text-gray-900"
39
+ >
35
40
{ postedBy . account ?. firstName ?? postedBy . name }
36
41
</ a >
37
42
</ div >
Original file line number Diff line number Diff line change @@ -45,11 +45,13 @@ export default function Profile({ user }: { user: User }) {
45
45
< div className = "sm:flex sm:items-center sm:justify-between" >
46
46
< div className = "sm:flex sm:space-x-5 sm:items-center" >
47
47
< div className = "flex-shrink-0" >
48
- < img
49
- className = "mx-auto h-20 w-20 rounded-full"
50
- src = { user . image }
51
- alt = ""
52
- />
48
+ < A href = { `/${ ( session . user as User ) . username } ` } >
49
+ < img
50
+ className = "mx-auto h-20 w-20 rounded-full"
51
+ src = { user . image }
52
+ alt = { user . name }
53
+ />
54
+ </ A >
53
55
</ div >
54
56
< div className = "mt-4 text-center sm:mt-0 sm:pt-1 sm:text-left" >
55
57
< p className = "text-xl font-bold text-gray-900 sm:text-2xl" >
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export type AvatarProps = {
7
7
className ?: string
8
8
size ?: SizeVariant
9
9
src ?: string
10
+ alt ?: string
10
11
name ?: string
11
12
squared ?: boolean
12
13
}
@@ -24,6 +25,7 @@ export default function Avatar({
24
25
className,
25
26
size = 'md' ,
26
27
src,
28
+ alt = '' ,
27
29
name,
28
30
squared = false ,
29
31
} : AvatarProps ) {
@@ -48,7 +50,7 @@ export default function Avatar({
48
50
className
49
51
) }
50
52
src = { src }
51
- alt = ""
53
+ alt = { alt }
52
54
tabIndex = { 0 }
53
55
/>
54
56
) : name ? (
You can’t perform that action at this time.
0 commit comments