-
-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
1,698 additions
and
709 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
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,29 @@ | ||
export function AuthPageContainer({ children }: { children: React.ReactNode }) { | ||
return <div className="space-y-8 lg:space-y-10">{children}</div>; | ||
} | ||
|
||
export function AuthPageHeader({ children }: { children: React.ReactNode }) { | ||
return <div className="space-y-1 text-center">{children}</div>; | ||
} | ||
|
||
export function AuthPageTitle({ children }: { children: React.ReactNode }) { | ||
return <h1 className="text-2xl font-bold">{children}</h1>; | ||
} | ||
|
||
export function AuthPageDescription({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <p className="text-muted-foreground">{children}</p>; | ||
} | ||
|
||
export function AuthPageContent({ children }: { children: React.ReactNode }) { | ||
return <div className="space-y-4">{children}</div>; | ||
} | ||
|
||
export function AuthPageExternal({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<p className="text-muted-foreground px-4 py-3 text-center">{children}</p> | ||
); | ||
} |
47 changes: 47 additions & 0 deletions
47
apps/web/src/app/[locale]/(auth)/components/full-page-card.tsx
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,47 @@ | ||
export function FullPageCardContainer({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<div className="flex h-screen flex-col gap-6 bg-gray-50 p-4"> | ||
<div className="rounded-xl border bg-white p-4">{children}</div> | ||
</div> | ||
); | ||
} | ||
|
||
export function FullPageCardHeader({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <header>{children}</header>; | ||
} | ||
|
||
export function FullPageCardTitle({ children }: { children: React.ReactNode }) { | ||
return <h1>{children}</h1>; | ||
} | ||
|
||
export function FullPageCardDescription({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <p>{children}</p>; | ||
} | ||
|
||
export function FullPageCardContent({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <main className="flex-1">{children}</main>; | ||
} | ||
|
||
export function FullPageCardFooter({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <footer>{children}</footer>; | ||
} |
5 changes: 5 additions & 0 deletions
5
apps/web/src/app/[locale]/(auth)/components/version-badge.tsx
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,5 @@ | ||
import { Badge } from "@rallly/ui/badge"; | ||
|
||
export function VersionBadge() { | ||
return <Badge>v{process.env.NEXT_PUBLIC_APP_VERSION}</Badge>; | ||
} |
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 |
---|---|---|
@@ -1,7 +1,63 @@ | ||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
import { cn } from "@rallly/ui"; | ||
import { DotPattern } from "@rallly/ui/dot-pattern"; | ||
import type { Metadata } from "next"; | ||
import { redirect, RedirectType } from "next/navigation"; | ||
|
||
import { getServerSession } from "@/auth"; | ||
import { Logo } from "@/components/logo"; | ||
import { isQuickCreateEnabled } from "@/features/quick-create"; | ||
import { QuickStartButton } from "@/features/quick-create/quick-create-button"; | ||
import { QuickStartWidget } from "@/features/quick-create/quick-create-widget"; | ||
|
||
export default async function Layout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
const session = await getServerSession(); | ||
|
||
if (session?.user.email) { | ||
return redirect("/", RedirectType.replace); | ||
} | ||
|
||
return ( | ||
<div className="h-full p-3 sm:p-8"> | ||
<div className="mx-auto max-w-lg">{children}</div> | ||
<div className="relative flex h-screen flex-col items-center justify-center bg-gray-100 p-2 lg:p-4"> | ||
<div className="z-10 flex w-full max-w-7xl flex-1 rounded-xl border bg-white shadow-sm lg:max-h-[720px] lg:p-2"> | ||
<div className="flex flex-1 flex-col gap-6 p-6 lg:p-16"> | ||
<div className="p-4"> | ||
<Logo className="mx-auto" /> | ||
</div> | ||
<div className="flex h-full w-full flex-1 flex-col items-center justify-center"> | ||
<div className="w-full max-w-sm">{children}</div> | ||
</div> | ||
{isQuickCreateEnabled ? ( | ||
<div className="flex justify-center lg:hidden"> | ||
<QuickStartButton /> | ||
</div> | ||
) : null} | ||
</div> | ||
{isQuickCreateEnabled ? ( | ||
<div className="relative hidden flex-1 flex-col justify-center rounded-lg border border-gray-100 bg-gray-50 lg:flex lg:p-16"> | ||
<div className="z-10 mx-auto w-full max-w-md"> | ||
<QuickStartWidget /> | ||
</div> | ||
<DotPattern | ||
cx={10} | ||
cy={10} | ||
className={cn( | ||
"[mask-image:radial-gradient(400px_circle_at_top,white,transparent)]", | ||
)} | ||
/> | ||
</div> | ||
) : null} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export const metadata: Metadata = { | ||
title: { | ||
template: "%s - Rallly", | ||
default: "Rallly", | ||
}, | ||
}; |
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,16 @@ | ||
"use server"; | ||
|
||
import { prisma } from "@rallly/database"; | ||
import { cookies } from "next/headers"; | ||
|
||
export async function setVerificationEmail(email: string) { | ||
const count = await prisma.user.count({ | ||
where: { | ||
email, | ||
}, | ||
}); | ||
|
||
cookies().set("verification-email", email); | ||
|
||
return count > 0; | ||
} |
21 changes: 21 additions & 0 deletions
21
apps/web/src/app/[locale]/(auth)/login/components/auth-errors.tsx
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,21 @@ | ||
"use client"; | ||
import { useSearchParams } from "next/navigation"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
export function AuthErrors() { | ||
const { t } = useTranslation(); | ||
const searchParams = useSearchParams(); | ||
const error = searchParams?.get("error"); | ||
if (error === "OAuthAccountNotLinked") { | ||
return ( | ||
<p className="text-destructive text-sm"> | ||
{t("accountNotLinkedDescription", { | ||
defaultValue: | ||
"A user with this email already exists. Please log in using the original method.", | ||
})} | ||
</p> | ||
); | ||
} | ||
|
||
return null; | ||
} |
Oops, something went wrong.