@@ -28,7 +28,7 @@ function classNames(...classes) {
2828const auth = getAuth ( ) ;
2929const baseUrl = process . env . NEXT_PUBLIC_FRONTEND_URL ;
3030
31- const adminList = [ 'pranav, ' ] ;
31+ const adminList = [ 'pranav' ] ;
3232
3333const DEFAULT_NOTIFICATION = {
3434 image :
@@ -38,12 +38,12 @@ const DEFAULT_NOTIFICATION = {
3838 receivedTime : '12h ago' ,
3939} ;
4040
41- export function StandardNav ( ) {
41+ export function StandardNav ( props ) {
4242 const [ isAdmin , setIsAdmin ] = useState ( false ) ;
4343 const [ points , setPoints ] = useState ( '0' ) ;
4444 const [ notifications , setNotifications ] = useState ( [ ] ) ;
4545 const [ showBanner , setShowBanner ] = useState ( false ) ;
46-
46+ const { guestAllowed } = props ;
4747 const router = useRouter ( ) ;
4848
4949 function logout ( ) {
@@ -81,13 +81,22 @@ export function StandardNav() {
8181 ] ) ;
8282
8383 const [ username , setUsername ] = useState ( null ) ;
84- const [ pfp , setPfp ] = useState ( '' ) ;
84+ const [ pfp , setPfp ] = useState ( null ) ;
8585
8686 // get user's profile picture
8787 useEffect ( ( ) => {
8888 if ( ! username ) {
8989 return ;
9090 }
91+
92+
93+ if ( localStorage . getItem ( "pfp" ) ) {
94+ setPfp ( localStorage . getItem ( "pfp" ) ) ;
95+ }
96+
97+
98+
99+
91100 const fetchData = async ( ) => {
92101 try {
93102 const endPoint = process . env . NEXT_PUBLIC_API_URL + '/users/' + username + '/pfp' ;
@@ -258,7 +267,8 @@ export function StandardNav() {
258267 ) }
259268 </ div >
260269 </ div >
261- < div className = "flex items-center" >
270+ { ! guestAllowed &&
271+ < div className = "flex items-center " >
262272 < div
263273 className = "mb-0 flex items-center space-x-2 rounded-lg px-4 py-1"
264274 style = { { backgroundColor : '#212121' , borderWidth : '0px' } }
@@ -389,6 +399,8 @@ export function StandardNav() {
389399 </ Menu >
390400 </ div >
391401 </ div >
402+ }
403+
392404 </ div >
393405 </ div >
394406
0 commit comments