Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: user profile dropdown & settings #12

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
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
19 changes: 13 additions & 6 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ await import("./src/env.js");

/** @type {import("next").NextConfig} */
const config = {
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
images: {
remotePatterns: [
{
hostname: "img.clerk.com",
},
],
},
};

export default config;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"@clerk/nextjs": "^5.1.5",
"@clerk/themes": "^2.1.9",
"@hookform/resolvers": "^3.6.0",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
Expand Down
20 changes: 16 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { db } from "@/server/db";
import { users } from "@/server/db/schema";
import { currentUser } from "@clerk/nextjs/server";

export async function setFullUserName(name: string, userId: string) {
try {
Expand All @@ -22,16 +23,19 @@ export async function setPaperlessURL(url: string, userId: string) {
.onConflictDoUpdate({ target: users.userId, set: { paperlessURL: url } });
} catch {
throw new Error("Database error");
}
}
}

export async function setPaperlessToken(token: string, userId: string) {
try {
await db
.insert(users)
.values({ paperlessToken: token, userId: userId })
.onConflictDoUpdate({ target: users.userId, set: { paperlessToken: token } });
.onConflictDoUpdate({
target: users.userId,
set: { paperlessToken: token },
});
} catch {
throw new Error("Database error");
}
}
}
}
7 changes: 6 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TopNav } from "@/components/topnav";
import { ClerkProvider } from "@clerk/nextjs";
import { ThemeProvider } from "@/components/theme-provider";
import { cn } from "@/lib/utils";
import { dark } from "@clerk/themes";

export const metadata = {
title: "Homelab Connector",
Expand All @@ -18,7 +19,11 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<ClerkProvider>
<ClerkProvider
appearance={{
baseTheme: dark,
}}
>
<html
suppressHydrationWarning
lang="en"
Expand Down
Loading
Loading