-
Notifications
You must be signed in to change notification settings - Fork 0
Sss 4 opt stabilization to release #20
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
base: develop
Are you sure you want to change the base?
Changes from all commits
453087b
aaa8155
d35e090
8cf8602
7eeb444
7d72b0e
810bef4
416b8f0
3edbb3c
6c45e52
0f51f30
eb9489f
3ccd18f
f768190
24a632b
17f9995
ba67670
81cadb5
6a37baa
91cddc5
333d365
cd47f4c
2f27e6c
970d9b2
48b301e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,12 @@ | ||
| import { Link } from '@opt/navigations'; | ||
| import { ActionButton } from '@repo/ui'; | ||
| import { DashboardContent } from '@opt/components/dashboard'; | ||
| import { TripsProvider } from '@opt/components/providers/TripsProvider'; | ||
|
|
||
| export default async function DashboardPage() { | ||
| export default function Dashboard() { | ||
| return ( | ||
| <div> | ||
| <header> | ||
| <h2>Your trips</h2> | ||
| <ActionButton>new Trip</ActionButton> | ||
| </header> | ||
| <article> | ||
| <h3>Current trip</h3> | ||
| <p>You can see your past trips here.</p> | ||
| <p> | ||
| To create a new trip, click on <strong>New Trip</strong>. | ||
| </p> | ||
| <p>Click on a trip to view its details.</p> | ||
| </article> | ||
| <article> | ||
| <h3>Coming soon...</h3> | ||
| <p>You can see your past trips here.</p> | ||
| <p> | ||
| To create a new trip, click on <strong>New Trip</strong>. | ||
| </p> | ||
| <p>Click on a trip to view its details.</p> | ||
| </article> | ||
| <article> | ||
| <h3>Trips history</h3> | ||
| <p>You can see your past trips here.</p> | ||
| <p> | ||
| To create a new trip, click on <strong>New Trip</strong>. | ||
| </p> | ||
| <p>Click on a trip to view its details.</p> | ||
| </article> | ||
| <Link href={'/trips'}>See all trips</Link> | ||
| </div> | ||
| <TripsProvider> | ||
| <div className="dashboard"> | ||
| <DashboardContent /> | ||
| </div> | ||
| </TripsProvider> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,24 @@ | ||
| export default function Web() { | ||
| import { getTranslations } from 'next-intl/server'; | ||
| import Image from 'next/image'; | ||
|
|
||
| import { Link } from '@opt/i18n/routing'; | ||
| import landing_img from '@repo/ui/assets/animated/globalization-a.svg'; | ||
|
|
||
| export default async function HomePage() { | ||
| const t = await getTranslations('home'); | ||
|
|
||
| return ( | ||
| <div> | ||
| <h1 className="heading-1">Este es One plan trip</h1> | ||
| <div className="home__container"> | ||
| <div className="home__title"> | ||
| <h1 className="heading--1">{t('title2')}</h1> | ||
| <h5 className="subtitle--1">{t('subtitle2')}</h5> | ||
| <Link href={`/dashboard`} className="home__button"> | ||
| {t('tryNow')} | ||
| </Link> | ||
| </div> | ||
| <div className="home__title"> | ||
| <Image src={landing_img} alt="traveling image" width={550} /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| import { TripDetails } from '@opt/components/trips'; | ||
|
|
||
| export default function Trip({ params }: { params: { id: string } }) { | ||
| return <TripDetails id={params.id} />; | ||
| type IdParams = Promise<{ id: string }>; | ||
|
|
||
| export default async function Trip({ params }: { params: IdParams }) { | ||
| const { id } = await params; | ||
| return <TripDetails id={id} />; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,10 @@ | ||
| import { redirect } from 'next/navigation'; | ||
|
|
||
| import { TripsContainer } from '@opt/components/trips'; | ||
| import { ActionButton } from '@repo/ui'; | ||
| import { TripsProvider } from '@opt/components/providers/TripsProvider'; | ||
| import { TripsContent } from '@opt/components/trips'; | ||
|
|
||
| export default async function Trips() { | ||
| return ( | ||
| <div> | ||
| <header> | ||
| <h2>Trips</h2> | ||
| <form | ||
| action={async () => { | ||
| 'use server'; | ||
| return redirect('/trips/new'); | ||
| }} | ||
| > | ||
| <ActionButton variant="primary">Create new Trip</ActionButton> | ||
| </form> | ||
| </header> | ||
| <TripsContainer /> | ||
| </div> | ||
| <TripsProvider> | ||
| <TripsContent /> | ||
| </TripsProvider> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| 'use client'; | ||
| import { useTripsContext } from '../providers/TripsProvider'; | ||
| import { TripSearch, TripSections, TripStats } from '../trips'; | ||
|
|
||
| export const DashboardContent = () => { | ||
| const { trips, isLoading, isError } = useTripsContext(); | ||
|
|
||
| if (isLoading) return <div>Loading...</div>; | ||
| if (isError) return <div>Error loading trips.</div>; | ||
|
|
||
| return ( | ||
| <> | ||
| <div className="dashboard__search"> | ||
| <TripSearch /> | ||
| </div> | ||
| <TripStats trips={trips} /> | ||
| <TripSections trips={trips} /> | ||
| </> | ||
| ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { DashboardContent } from './DashboardContent'; |
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.
💡 Verification agent
🧩 Analysis chain
Confirm no leftover references to async usage.
Previously, you had
DashboardPageas an async function. Changing it to a standard function is fine, but please ensure no upstream code still relies on an async export.🏁 Script executed:
Length of output: 94
Action Required: Remove or Update Leftover Async Declaration
It appears that a leftover async export for
DashboardPageis still present in the codebase:This suggests that somewhere in the repository, the old async function is still defined. Please verify if any upstream code depends on the async behavior of
DashboardPage. If not needed, remove or refactor this leftover export to align with the new synchronous implementation to avoid any unintended side effects.