mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-28 10:26:12 +01:00
feat: initialise a new totals tab with basic UI (#94)
* feat: initialise a new totals tab with basic UI * fix: update group tabs and add stats page * fix: styling within the new elements * Prettier * Display active user expenses only if active user is set --------- Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
This commit is contained in:
@@ -48,3 +48,17 @@ export function useBaseUrl() {
|
||||
}, [])
|
||||
return baseUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns The active user, or `null` until it is fetched from local storage
|
||||
*/
|
||||
export function useActiveUser(groupId: string) {
|
||||
const [activeUser, setActiveUser] = useState<string | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
const activeUser = localStorage.getItem(`${groupId}-activeUser`)
|
||||
if (activeUser) setActiveUser(activeUser)
|
||||
}, [groupId])
|
||||
|
||||
return activeUser
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user