mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-22 21:36:25 +02:00
Prefetch user (#429)
This commit is contained in:
parent
37f777cace
commit
249376c43e
20 changed files with 220 additions and 181 deletions
|
@ -27,7 +27,7 @@ import { useModal } from "./modal";
|
|||
import ModalProvider, { useModalContext } from "./modal/modal-provider";
|
||||
import Popover from "./popover";
|
||||
import Preferences from "./preferences";
|
||||
import { useSession } from "./session";
|
||||
import { useUser } from "./user-provider";
|
||||
|
||||
const HomeLink = () => {
|
||||
return (
|
||||
|
@ -40,7 +40,7 @@ const HomeLink = () => {
|
|||
const MobileNavigation: React.VoidFunctionComponent<{
|
||||
openLoginModal: () => void;
|
||||
}> = ({ openLoginModal }) => {
|
||||
const { user } = useSession();
|
||||
const { user } = useUser();
|
||||
const { t } = useTranslation(["common", "app"]);
|
||||
return (
|
||||
<div
|
||||
|
@ -152,7 +152,7 @@ const AppMenu: React.VoidFunctionComponent<{ className?: string }> = ({
|
|||
const UserDropdown: React.VoidFunctionComponent<
|
||||
DropdownProps & { openLoginModal: () => void }
|
||||
> = ({ children, openLoginModal, ...forwardProps }) => {
|
||||
const { logout, user } = useSession();
|
||||
const { logout, user } = useUser();
|
||||
const { t } = useTranslation(["common", "app"]);
|
||||
const modalContext = useModalContext();
|
||||
if (!user) {
|
||||
|
@ -243,7 +243,7 @@ const UserDropdown: React.VoidFunctionComponent<
|
|||
const StandardLayout: React.VoidFunctionComponent<{
|
||||
children?: React.ReactNode;
|
||||
}> = ({ children, ...rest }) => {
|
||||
const { user } = useSession();
|
||||
const { user } = useUser();
|
||||
const { t } = useTranslation(["common", "app"]);
|
||||
const [loginModal, openLoginModal] = useModal({
|
||||
footer: null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue