Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
453087b
chore(global): :green_heart: add proyect key on coderabbit config file
3FE3LE Oct 19, 2024
aaa8155
chore(opt): :globe_with_meridians: add ES/EN messages on OPT
3FE3LE Oct 19, 2024
d35e090
feat(opt): :sparkles: add menuitem on OPT navbar
3FE3LE Oct 19, 2024
8cf8602
perf(suite): :sparkles: upgrade props using on lavbar component
3FE3LE Oct 19, 2024
7eeb444
feat(opt): :sparkles: SSS-9 set styles on homepage
3FE3LE Oct 19, 2024
7d72b0e
SSS-9 fix img naming typo
3FE3LE Oct 19, 2024
810bef4
feat(opt): :sparkles: SSS-5 add style on dashboard page
3FE3LE Oct 19, 2024
416b8f0
perf(global): :arrow_up: update next version and set turbo flag on de…
3FE3LE Oct 25, 2024
3edbb3c
chore(global): :arrow_up: update Auth.js
3FE3LE Oct 26, 2024
6c45e52
perf(global): :arrow_up: upgrade next-intl
3FE3LE Oct 26, 2024
0f51f30
feat(global): :boom: integrate break changes by new version of Next.j…
3FE3LE Oct 26, 2024
eb9489f
perf(opt): :zap: improve performace proupose by coderabbit after code…
3FE3LE Oct 26, 2024
3ccd18f
style(global): :zap: fix bad implementations on functions & mixins
3FE3LE Oct 26, 2024
f768190
fix(global): :globe_with_meridians: update locales & rename messages …
3FE3LE Oct 27, 2024
24a632b
perf(global): :zap: delete useless files & add perform on locales mes…
3FE3LE Oct 27, 2024
17f9995
perf(global): :pushpin: set especific next-auth version
3FE3LE Oct 28, 2024
ba67670
perf(global): :zap: improvements on middlewares
3FE3LE Oct 28, 2024
81cadb5
perf(global): :zap: improvements on root layouts
3FE3LE Oct 28, 2024
6a37baa
perf(opt): :zap: improvements on core layer (interfaces)
3FE3LE Oct 28, 2024
91cddc5
perf(opt): :zap: improvements on Trip Store & add MenuItems contants
3FE3LE Oct 28, 2024
333d365
perf(opt): :zap: update & integrate changes to fit with Next 15
3FE3LE Oct 28, 2024
cd47f4c
style(global): :zap: improvement on styles
3FE3LE Oct 28, 2024
2f27e6c
refactor(opt): :recycle: refactor dashboard page
3FE3LE Oct 28, 2024
970d9b2
refactor(opt): :recycle: Simplification of Trips components and updat…
3FE3LE Apr 8, 2025
48b301e
refactor(global): :recycle: Refactor code structure for improved read…
3FE3LE Apr 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ knowledge_base:
issues:
scope: auto
jira:
project_keys: []
project_keys: [SSS]
linear:
team_keys: []
pull_requests:
Expand Down
4 changes: 0 additions & 4 deletions apps/native/.expo-shared/assets.json

This file was deleted.

14 changes: 0 additions & 14 deletions apps/native/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions apps/native/App.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/native/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions apps/native/app.json

This file was deleted.

Binary file removed apps/native/assets/adaptive-icon.png
Binary file not shown.
Binary file removed apps/native/assets/favicon.png
Binary file not shown.
Binary file removed apps/native/assets/icon.png
Binary file not shown.
Binary file removed apps/native/assets/splash.png
Binary file not shown.
6 changes: 0 additions & 6 deletions apps/native/babel.config.js

This file was deleted.

8 changes: 0 additions & 8 deletions apps/native/index.js

This file was deleted.

21 changes: 0 additions & 21 deletions apps/native/metro.config.js

This file was deleted.

29 changes: 0 additions & 29 deletions apps/native/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions apps/native/tsconfig.json

This file was deleted.

42 changes: 8 additions & 34 deletions apps/opt/app/[locale]/dashboard/page.tsx
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() {
Copy link
Contributor

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 DashboardPage as 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:

#!/bin/bash
# Description: Search potential references to the old async function name.
fd -e tsx -e ts --exec rg "DashboardPage" {}

Length of output: 94


Action Required: Remove or Update Leftover Async Declaration

It appears that a leftover async export for DashboardPage is still present in the codebase:

  • Detected Code:
    export default async function DashboardPage() {
  • Impact:
    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.

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>
);
}
32 changes: 21 additions & 11 deletions apps/opt/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
import '@opt/styles/main.scss';

import { getMessages, unstable_setRequestLocale } from 'next-intl/server';
import { getMessages, setRequestLocale } from 'next-intl/server';

import { auth } from '@opt/auth';
import { AppWrapper, SWRProvider } from '@opt/components/UI';
import { routing } from '@opt/i18n/routing';
import { Navbar } from '@repo/ui';
import { PageProps } from '@repo/ui/types';
import { OPT_MENU_ITEMS } from '@repo/ui/constants';

import { metadata } from '../metadata';

const languages = ['en', 'es'];

export async function generateStaticParams() {
return languages.map((locale) => ({ locale }));
return routing.locales.map((locale) => ({ locale }));
}
export default async function RootLayout({
children,
params: { locale },
}: PageProps) {
unstable_setRequestLocale(locale);
params,
}: {
children: React.ReactNode;
params: { locale: 'es' | 'en' };
}) {
const { locale } = await params;

setRequestLocale(locale);
const session = await auth();

const messages = await getMessages();

const authenticated = !!session;

const menuItems = OPT_MENU_ITEMS;

return (
<html lang="en" suppressHydrationWarning>
<body>
Expand All @@ -27,9 +39,7 @@ export default async function RootLayout({
<main className="layout">
<Navbar
title={'One Plan Trip'}
menuItems={[]}
authenticated
locale={locale}
{...{ authenticated, menuItems, locale }}
/>
<div className="layout__content">
<section className="layout__section">{children}</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/opt/app/[locale]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import { ArrowLeft } from 'lucide-react';

import { useRouter } from '@opt/navigations';
import { useRouter } from '@opt/i18n/routing';
import { ActionButton } from '@repo/ui';

export default function NotFound() {
Expand Down
23 changes: 20 additions & 3 deletions apps/opt/app/[locale]/page.tsx
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>
);
}
7 changes: 5 additions & 2 deletions apps/opt/app/[locale]/trips/[id]/page.tsx
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} />;
}
23 changes: 5 additions & 18 deletions apps/opt/app/[locale]/trips/page.tsx
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>
);
}
2 changes: 1 addition & 1 deletion apps/opt/components/UI/StepperFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { signOut, useSession } from 'next-auth/react';
import { toast } from 'react-hot-toast';

import { Trip } from '@opt/core/interfaces';
import { useRouter } from '@opt/i18n/routing';
import { TripActions } from '@opt/integration/actions/';
import { useRouter } from '@opt/navigations';
import { useTripStore } from '@opt/store';
import { ActionButton } from '@repo/ui/';

Expand Down
20 changes: 20 additions & 0 deletions apps/opt/components/dashboard/DashboardContent.tsx
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} />
</>
);
};
1 change: 1 addition & 0 deletions apps/opt/components/dashboard/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DashboardContent } from './DashboardContent';
Loading