-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring: move onboarding UI from app layout to new /app/onboarding
- Loading branch information
Showing
16 changed files
with
247 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'server-only'; | ||
import Link from 'next/link'; | ||
import { redirect } from 'next/navigation'; | ||
import { twMerge } from 'tailwind-merge'; | ||
import { buttonGreenClassName } from '@/modules/shared/controls/button/buttonClassName'; | ||
import { ErrorList } from '@/modules/shared/errors/ErrorList'; | ||
import { getProjects } from '@/modules/app/projects/ProjectsRepository'; | ||
|
||
export default async function Onboarding() { | ||
const { data: projects, errors } = await getProjects(); | ||
if (errors) return <ErrorList errors={errors} />; | ||
if (projects && projects.length > 0) redirect('/app/today'); | ||
|
||
return ( | ||
<> | ||
<h2 className="mt-4 text-2xl">Welcome!</h2> | ||
<p className="mt-8 text-sm font-medium">You don't have any projects yet.</p> | ||
<Link href="/app/projects/new" className={twMerge(buttonGreenClassName, 'w-fit mt-8')}> | ||
Create your first! | ||
</Link> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ErrorList } from '@/modules/shared/errors/ErrorList'; | ||
import { getTasks } from '@/modules/app/tasks/TasksRepository'; | ||
|
||
interface NoTasksInProjectProps { | ||
readonly id: string; | ||
} | ||
|
||
export const NoTasksInProject = async ({ id }: NoTasksInProjectProps) => { | ||
const { data: tasks, errors } = await getTasks({ | ||
byProject: id, | ||
}); | ||
|
||
if (errors) return <ErrorList errors={errors} />; | ||
if (!tasks || tasks.length > 0) return null; | ||
|
||
return <p className="mb-6 text-sm font-medium text-gray-600">No tasks in this project.</p>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum TaskStatus { | ||
Complete = 'Complete', | ||
Incomplete = 'Incomplete', | ||
} |
Oops, something went wrong.