From 152f96f0af8d42e83efb3c4ba4cdc6ef5b79fe15 Mon Sep 17 00:00:00 2001 From: Aidan Date: Wed, 9 Apr 2025 01:11:28 -0400 Subject: [PATCH] feat: add login button animation, add donation env var+button, ui tweaks, session checking in account links card --- app/account/login/page.tsx | 48 ++++++++++++++----- app/providers.tsx | 9 ++-- components/cards/dashboard/git/LinkGitea.tsx | 2 +- .../dashboard/overview/LinkedAccounts.tsx | 43 +++++++++++++---- .../cards/dashboard/overview/QuickLinks.tsx | 20 ++++++-- .../cards/dashboard/overview/WelcomeCard.tsx | 2 +- components/pages/dashboard/ServicesTab.tsx | 26 +++++----- docs/reference/env.md | 7 +-- package.json | 1 + 9 files changed, 111 insertions(+), 47 deletions(-) diff --git a/app/account/login/page.tsx b/app/account/login/page.tsx index f779f8a..5412400 100644 --- a/app/account/login/page.tsx +++ b/app/account/login/page.tsx @@ -2,9 +2,10 @@ import Link from "next/link" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle, CardFooter } from "@/components/ui/card" import { auth, signIn } from "@/auth" -import { redirect } from "next/navigation"; +import { redirect } from "next/navigation" import { SiAuthentik } from "react-icons/si" import { UserPlus } from "lucide-react" +import * as motion from "motion/react-client" export default async function Login() { const session = await auth() @@ -27,22 +28,43 @@ export default async function Login() { await signIn("authentik", { redirectTo: "/account/dashboard" }) }} > - + + + {process.env.SIGNUP_ENABLED === "true" ? ( - + + + ) : ( - + + + )} diff --git a/app/providers.tsx b/app/providers.tsx index aeaab0d..fa51c8f 100644 --- a/app/providers.tsx +++ b/app/providers.tsx @@ -2,12 +2,15 @@ import { ThemeProvider } from "next-themes" import type { ReactNode } from "react" +import { SessionProvider } from "next-auth/react" export function Providers({ children }: { children: ReactNode }) { return ( - - {children} - + + + {children} + + ) } diff --git a/components/cards/dashboard/git/LinkGitea.tsx b/components/cards/dashboard/git/LinkGitea.tsx index e085849..3ecdd20 100644 --- a/components/cards/dashboard/git/LinkGitea.tsx +++ b/components/cards/dashboard/git/LinkGitea.tsx @@ -178,7 +178,7 @@ export function LinkGitea({ linked }: { linked: boolean }) { )}

- Unlinking your Gitea account will not delete your Gitea account. You can delete your Gitea account here. + Unlinking your Gitea account will not delete your Gitea account. You can delete your Gitea account here.

{unlinkLoading ? ( + + + ); diff --git a/components/cards/dashboard/overview/WelcomeCard.tsx b/components/cards/dashboard/overview/WelcomeCard.tsx index 7be4c13..a747539 100644 --- a/components/cards/dashboard/overview/WelcomeCard.tsx +++ b/components/cards/dashboard/overview/WelcomeCard.tsx @@ -36,7 +36,7 @@ export const WelcomeCard = () => {

That’s all, have a great day!

- diff --git a/components/pages/dashboard/ServicesTab.tsx b/components/pages/dashboard/ServicesTab.tsx index 1860143..7f6914b 100644 --- a/components/pages/dashboard/ServicesTab.tsx +++ b/components/pages/dashboard/ServicesTab.tsx @@ -1,7 +1,7 @@ import Link from "next/link" import { Mail, Key, ExternalLink } from "lucide-react" import { SiGitea, SiAuthentik } from "react-icons/si"; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" +import { Card, CardFooter, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" export const ServicesTab = () => ( @@ -13,16 +13,16 @@ export const ServicesTab = () => ( Webmail - Send, read, and manage your email account from a web browser! + Send, read, and manage your email account from a web browser! Powered by Roundcube and LibreCloud Mail. - + - + @@ -31,16 +31,16 @@ export const ServicesTab = () => ( Git - Host your repositories and run Actions on a fair usage policy. + Host unlimited repositories and run Actions on our Git server, powered by Gitea. - + - + @@ -49,16 +49,16 @@ export const ServicesTab = () => ( Pass - Securely store your passwords, notes, and 2FA codes with Vaultwarden. + Securely store your passwords, notes, and 2FA codes with Vaultwarden. Data is encrypted at rest. - + - + @@ -69,14 +69,14 @@ export const ServicesTab = () => ( Manage your single-sign-on account for all LibreCloud services. - + - + ) diff --git a/docs/reference/env.md b/docs/reference/env.md index 25f2fe3..41dc97f 100644 --- a/docs/reference/env.md +++ b/docs/reference/env.md @@ -9,9 +9,10 @@ While this will change in the future, we still suggest that provide all the list These are the environment variables which handle how `librecloud/web` functions. With these variables, you can disable entire parts of the dashboard, such as registration. -| Environment Variable | Description | Expected Value | -|----------------------|-----------------------------------------------------------|----------------------------------------| -| SIGNUP_ENABLED | Controls if the signup page and APIs are enabled/disabled | `true` (Enabled) or `false` (Disabled) | +| Environment Variable | Description | Expected Value | +|------------------------|-----------------------------------------------------------|----------------------------------------| +| SIGNUP_ENABLED | Controls if the signup page and APIs are enabled/disabled | `true` (Enabled) or `false` (Disabled) | +| NEXT_PUBLIC_DONATE_URL | Changes the universal donation link for buttons/links | String - `https://...` | ## Authentik diff --git a/package.json b/package.json index 140f972..c72c721 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "clsx": "^2.1.1", "cmdk": "1.0.0", "cookies-next": "^5.1.0", + "framer-motion": "^12.6.3", "geist": "^1.3.1", "js-cookie": "^3.0.5", "lucide-react": "^0.474.0",