Skip to content

Commit

Permalink
upgrade: upgrade to next 14.1 and remove redirect from marketing
Browse files Browse the repository at this point in the history
  • Loading branch information
flsilva committed Jan 20, 2024
1 parent 69a8d73 commit 1ed0dac
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 89 deletions.
166 changes: 106 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"date-fns": "2.30.0",
"date-fns-tz": "2.0.0",
"isomorphic-dompurify": "2.2.0",
"next": "14.0.3",
"next": "14.1.0",
"react": "18.2.0",
"react-contenteditable": "3.3.7",
"react-day-picker": "8.10.0",
Expand All @@ -44,12 +44,12 @@
"devDependencies": {
"@mdx-js/loader": "3.0.0",
"@mdx-js/react": "3.0.0",
"@next/mdx": "14.0.3",
"@next/mdx": "14.1.0",
"@tailwindcss/forms": "0.5.7",
"@tailwindcss/typography": "0.5.10",
"autoprefixer": "10.4.17",
"eslint": "8.56.0",
"eslint-config-next": "14.0.3",
"eslint-config-next": "14.1.0",
"eslint-config-prettier": "9.1.0",
"postcss": "8.4.33",
"prettier": "3.2.4",
Expand Down
9 changes: 0 additions & 9 deletions src/app/(marketing)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import '../globals.css';
import { redirect } from 'next/navigation';
import { Header } from '@/features/marketing/shared/ui/Header';
import { Footer } from '@/features/marketing/shared/ui/Footer';
import { isUserAuthenticated } from '@/features/app/users/data-access/UsersDataAccess';

export default async function MarketingLayout({ children }: { children: React.ReactNode }) {
/*
* Redirect authenticated users to the app.
*/
const isAuthenticated = await isUserAuthenticated();
if (isAuthenticated) redirect('/app/onboarding');
/**/

return (
<>
<div className="flex flex-1 flex-col bg-white">
Expand Down
5 changes: 4 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './globals.css';
import { Suspense } from 'react';
import type { Metadata, Viewport } from 'next';
import { Inter } from 'next/font/google';
import { GaNextScriptNavigation } from '@/features/shared/routing/GoogleAnalytics';
Expand Down Expand Up @@ -148,7 +149,9 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<html lang="en" className="h-full antialiased">
<body className={`${inter.className} flex flex-col h-full`}>
<InstallPwaProvider>{children}</InstallPwaProvider>
<GaNextScriptNavigation gaId="G-C6TYTB01NE" />
<Suspense>
<GaNextScriptNavigation gaId="G-C6TYTB01NE" />
</Suspense>
</body>
</html>
);
Expand Down
33 changes: 18 additions & 15 deletions src/features/app/tasks/ui/TaskForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'server-only';
import { Suspense } from 'react';
import { notFound } from 'next/navigation';
import { twMerge } from 'tailwind-merge';
import { ClassNamePropsOptional } from '@/features/shared/ui/ClassNameProps';
Expand Down Expand Up @@ -55,21 +56,23 @@ export const TaskForm = async ({
className={twMerge('flex flex-col w-full', className)}
>
{task && <input type="hidden" name="id" value={task.id} />}
<TaskFormFields
defaultDueDate={defaultDueDate}
projectsSelect={
<ProjectsSelect
ariaLabel="Projects"
defaultValue={projectId ?? task?.projectId}
name="projectId"
onValueChange={updateTaskProject}
placeholder="Select a Project"
/>
}
startOnEditingMode={startOnEditingMode}
task={task}
taskNameClassName={taskNameClassName}
/>
<Suspense>
<TaskFormFields
defaultDueDate={defaultDueDate}
projectsSelect={
<ProjectsSelect
ariaLabel="Projects"
defaultValue={projectId ?? task?.projectId}
name="projectId"
onValueChange={updateTaskProject}
placeholder="Select a Project"
/>
}
startOnEditingMode={startOnEditingMode}
task={task}
taskNameClassName={taskNameClassName}
/>
</Suspense>
<FormErrorList />
</Form>
);
Expand Down
Loading

0 comments on commit 1ed0dac

Please sign in to comment.