Skip to content

Commit

Permalink
more fixesss
Browse files Browse the repository at this point in the history
  • Loading branch information
Niceygy committed Jan 29, 2024
1 parent 17a3877 commit 36d8c64
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
28 changes: 11 additions & 17 deletions src/pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,29 @@ export default function UserSettings() {
};
const [localUser, setLocalUser] = useState<User | null>(null);

loginIfUserNull({ then: "/settings", thenDisplayName: "Settings" }, router);

useEffect(() => {
listenForUser((user) => {
if (!user) {
if (!user || user == null) {
log(
"User is null! Redirecting to login page",
"settings/listenForUser"
);
// router.push({
// pathname: "/login",
// query: {
// then: "/settings",
// thenDisplayName: "Settings",
// },// we should be able to replace this redirect code with my new loginifusernull fn now?
// });
} else {
setLocalUser(user);
log("User signed in. Continuing...", "settings/listenForUser");
log(`User signed in as ${JSON.stringify(user.displayName)}. Continuing...`, `settings/listenForUser`);
}
});
}, []);
// loginIfUserNull({ then: "/settings", thenDisplayName: "Settings" }, router);

loginIfUserNull(
{
then: "/settings",
thenDisplayName: "Settings :)",
},
router
);
// loginIfUserNull(
// {
// then: "/settings",
// thenDisplayName: "Settings :)",
// },
// router
// );

/**
* Updates the user settings
Expand Down Expand Up @@ -84,6 +77,7 @@ export default function UserSettings() {
return;
}

log("Rendering settings page for user " + localUser, "settings");
return (
<>
<Head>
Expand Down
8 changes: 4 additions & 4 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import url('https://fonts.googleapis.com/css2?family=Onest:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Pathway+Extreme:ital,opsz,wght@0,8..144,100;0,8..144,200;0,8..144,300;0,8..144,400;0,8..144,500;0,8..144,600;0,8..144,700;0,8..144,800;0,8..144,900;1,8..144,100;1,8..144,200;1,8..144,300;1,8..144,400;1,8..144,500;1,8..144,600;1,8..144,700;1,8..144,800;1,8..144,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Hedvig+Letters+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Pathway+Extreme:ital,opsz,wght@0,8..144,100;0,8..144,200;0,8..144,300;0,8..144,400;0,8..144,500;0,8..144,600;0,8..144,700;0,8..144,800;0,8..144,900;1,8..144,100;1,8..144,200;1,8..144,300;1,8..144,400;1,8..144,500;1,8..144,600;1,8..144,700;1,8..144,800;1,8..144,900&display=swap');

:root {
font-family: 'Onest';
--sansSerif: 'Onest';
--headings: 'Onest';
font-family: "Hedvig Letters Sans";
--sansSerif: "Hedvig Letters Sans";
--headings: "Hedvig Letters Sans";
--smallBorderRadius: 11px;
--primaryAccentColour: rgb(214, 125, 90);
}
Expand Down

0 comments on commit 36d8c64

Please sign in to comment.