-
- {pageName}
-
+
+
{pageName}
diff --git a/template/app/src/auth/LoginPage.tsx b/template/app/src/auth/LoginPage.tsx
index 288f4efa1..735b87bff 100644
--- a/template/app/src/auth/LoginPage.tsx
+++ b/template/app/src/auth/LoginPage.tsx
@@ -1,4 +1,4 @@
-import { Link } from 'react-router-dom';
+import { Link as WaspRouterLink, routes } from 'wasp/client/router';
import { LoginForm } from 'wasp/client/auth';
import { AuthPageLayout } from './AuthPageLayout';
@@ -9,17 +9,17 @@ export default function Login() {
Don't have an account yet?{' '}
-
+
go to signup
-
+
.
Forgot your password?{' '}
-
+
reset it
-
+
.
diff --git a/template/app/src/auth/SignupPage.tsx b/template/app/src/auth/SignupPage.tsx
index 7c6297a60..cf205f6e0 100644
--- a/template/app/src/auth/SignupPage.tsx
+++ b/template/app/src/auth/SignupPage.tsx
@@ -1,4 +1,4 @@
-import { Link } from 'react-router-dom';
+import { Link as WaspRouterLink, routes } from 'wasp/client/router';
import { SignupForm } from 'wasp/client/auth';
import { AuthPageLayout } from './AuthPageLayout';
@@ -9,9 +9,9 @@ export function Signup() {
I already have an account (
-
+
go to login
-
+
).
diff --git a/template/app/src/auth/email-and-pass/EmailVerificationPage.tsx b/template/app/src/auth/email-and-pass/EmailVerificationPage.tsx
index 6066bfd96..24d256594 100644
--- a/template/app/src/auth/email-and-pass/EmailVerificationPage.tsx
+++ b/template/app/src/auth/email-and-pass/EmailVerificationPage.tsx
@@ -1,4 +1,4 @@
-import { Link } from 'react-router-dom';
+import { Link as WaspRouterLink, routes } from 'wasp/client/router';
import { VerifyEmailForm } from 'wasp/client/auth';
import { AuthPageLayout } from '../AuthPageLayout';
@@ -8,7 +8,7 @@ export function EmailVerificationPage() {
- If everything is okay, go to login
+ If everything is okay, go to login
);
diff --git a/template/app/src/auth/email-and-pass/PasswordResetPage.tsx b/template/app/src/auth/email-and-pass/PasswordResetPage.tsx
index a4d4afbc7..ea5dc1003 100644
--- a/template/app/src/auth/email-and-pass/PasswordResetPage.tsx
+++ b/template/app/src/auth/email-and-pass/PasswordResetPage.tsx
@@ -1,4 +1,4 @@
-import { Link } from 'react-router-dom';
+import { Link as WaspRouterLink, routes } from 'wasp/client/router';
import { ResetPasswordForm } from 'wasp/client/auth';
import { AuthPageLayout } from '../AuthPageLayout';
@@ -8,7 +8,7 @@ export function PasswordResetPage() {
- If everything is okay, go to login
+ If everything is okay, go to login
);
diff --git a/template/app/src/client/App.tsx b/template/app/src/client/App.tsx
index 4202d25bd..ead2651d5 100644
--- a/template/app/src/client/App.tsx
+++ b/template/app/src/client/App.tsx
@@ -1,13 +1,14 @@
-import { useAuth } from 'wasp/client/auth';
-import { updateCurrentUser } from 'wasp/client/operations';
import './Main.css';
import NavBar from './components/NavBar/NavBar';
+import CookieConsentBanner from './components/cookie-consent/Banner';
import { appNavigationItems } from './components/NavBar/contentSections';
import { landingPageNavigationItems } from '../landing-page/contentSections';
-import CookieConsentBanner from './components/cookie-consent/Banner';
import { useMemo, useEffect } from 'react';
+import { routes } from 'wasp/client/router';
import { Outlet, useLocation } from 'react-router-dom';
+import { useAuth } from 'wasp/client/auth';
import { useIsLandingPage } from './hooks/useIsLandingPage';
+import { updateCurrentUser } from 'wasp/client/operations';
/**
* use this component to wrap all child components
@@ -17,9 +18,10 @@ export default function App() {
const location = useLocation();
const { data: user } = useAuth();
const isLandingPage = useIsLandingPage();
+ const navigationItems = isLandingPage ? landingPageNavigationItems : appNavigationItems;
const shouldDisplayAppNavBar = useMemo(() => {
- return location.pathname !== '/login' && location.pathname !== '/signup';
+ return location.pathname !== routes.LoginRoute.build() && location.pathname !== routes.SignupRoute.build();
}, [location]);
const isAdminDashboard = useMemo(() => {
@@ -53,9 +55,7 @@ export default function App() {
) : (
<>
- {shouldDisplayAppNavBar && (
-
- )}
+ {shouldDisplayAppNavBar &&
}
diff --git a/template/app/src/client/components/NavBar/NavBar.tsx b/template/app/src/client/components/NavBar/NavBar.tsx
index 6cb22dac8..838139326 100644
--- a/template/app/src/client/components/NavBar/NavBar.tsx
+++ b/template/app/src/client/components/NavBar/NavBar.tsx
@@ -1,4 +1,5 @@
-import { Link } from 'react-router-dom';
+import { Link as ReactRouterLink } from 'react-router-dom';
+import { Link as WaspRouterLink, routes } from 'wasp/client/router';
import { useAuth } from 'wasp/client/auth';
import { useState, Dispatch, SetStateAction } from 'react';
import { Dialog } from '@headlessui/react';
@@ -12,14 +13,14 @@ import DarkModeSwitcher from '../DarkModeSwitcher';
import { useIsLandingPage } from '../../hooks/useIsLandingPage';
import { cn } from '../../cn';
-interface NavigationItem {
+export interface NavigationItem {
name: string;
to: string;
}
const NavLogo = () =>

;
-export default function AppNavBar({ navigation }: { navigation: NavigationItem[] }) {
+export default function AppNavBar({ navigationItems }: { navigationItems: NavigationItem[] }) {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const isLandingPage = useIsLandingPage();
@@ -33,15 +34,15 @@ export default function AppNavBar({ navigation }: { navigation: NavigationItem[]
>