Skip to content

Commit f21f1ed

Browse files
committed
feat: update organization panel icons
1 parent 4748883 commit f21f1ed

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

apps/nextjs-app/src/features/app/blocks/space/space-side-bar/SpaceSideBar.tsx

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Admin, Database, Home, Trash2 } from '@teable/icons';
2-
import { useOrganization } from '@teable/sdk/hooks';
1+
import { Admin, Database, Home, Settings, Trash2 } from '@teable/icons';
2+
import { useSession } from '@teable/sdk/hooks';
33
import { cn } from '@teable/ui-lib/shadcn';
44
import { Button } from '@teable/ui-lib/shadcn/ui/button';
55
import Link from 'next/link';
@@ -13,7 +13,8 @@ export const SpaceSideBar = (props: { isAdmin?: boolean | null }) => {
1313
const { isAdmin } = props;
1414
const router = useRouter();
1515
const { t } = useTranslation(spaceConfig.i18nNamespaces);
16-
const { organization } = useOrganization();
16+
const { user } = useSession();
17+
const organization = user?.organization;
1718

1819
const pageRoutes: {
1920
href: string;
@@ -31,17 +32,17 @@ export const SpaceSideBar = (props: { isAdmin?: boolean | null }) => {
3132
text: t('space:sharedBase.title'),
3233
Icon: Database,
3334
},
34-
{
35-
href: '/admin/setting',
36-
text: t('noun.adminPanel'),
37-
Icon: Admin,
38-
hidden: !isAdmin,
39-
},
4035
{
4136
href: `/enterprise/${organization?.id}`,
4237
text: t('noun.organizationPanel'),
4338
Icon: Admin,
44-
hidden: !organization?.isAdmin,
39+
hidden: !organization,
40+
},
41+
{
42+
href: '/admin/setting',
43+
text: t('noun.adminPanel'),
44+
Icon: Settings,
45+
hidden: !isAdmin,
4546
},
4647
{
4748
href: '/space/trash',

0 commit comments

Comments
 (0)