Skip to content

Commit a31d81d

Browse files
feedback
1 parent 99fd793 commit a31d81d

4 files changed

Lines changed: 40 additions & 4 deletions

File tree

packages/web/src/app/components/navigationMenu.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ import logoDark from "../../../public/sb_logo_dark_small.png";
77
import logoLight from "../../../public/sb_logo_light_small.png";
88
import { ProfilePicture } from "./profilePicture";
99
import { signOut } from "@/auth";
10+
import { SettingsDropdown } from "./settingsDropdown";
11+
import { GitHubLogoIcon, DiscordLogoIcon } from "@radix-ui/react-icons";
12+
import { redirect } from "next/navigation";
13+
14+
const SOURCEBOT_DISCORD_URL = "https://discord.gg/6Fhp27x7Pb";
15+
const SOURCEBOT_GITHUB_URL = "https://github.com/sourcebot-dev/sourcebot";
1016

1117
export const NavigationMenu = async () => {
1218

@@ -53,13 +59,43 @@ export const NavigationMenu = async () => {
5359
</div>
5460

5561
<div className="flex flex-row items-center gap-2">
62+
<form
63+
action={async () => {
64+
"use server";
65+
redirect(SOURCEBOT_DISCORD_URL);
66+
}}
67+
>
68+
<Button
69+
variant="outline"
70+
size="icon"
71+
type="submit"
72+
>
73+
<DiscordLogoIcon className="w-4 h-4" />
74+
</Button>
75+
</form>
76+
<form
77+
action={async () => {
78+
"use server";
79+
redirect(SOURCEBOT_GITHUB_URL);
80+
}}
81+
>
82+
<Button
83+
variant="outline"
84+
size="icon"
85+
type="submit"
86+
>
87+
<GitHubLogoIcon className="w-4 h-4" />
88+
</Button>
89+
</form>
90+
<SettingsDropdown />
5691
<form
5792
action={async () => {
5893
"use server";
5994
await signOut();
6095
}}
6196
>
6297
<Button
98+
type="submit"
6399
variant="outline"
64100
size="default"
65101
>

packages/web/src/app/login/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default async function Login(props: {
7373
<Image
7474
src={logo}
7575
alt={provider.name}
76-
className="w-5 h-5 invert mr-2"
76+
className="w-5 h-5 invert dark:invert-0 mr-2"
7777
/>
7878
)}
7979
Sign in with {provider.name}

packages/web/src/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import GitHub from "next-auth/providers/github"
33
import { PrismaAdapter } from "@auth/prisma-adapter"
44
import { prisma } from "@/prisma";
55
import type { Provider } from "next-auth/providers"
6-
import { AUTH_GITHUB_CLIENT_ID, AUTH_GITHUB_CLIENT_SECRET, AUTH_JS_SECRET } from "./lib/environment";
6+
import { AUTH_GITHUB_CLIENT_ID, AUTH_GITHUB_CLIENT_SECRET, AUTH_SECRET } from "./lib/environment";
77

88
const providers: Provider[] = [
99
GitHub({
@@ -26,7 +26,7 @@ export const providerMap = providers
2626

2727

2828
export const { handlers, signIn, signOut, auth } = NextAuth({
29-
secret: AUTH_JS_SECRET,
29+
secret: AUTH_SECRET,
3030
adapter: PrismaAdapter(prisma),
3131
session: {
3232
strategy: "jwt",

packages/web/src/lib/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ export const SHARD_MAX_MATCH_COUNT = getEnvNumber(process.env.SHARD_MAX_MATCH_CO
77
export const TOTAL_MAX_MATCH_COUNT = getEnvNumber(process.env.TOTAL_MAX_MATCH_COUNT, 100000);
88
export const NODE_ENV = process.env.NODE_ENV;
99

10-
export const AUTH_JS_SECRET = getEnv(process.env.AUTH_JS_SECRET); // Generate using `npx auth secret`
10+
export const AUTH_SECRET = getEnv(process.env.AUTH_SECRET); // Generate using `npx auth secret`
1111
export const AUTH_GITHUB_CLIENT_ID = getEnv(process.env.AUTH_GITHUB_CLIENT_ID);
1212
export const AUTH_GITHUB_CLIENT_SECRET = getEnv(process.env.AUTH_GITHUB_CLIENT_SECRET);

0 commit comments

Comments
 (0)