@@ -5,16 +5,20 @@ import handleGlowBlob from '~/lib/glow';
5
5
6
6
import { Secular_One } from 'next/font/google' ;
7
7
import { FcGoogle } from 'react-icons/fc' ;
8
- import { Button as Btn , Button } from '@chakra-ui/react' ;
8
+ import { Button as Btn , Button , HStack } from '@chakra-ui/react' ;
9
9
10
10
import { signInWithPopup , GoogleAuthProvider , UserCredential , User } from 'firebase/auth' ;
11
11
import { firebase } from '~/lib/firebase' ;
12
- import { addLoggedInUser } from '~/lib/FirebaseAnalysis' ;
13
- import { useContext , useEffect , useState } from 'react' ;
12
+ import {
13
+ FIREBASE_ANALYTICS_EVENTS ,
14
+ addLoggedInUser ,
15
+ reportFirebaseAnalytics
16
+ } from '~/lib/FirebaseAnalysis' ;
17
+ import { useContext } from 'react' ;
14
18
import { UserCredentialsContext } from '~/hooks/UserCredentialsContext' ;
15
-
16
19
import { Tooltip } from '@chakra-ui/react' ;
17
- import { getTimeRemaining } from '~/lib/util' ;
20
+ import { useRouter } from 'next/router' ;
21
+ import { ROUTING } from '~/lib/constant' ;
18
22
19
23
const secular_One = Secular_One ( { subsets : [ 'latin' ] , weight : '400' } ) ;
20
24
@@ -62,27 +66,42 @@ export const NotLoggedIn = ({ text, isLoading }: { text: string; isLoading?: boo
62
66
} ;
63
67
64
68
const LoggedIn = ( { user } : { user : User } ) => {
69
+ const router = useRouter ( ) ;
70
+
65
71
return (
66
- < Link href = "/profile" >
67
- < Tooltip
68
- background = { 'var(--bg-color)' }
69
- color = { 'white' }
70
- border = { '1px solid var(--border-color)' }
71
- label = "profile link"
72
- fontSize = { '1xl' }
73
- className = "roboto" >
74
- < Image
75
- src = { user . photoURL as string }
76
- alt = { 'user_avatar' }
77
- width = { 40 }
78
- height = { 40 }
79
- style = { {
80
- borderRadius : '50%' ,
81
- border : '1px solid var(--border-color)' ,
82
- transform : 'translateY(1px)'
83
- } }
84
- />
85
- </ Tooltip >
86
- </ Link >
72
+ < >
73
+ < HStack alignItems = { 'center' } >
74
+ < Button
75
+ fontWeight = { 'normal' }
76
+ border = { '1px solid var(--border-color)' }
77
+ onClick = { ( ) => {
78
+ reportFirebaseAnalytics ( FIREBASE_ANALYTICS_EVENTS . updated_timetable , { } ) ;
79
+ router . push ( ROUTING . developer ) ;
80
+ } } >
81
+ Update Timetable
82
+ </ Button >
83
+ < Link href = "/profile" >
84
+ < Tooltip
85
+ background = { 'var(--bg-color)' }
86
+ color = { 'white' }
87
+ border = { '1px solid var(--border-color)' }
88
+ label = "profile link"
89
+ fontSize = { '1xl' }
90
+ className = "roboto" >
91
+ < Image
92
+ src = { user . photoURL as string }
93
+ alt = { 'user_avatar' }
94
+ width = { 40 }
95
+ height = { 40 }
96
+ style = { {
97
+ borderRadius : '50%' ,
98
+ border : '1px solid var(--border-color)' ,
99
+ transform : 'translateY(1px)'
100
+ } }
101
+ />
102
+ </ Tooltip >
103
+ </ Link >
104
+ </ HStack >
105
+ </ >
87
106
) ;
88
107
} ;
0 commit comments