diff --git a/web/lib/firebase/users.ts b/web/lib/firebase/users.ts index e436b463..7b5428fa 100644 --- a/web/lib/firebase/users.ts +++ b/web/lib/firebase/users.ts @@ -65,6 +65,7 @@ export function listenForLogin(onUser: (_user: User | null) => void) { } else { // User logged out; reset to null onUser(null) + localStorage.removeItem(CACHED_USER_KEY) } }) } diff --git a/web/pages/account.tsx b/web/pages/account.tsx index 0fed1440..82d2c801 100644 --- a/web/pages/account.tsx +++ b/web/pages/account.tsx @@ -1,5 +1,4 @@ -import { useRouter } from 'next/router' -import { firebaseLogout } from '../lib/firebase/users' +import { firebaseLogin, firebaseLogout, User } from '../lib/firebase/users' import { Header } from '../components/header' import { useUser } from '../hooks/use-user' import { useState, useEffect } from 'react' @@ -7,11 +6,62 @@ import { Contract, listContracts } from '../lib/firebase/contracts' import { ContractsList } from '../components/contracts-list' import { Title } from '../components/title' +function UserCard(props: { user: User }) { + const { user } = props + return ( +
{user?.email}
+M$ {user?.balance}
+Sign in to get started
+{user?.email}
-M${user?.balance}
-