File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ import { AnimatePresence } from 'framer-motion'
5
5
import dynamic from 'next/dynamic'
6
6
import { usePathname } from 'next/navigation'
7
7
8
+ import { useIsLogged } from '~/atoms'
8
9
import { UserArrowLeftIcon } from '~/components/icons/user-arrow-left'
9
10
import { FloatPopover } from '~/components/ui/float-popover'
10
11
import { urlBuilder } from '~/lib/url-builder'
12
+ import { useAggregationSelector } from '~/providers/root/aggregation-data-provider'
11
13
12
14
import { HeaderActionButton } from './HeaderActionButton'
13
15
@@ -28,9 +30,24 @@ const SignInButton = dynamic(() =>
28
30
import ( '@clerk/nextjs' ) . then ( ( mod ) => mod . SignInButton ) ,
29
31
)
30
32
33
+ const OwnerAvatar = ( ) => {
34
+ const ownerAvatar = useAggregationSelector ( ( s ) => s . user . avatar ) !
35
+
36
+ return (
37
+ < div className = "pointer-events-auto flex h-10 w-10 items-center justify-center overflow-hidden rounded-full" >
38
+ < img src = { ownerAvatar } alt = "site owner" />
39
+ </ div >
40
+ )
41
+ }
31
42
export function UserAuth ( ) {
32
43
const pathname = usePathname ( )
33
44
45
+ const isLogged = useIsLogged ( )
46
+
47
+ if ( isLogged ) {
48
+ return < OwnerAvatar />
49
+ }
50
+
34
51
return (
35
52
< AnimatePresence >
36
53
< SignedIn key = "user-info" >
You can’t perform that action at this time.
0 commit comments