feat: add landing page components including hero, features, problem, and footer
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m23s
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m23s
- Introduced LandingHero component with logo, tagline, and action buttons. - Created LandingFeatures component to showcase chore system benefits. - Developed LandingProblem component explaining the importance of a structured chore system. - Implemented LandingFooter for navigation and copyright information. - Added LandingPage to assemble all components and manage navigation. - Included unit tests for LandingHero component to ensure functionality.
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
enforceParentExpiry,
|
||||
} from '../stores/auth'
|
||||
import ParentPinSetup from '@/components/auth/ParentPinSetup.vue'
|
||||
import LandingPage from '@/components/landing/LandingPage.vue'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
@@ -235,7 +236,9 @@ const routes = [
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/child',
|
||||
name: 'LandingPage',
|
||||
component: LandingPage,
|
||||
meta: { isPublic: true },
|
||||
},
|
||||
]
|
||||
|
||||
@@ -260,8 +263,8 @@ router.beforeEach(async (to, from, next) => {
|
||||
})
|
||||
}
|
||||
|
||||
// If already logged in and trying to access /auth, redirect to appropriate view
|
||||
if (to.path.startsWith('/auth') && isUserLoggedIn.value) {
|
||||
// If already logged in and trying to access /auth or landing, redirect to appropriate view
|
||||
if ((to.path.startsWith('/auth') || to.path === '/') && isUserLoggedIn.value) {
|
||||
if (isParentAuthenticated.value) {
|
||||
return next('/parent')
|
||||
} else {
|
||||
@@ -269,14 +272,14 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Always allow /auth and /parent/pin-setup
|
||||
if (to.path.startsWith('/auth') || to.name === 'ParentPinSetup') {
|
||||
// Always allow /auth, landing page, and /parent/pin-setup
|
||||
if (to.path.startsWith('/auth') || to.path === '/' || to.name === 'ParentPinSetup') {
|
||||
return next()
|
||||
}
|
||||
|
||||
// If not logged in, redirect to /auth
|
||||
// If not logged in, redirect to landing page
|
||||
if (!isUserLoggedIn.value) {
|
||||
return next('/auth')
|
||||
return next('/')
|
||||
}
|
||||
|
||||
// If parent-authenticated, allow all /parent routes
|
||||
|
||||
Reference in New Issue
Block a user