Skip to content
Merged
Changes from all commits
Commits
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
58 changes: 26 additions & 32 deletions components/auth/login/LoginRequired.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,40 @@
'use client'

import { Card, CardContent, CardHeader, CardTitle } from 'components/ui/card'
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from 'components/ui/card'
import { Button } from 'components/ui/button'
import { AlertTriangle, Key } from 'lucide-react'
import { LogIn } from 'lucide-react'
import { loginPath, loginPathWithReturnToURL } from 'utils/urls'

export default function LoginRequired({ returnTo }: { returnTo?: string }) {
return (
<div className="pt-16">
<div className="mx-auto max-w-md px-4">
<div className="flex min-h-svh items-center justify-center px-4">
<div className="w-full max-w-sm">
<div className="flex flex-col gap-5">
<h1 className="text-2xl font-bold text-center">Grace</h1>
<h1 className="text-3xl font-bold text-center">Grace</h1>
<Card>
<CardHeader>
<CardTitle>ログイン</CardTitle>
<CardHeader className="text-center">
<CardTitle className="text-xl">ログイン</CardTitle>
<CardDescription>
サービスを利用するにはログインが必要です
</CardDescription>
</CardHeader>
<CardContent>
<div className="flex flex-col gap-6">
<div className="flex items-start gap-3 rounded-lg border border-yellow-300 bg-yellow-50 p-4 dark:border-yellow-600 dark:bg-yellow-950">
<AlertTriangle className="size-5 shrink-0 text-yellow-600 dark:text-yellow-400 mt-0.5" />
<div>
<p className="font-medium text-sm">ログインしてください</p>
<p className="text-sm text-muted-foreground mt-1">
このページを表示するにはログインが必要です。
</p>
</div>
</div>
<div className="flex justify-center">
<Button asChild>
<a
href={
returnTo
? loginPathWithReturnToURL(returnTo)
: loginPath
}
>
<Key className="size-4" />
ログインページへ
</a>
</Button>
</div>
</div>
<Button asChild className="w-full">
<a
href={
returnTo ? loginPathWithReturnToURL(returnTo) : loginPath
}
>
<LogIn className="size-4" />
ログイン
</a>
</Button>
</CardContent>
</Card>
</div>
Expand Down
Loading