mirror of
https://github.com/lukevella/rallly.git
synced 2025-11-23 02:36:07 +01:00
♻️ Switch to using new startTime column (#1041)
This commit is contained in:
parent
bbbbf5ff49
commit
a3e26bcc9a
7 changed files with 57 additions and 137 deletions
apps/web/src/components
|
|
@ -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 }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue