feat: add additional details change from user settings

This commit is contained in:
swve 2025-03-29 17:59:12 +01:00
parent dc5ac3039f
commit 5a2732258f
10 changed files with 667 additions and 281 deletions

View file

@ -1,22 +1,17 @@
"use client";
import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";
export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
<html>
<body>
{/* `NextError` is the default Next.js error page component. Its type
definition requires a `statusCode` prop. However, since the App Router
does not expose status codes for errors, we simply pass 0 to render a
generic error message. */}
<NextError statusCode={0} />
<h2>Something went wrong!</h2>
<button onClick={() => reset()}>Try again</button>
</body>
</html>
);

View file

@ -75,8 +75,8 @@ function OrgPage(props: { params: Promise<OrgParams> }) {
}, [params.subpage, params])
return (
<div className="h-full w-full bg-[#f8f8f8]">
<div className="pl-10 pr-10 tracking-tight bg-[#fcfbfc] nice-shadow">
<div className="h-full w-full bg-[#f8f8f8] flex flex-col">
<div className="pl-10 pr-10 tracking-tight bg-[#fcfbfc] nice-shadow flex-shrink-0">
<BreadCrumbs type="org"></BreadCrumbs>
<div className="my-2 py-2">
<div className="w-100 flex flex-col space-y-1">
@ -99,12 +99,13 @@ function OrgPage(props: { params: Promise<OrgParams> }) {
))}
</div>
</div>
<div className="h-6"></div>
<div className="h-6 flex-shrink-0"></div>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.1, type: 'spring', stiffness: 80 }}
className="flex-1 overflow-y-auto"
>
{params.subpage == 'general' ? <OrgEditGeneral /> : ''}
{params.subpage == 'previews' ? <OrgEditImages /> : ''}

View file

@ -69,7 +69,7 @@ function PaymentsPage(props: { params: Promise<PaymentsParams> }) {
return (
<div className="h-screen w-full bg-[#f8f8f8] flex flex-col">
<div className="pl-10 pr-10 tracking-tight bg-[#fcfbfc] z-10 nice-shadow">
<div className="pl-10 pr-10 tracking-tight bg-[#fcfbfc] z-10 nice-shadow flex-shrink-0">
<BreadCrumbs type="payments" />
<div className="my-2 py-2">
<div className="w-100 flex flex-col space-y-1">
@ -102,7 +102,7 @@ function PaymentsPage(props: { params: Promise<PaymentsParams> }) {
/>
</div>
</div>
<div className="h-6"></div>
<div className="h-6 flex-shrink-0"></div>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}

View file

@ -92,8 +92,8 @@ function SettingsPage({ params }: { params: Promise<SettingsParams> }) {
const CurrentComponent = navigationItems.find(item => item.id === subpage)?.component;
return (
<div className="h-full w-full bg-[#f8f8f8]">
<div className="pl-10 pr-10 tracking-tight bg-[#fcfbfc] z-10 nice-shadow">
<div className="h-full w-full bg-[#f8f8f8] flex flex-col">
<div className="pl-10 pr-10 tracking-tight bg-[#fcfbfc] z-10 nice-shadow flex-shrink-0">
<BreadCrumbs
type="user"
last_breadcrumb={session?.user?.username}
@ -109,13 +109,13 @@ function SettingsPage({ params }: { params: Promise<SettingsParams> }) {
orgslug={orgslug}
/>
</div>
<div className="h-6" />
<div className="h-6 flex-shrink-0" />
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.1, type: 'spring', stiffness: 80 }}
className="h-full overflow-y-auto"
className="flex-1 overflow-y-auto"
>
{CurrentComponent && <CurrentComponent />}
</motion.div>

View file

@ -154,7 +154,7 @@ function UsersSettingsPage(props: { params: Promise<SettingsParams> }) {
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.1, type: 'spring', stiffness: 80 }}
className="h-full overflow-y-auto"
className="flex-1 overflow-y-auto"
>
{params.subpage == 'users' ? <OrgUsers /> : ''}
{params.subpage == 'signups' ? <OrgAccess /> : ''}