diff --git a/src/app/[locale]/(console)/organisation/[organisation]/(container)/events/page.tsx b/src/app/[locale]/(console)/organisation/[organisation]/(container)/events/page.tsx index 02590ef..4bc4ab8 100644 --- a/src/app/[locale]/(console)/organisation/[organisation]/(container)/events/page.tsx +++ b/src/app/[locale]/(console)/organisation/[organisation]/(container)/events/page.tsx @@ -44,7 +44,7 @@ import { useParams } from 'next/navigation'; import React, { useState } from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import { TinyOrgName } from '../../TinyOrgName'; +import { PageTitle } from '../../components/PageTitle'; export default function Account() { const params = useParams(); @@ -73,18 +73,9 @@ export default function Account() { return (
-
- -
-

- {t('title')} -

- -
-
+ + +
diff --git a/src/app/[locale]/(console)/organisation/[organisation]/(container)/members/page.tsx b/src/app/[locale]/(console)/organisation/[organisation]/(container)/members/page.tsx index 0de26de..123688d 100644 --- a/src/app/[locale]/(console)/organisation/[organisation]/(container)/members/page.tsx +++ b/src/app/[locale]/(console)/organisation/[organisation]/(container)/members/page.tsx @@ -33,7 +33,7 @@ import { useTranslations } from 'next-intl'; import { useParams } from 'next/navigation'; import React, { useState } from 'react'; import { z } from 'zod'; -import { TinyOrgName } from '../../TinyOrgName'; +import { PageTitle } from '../../components/PageTitle'; export default function Account() { const params = useParams(); @@ -43,8 +43,9 @@ export default function Account() { const { isPending, data, refetch } = useData(slug); const t = useTranslations('pages.console.organisation.members'); - const organisation = data?.organisation; - const invited_members = data?.invited_members; + if (!data?.organisation) return ; + const organisation = data.organisation; + const invited_members = data.invited_members; // Split the managers out per organisation, // store managers for the current org under the '__' key @@ -66,18 +67,17 @@ export default function Account() { ) : organisation ? (
-
- -
-

{t('title')}

- {organisation.can_manage && ( - - )} -
-
+ + {organisation.can_manage && ( + + )} +
{Object.entries(perOrg).map(([key, managers]) => ( ; + const nested = data.nested ?? []; + const organisation = data.organisation; return (
-

{t('title')}

+ -
- -
- -

{t('title')}

-
-
+
diff --git a/src/app/[locale]/(console)/organisation/[organisation]/(container)/settings/page.tsx b/src/app/[locale]/(console)/organisation/[organisation]/(container)/settings/page.tsx index 2cb1536..fd9761b 100644 --- a/src/app/[locale]/(console)/organisation/[organisation]/(container)/settings/page.tsx +++ b/src/app/[locale]/(console)/organisation/[organisation]/(container)/settings/page.tsx @@ -23,7 +23,7 @@ import { useParams } from 'next/navigation'; import React from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import { TinyOrgName } from '../../TinyOrgName'; +import { PageTitle } from '../../components/PageTitle'; export default function Account() { const params = useParams(); @@ -47,10 +47,7 @@ export default function Account() { ) : organisation ? (
-
- -

{t('title')}

-
+
diff --git a/src/app/[locale]/(console)/organisation/[organisation]/components/PageTitle.tsx b/src/app/[locale]/(console)/organisation/[organisation]/components/PageTitle.tsx new file mode 100644 index 0000000..2cd4d6e --- /dev/null +++ b/src/app/[locale]/(console)/organisation/[organisation]/components/PageTitle.tsx @@ -0,0 +1,35 @@ +import { Avatar } from '@/components/cards/avatar'; +import { cn } from '@/lib/utils'; +import { Organisation } from '@/schema/resources/organisation'; +import React, { ReactNode } from 'react'; +import { TinyOrgName } from './TinyOrgName'; + +export function PageTitle({ + organisation, + title, + children, + className, +}: { + organisation: Organisation; + title: string; + children?: ReactNode; + className?: string; +}) { + return ( +
+
+ +
+ +

{title}

+
+
+ {children} +
+ ); +} diff --git a/src/app/[locale]/(console)/organisation/[organisation]/TinyOrgName.tsx b/src/app/[locale]/(console)/organisation/[organisation]/components/TinyOrgName.tsx similarity index 100% rename from src/app/[locale]/(console)/organisation/[organisation]/TinyOrgName.tsx rename to src/app/[locale]/(console)/organisation/[organisation]/components/TinyOrgName.tsx diff --git a/src/app/[locale]/(console)/organisation/[organisation]/events/[id]/[subpage]/page.tsx b/src/app/[locale]/(console)/organisation/[organisation]/events/[id]/[subpage]/page.tsx index 1b3e6b9..8427729 100644 --- a/src/app/[locale]/(console)/organisation/[organisation]/events/[id]/[subpage]/page.tsx +++ b/src/app/[locale]/(console)/organisation/[organisation]/events/[id]/[subpage]/page.tsx @@ -15,7 +15,7 @@ import { useTranslations } from 'next-intl'; import { useParams } from 'next/navigation'; import React from 'react'; import { z } from 'zod'; -import { TinyOrgName } from '../../../TinyOrgName'; +import { TinyOrgName } from '../../../components/TinyOrgName'; import { EventOverviewTab } from './overview'; import { EventSettingsTab } from './settings'; diff --git a/src/locales/en/pages.json b/src/locales/en/pages.json index 8c645f2..05f4aa3 100644 --- a/src/locales/en/pages.json +++ b/src/locales/en/pages.json @@ -237,7 +237,12 @@ }, "organisations": { "title": "Organisations", - "not_found": "Organisation not found" + "not_found": "Organisation not found", + "table": { + "caption": { + "count": "Count" + } + } } } }, diff --git a/src/locales/nl/pages.json b/src/locales/nl/pages.json index 3430ab6..ee854f0 100644 --- a/src/locales/nl/pages.json +++ b/src/locales/nl/pages.json @@ -237,7 +237,12 @@ }, "organisations": { "not_found": "Organisatie niet gevonden", - "title": "Organisaties" + "title": "Organisaties", + "table": { + "caption": { + "count": "Aantal" + } + } } } },