Update admin and marketing layouts, add new admin components

Refined both admin and marketing layouts for a clearer design. Newly added components for the admin page include admin-account-page, admin-members-table and admin-memberships-table. Also included in this update are route renaming, minor text edits and corrections in the code.
This commit is contained in:
giancarlo
2024-04-08 20:00:52 +08:00
parent 767e2f21b5
commit 13308194ec
18 changed files with 426 additions and 103 deletions

View File

@@ -1,6 +1,6 @@
import { ServerDataLoader } from '@makerkit/data-loader-supabase-nextjs';
import { AccountsTable } from '@kit/admin/components/accounts-table';
import { AdminAccountsTable } from '@kit/admin/components/admin-accounts-table';
import { AdminGuard } from '@kit/admin/components/admin-guard';
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
import { PageBody, PageHeader } from '@kit/ui/page';
@@ -8,8 +8,13 @@ import { PageBody, PageHeader } from '@kit/ui/page';
interface SearchParams {
page?: string;
account_type?: 'all' | 'team' | 'personal';
query?: string;
}
export const metadata = {
title: `Accounts`,
};
function AccountsPage({ searchParams }: { searchParams: SearchParams }) {
const client = getSupabaseServerComponentClient({
admin: true,
@@ -34,7 +39,7 @@ function AccountsPage({ searchParams }: { searchParams: SearchParams }) {
>
{({ data, page, pageSize, pageCount }) => {
return (
<AccountsTable
<AdminAccountsTable
page={page}
pageSize={pageSize}
pageCount={pageCount}
@@ -54,7 +59,8 @@ function AccountsPage({ searchParams }: { searchParams: SearchParams }) {
function getFilters(params: SearchParams) {
const filters: {
[key: string]: {
eq: boolean;
eq?: boolean | string;
like?: string;
};
} = {};
@@ -64,6 +70,12 @@ function getFilters(params: SearchParams) {
};
}
if (params.query) {
filters.name = {
like: `%${params.query}%`,
};
}
return filters;
}