-
Notifications
You must be signed in to change notification settings - Fork 0
add redirect; add footer with assets link; add not found page #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import React from 'react'; | ||
| import { cookies } from 'next/headers'; | ||
| import { redirect } from 'next/navigation'; | ||
|
|
||
| export default async function LoggedUserLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| const cookieStore = await cookies(); | ||
| const token = cookieStore.get('token')?.value; | ||
| if (token) { | ||
| redirect('/trips'); | ||
| } | ||
|
|
||
| return <>{children}</>; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ function Page() { | |
|
|
||
| return ( | ||
| <div> | ||
| <div className="flex justify-between"> | ||
| <div className="flex justify-between gap-4 sm:p-0 p-2 sm:flex-row flex-col "> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using <div className="flex justify-between gap-4 p-2 sm:p-0 sm:flex-row flex-col">Style Guide ReferencesFootnotes |
||
| <Link | ||
| href="/trips/create" | ||
| className="flex items-center gap-1.5 text-body-semibold text-primary-500 hover:underline" | ||
|
|
@@ -85,7 +85,7 @@ function Page() { | |
| <p>Add a Trip</p> | ||
| </Link> | ||
| {trips && trips.length > 0 && ( | ||
| <div className="flex flex-col items-center text-gray-700 md:flex-row gap-4"> | ||
| <div className="flex items-center text-gray-700 gap-4"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <div className="font-semibold ">Sort By</div> | ||
| <button | ||
| className={`flex items-center gap-2 px-3 py-2 shadow-md ${ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| 'use client'; | ||
| import Link from 'next/link'; | ||
| import Image from 'next/image'; | ||
|
|
||
| export default function NotFound() { | ||
| return ( | ||
| <div className="section py-6 px-6 md:px-12 border"> | ||
| <div className="flex flex-col-reverse lg:flex-row items-center lg:gap-10 gap-4"> | ||
| <div className="flex-1 text-center lg:text-left"> | ||
| <h1 className="text-heading1-bold">Oops! Page not found.</h1> | ||
| <p className="mt-4 text-base"> | ||
| The page you're looking for doesn't exist or has been moved. | ||
| <br /> | ||
| Let's get you back on track. | ||
| </p> | ||
| <Link href="/"> | ||
| <button className="primary-btn text-heading4-medium px-16 py-3 mt-6"> | ||
|
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: Button should not be nested inside Link for accessibility. Use a Link styled as a button, or a button with navigation logic, to avoid these issues. |
||
| Go to Homepage | ||
| </button> | ||
|
Comment on lines
+17
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nesting a <Link
href="/"
className="primary-btn text-heading4-medium px-16 py-3 mt-6">
Go to Homepage
</Link>Style Guide ReferencesFootnotes |
||
| </Link> | ||
| </div> | ||
|
|
||
| <div className="flex-1 w-full max-w-md mx-auto"> | ||
| <Image | ||
| src="/assets/lost-bro.png" | ||
| alt="Page Not Found" | ||
| width={600} | ||
| height={600} | ||
| className="w-full h-auto object-cover" | ||
| priority | ||
| /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,46 @@ | ||
| import React from 'react'; | ||
| 'use client'; | ||
| import { useEffect } from 'react'; | ||
| import Link from 'next/link'; | ||
| import Image from 'next/image'; | ||
| import { getToken } from '@/lib/auth'; | ||
| import { useRouter } from 'next/navigation'; | ||
|
|
||
| export default function Home() { | ||
| const router = useRouter(); | ||
|
|
||
| useEffect(() => { | ||
| const token = getToken(); | ||
| if (token) { | ||
| router.push('/trips'); | ||
| } | ||
| }, [router]); | ||
|
Comment on lines
+11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| return ( | ||
| <div className="section py-6 px-12"> | ||
| <div> | ||
| <h1 className="text-heading1-bold">Group travel, made simple.</h1> | ||
| <p className="mt-4"> | ||
| Plan, vote on activities, and keep everything organized with | ||
| FareShare. From destinations to shared expenses — make every trip | ||
| effortless and unforgettable, together. | ||
| </p> | ||
| <div className="section py-6 px-6 md:px-12 border"> | ||
| <div className="flex flex-col-reverse lg:flex-row items-center lg:gap-10 gap-4"> | ||
| <div className="flex-1"> | ||
| <h1 className="text-heading1-bold">Group travel, made simple.</h1> | ||
| <p className="mt-4"> | ||
| Plan, vote on activities, and keep everything organized with | ||
| FareShare. From destinations to shared expenses — make every trip | ||
| effortless and unforgettable, together. | ||
| </p> | ||
| <button className="primary-btn text-heading4-medium px-16 py-3 mt-4"> | ||
| <Link href="/sign-up">Get Started</Link> | ||
|
Comment on lines
+28
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: Button should wrap Link for accessibility and semantics. Nesting a Link inside a button can cause accessibility and semantic problems. Refactor to avoid placing interactive elements inside each other. |
||
| </button> | ||
|
Comment on lines
+28
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nesting a <Link href="/sign-up" className="primary-btn text-heading4-medium px-16 py-3 mt-4">
Get Started
</Link>Style Guide ReferencesFootnotes |
||
| </div> | ||
|
|
||
| <div className="flex-1 w-full max-w-md mx-auto"> | ||
| <Image | ||
| src="/assets/trip-placeholder.png" | ||
| alt="Trip placeholder" | ||
| width={600} | ||
| height={600} | ||
| className="w-full h-auto object-cover" | ||
| priority | ||
| /> | ||
| </div> | ||
| </div> | ||
| <button className="primary-btn text-heading4-medium px-16 py-3 mt-4"> | ||
| <Link href="/sign-up">Get Started</Link> | ||
| </button> | ||
| </div> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Authorizationheader is no longer being set on the request. Ensure that the backend does not require this header, or that authentication is being handled in a different way.