mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Starting working on settings Page.
This commit is contained in:
@@ -6,13 +6,13 @@ import {prisma} from "@/prisma";
|
||||
export default async function Layout({children}: { children: React.ReactNode }) {
|
||||
|
||||
const user = await currentUser()
|
||||
const userInfo = await prisma.user.findUnique({
|
||||
where: {
|
||||
email: user.email
|
||||
}
|
||||
})
|
||||
|
||||
if(userInfo){
|
||||
// const userInfo = await prisma.user.findUnique({
|
||||
// where: {
|
||||
// email: user?.email
|
||||
// }
|
||||
// })
|
||||
//
|
||||
if(user){
|
||||
redirect('/dashboard')
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,24 @@
|
||||
import {PageParams} from "@/types/next";
|
||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||
import {Page, PageContent, PageDescription, PageHeader, PageTitle} from "@/features/layout/page";
|
||||
import {prisma} from "@/prisma";
|
||||
import {requiredCurrentUser} from "@/auth/current-user";
|
||||
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
|
||||
import {usersColumns} from "@/components/wrappers/Dashboard/Settings/SettingsTabs/columns-users";
|
||||
import {SettingsTabs} from "@/components/wrappers/Dashboard/Settings/SettingsTabs/SettingsTabs";
|
||||
|
||||
|
||||
export default async function RoutePage(props: PageParams<{}>) {
|
||||
const user = await requiredCurrentUser()
|
||||
|
||||
|
||||
const users = await prisma.user.findMany({
|
||||
where:{
|
||||
id: {
|
||||
not: user.id
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return (
|
||||
<Page>
|
||||
@@ -11,8 +27,11 @@ export default async function RoutePage(props: PageParams<{}>) {
|
||||
Settings
|
||||
</PageTitle>
|
||||
</PageHeader>
|
||||
<PageDescription>
|
||||
Manage your Portabase settings
|
||||
</PageDescription>
|
||||
<PageContent>
|
||||
content
|
||||
<SettingsTabs users={users}/>
|
||||
</PageContent>
|
||||
</Page>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user