Skip to content

Commit

Permalink
feat: improve experience by replacing redirect with immediate login c…
Browse files Browse the repository at this point in the history
…omponent
  • Loading branch information
cedricss committed Nov 30, 2024
1 parent 4932c9b commit f6b9d4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ProConnectButton from "@codegouvfr/react-dsfr/ProConnectButton";

export default function Connexion() {
export function Connexion() {
return (
<div className="max-w-xl pb-24">
<div className="max-w-xl pb-48">
<h1>Espace lauréat</h1>
<p className="fr-text--lead">
Ce service est accessible aux porteurs d'un projet lauréat du Fonds
Expand Down
2 changes: 1 addition & 1 deletion app/espace-laureat/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default async function Loading() {
<>
<h1 className="w-96 h-12 bg-gray-100 animate-pulse"></h1>
<div className="flex flex-col gap-y-8">
<div className="p-6 w-full h-[539px] bg-gray-100 animate-pulse">
<div className="p-6 w-full h-[419px] bg-gray-100 animate-pulse">
<h2 className="w-80 h-10 bg-gray-200 animate-pulse"></h2>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions app/espace-laureat/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { redirect } from "next/navigation";

import { Connexion } from "@/app/espace-laureat/_components/Connexion";
import { DossierSection } from "@/app/espace-laureat/_components/DossierSection";
import { getDossier } from "@/app/espace-laureat/_components/getDossier";
import { getPageTitle } from "@/app/espace-laureat/_components/getPageTitle";
Expand All @@ -19,7 +18,7 @@ export default async function EspaceLaureat({
const user = session?.user;

if (!user || !user.email || !user.email_verified) {
return redirect("/connexion");
return <Connexion />;
}

const params = await getSearchParams({ searchParams });
Expand Down

0 comments on commit f6b9d4b

Please sign in to comment.