1
0
Fork 0
mirror of https://github.com/lukevella/rallly.git synced 2025-11-23 02:36:07 +01:00

♻️ Switch to using new startTime column ()

This commit is contained in:
Luke Vella 2024-03-17 11:21:54 +07:00 committed by GitHub
commit a3e26bcc9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 57 additions and 137 deletions
apps/web/src/components

View file

@ -27,17 +27,7 @@ export const UserContext = React.createContext<{
} | null>(null);
export const useUser = () => {
const value = useRequiredContext(UserContext, "UserContext");
return { ...value, isInternalUser: value.user.email?.endsWith("@rallly.co") };
};
export const useAuthenticatedUser = () => {
const { user, ...rest } = useRequiredContext(UserContext, "UserContext");
if (user.isGuest) {
throw new Error("Forget to prefetch user identity");
}
return { user, ...rest };
return useRequiredContext(UserContext, "UserContext");
};
export const IfAuthenticated = (props: { children?: React.ReactNode }) => {