-
Notifications
You must be signed in to change notification settings - Fork 51
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
1 parent
3099538
commit da83913
Showing
13 changed files
with
234 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
const config = { | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": true | ||
parser: "@typescript-eslint/parser", | ||
ignorePatterns: ["prettier.config.mjs"], | ||
parserOptions: { | ||
project: true, | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
plugins: ["@typescript-eslint"], | ||
extends: [ | ||
"next/core-web-vitals", | ||
"plugin:@typescript-eslint/recommended-type-checked", | ||
"plugin:@typescript-eslint/stylistic-type-checked", | ||
"plugin:storybook/recommended" | ||
"plugin:storybook/recommended", | ||
], | ||
"rules": { | ||
rules: { | ||
"@typescript-eslint/array-type": "off", | ||
"@typescript-eslint/consistent-type-definitions": "off", | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"warn", | ||
{ | ||
"prefer": "type-imports", | ||
"fixStyle": "inline-type-imports" | ||
} | ||
prefer: "type-imports", | ||
fixStyle: "inline-type-imports", | ||
}, | ||
], | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
"argsIgnorePattern": "^_" | ||
} | ||
argsIgnorePattern: "^_", | ||
}, | ||
], | ||
"@typescript-eslint/require-await": "off", | ||
"@typescript-eslint/no-misused-promises": [ | ||
"error", | ||
{ | ||
"checksVoidReturn": { | ||
"attributes": false | ||
} | ||
} | ||
] | ||
} | ||
} | ||
module.exports = config; | ||
checksVoidReturn: { | ||
attributes: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
module.exports = config; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
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,12 @@ | ||
import React from 'react'; | ||
import { LoginScreen } from '~/components/patterns/login-screen'; | ||
|
||
const LoginPage = () => { | ||
return ( | ||
<div> | ||
<LoginScreen /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LoginPage; |
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,24 @@ | ||
"use client"; | ||
|
||
import { DropdownMenuItem } from "~/components/ui/dropdown-menu"; | ||
|
||
import { signOut, useSession } from "next-auth/react"; | ||
import { useRouter } from "next/navigation"; | ||
|
||
const LoginLogoutButton = () => { | ||
const session = useSession(); | ||
const isAuthenticated = | ||
session.status !== "loading" && session.status === "authenticated"; | ||
|
||
const router = useRouter(); | ||
|
||
return ( | ||
<DropdownMenuItem | ||
onClick={() => (isAuthenticated ? signOut() : router.push("/login"))} | ||
> | ||
{isAuthenticated ? "Logout" : "Login"} | ||
</DropdownMenuItem> | ||
); | ||
}; | ||
|
||
export default LoginLogoutButton; |
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,41 @@ | ||
"use client"; | ||
|
||
import { signIn } from "next-auth/react"; | ||
import Image from "next/image"; | ||
|
||
import { Button } from "~/components/ui/button"; | ||
|
||
export function LoginScreen() { | ||
return ( | ||
<div className="w-full lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px]"> | ||
<div className="flex items-center justify-center py-12"> | ||
<div className="mx-auto grid w-[350px] gap-6"> | ||
<div className="grid gap-2 text-center"> | ||
<h1 className="text-3xl font-bold">Login</h1> | ||
<p className="text-balance text-muted-foreground"> | ||
Authenticate with a common provider | ||
</p> | ||
</div> | ||
<div className="grid gap-4"> | ||
<Button | ||
onClick={() => signIn("discord", { callbackUrl: "/" })} | ||
variant="outline" | ||
className="w-full" | ||
> | ||
Login with Discord | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="hidden bg-muted lg:block"> | ||
<Image | ||
src="/placeholder.svg" | ||
alt="Image" | ||
width="1920" | ||
height="1080" | ||
className="h-full w-full object-cover dark:brightness-[0.2] dark:grayscale" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.