mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 21:27:20 +01:00
Changed Admin tab to Manage.
This commit is contained in:
parent
91e3dff7f5
commit
642aba83e5
55 changed files with 59 additions and 59 deletions
|
|
@ -6,7 +6,7 @@ import { ROLES } from 'lib/constants';
|
|||
import { useContext, useState } from 'react';
|
||||
import { Flexbox, Item, Tabs } from 'react-basics';
|
||||
import TeamLeaveButton from '../../TeamLeaveButton';
|
||||
import TeamAdmin from './TeamAdmin';
|
||||
import TeamManage from './TeamManage';
|
||||
import TeamEditForm from './TeamEditForm';
|
||||
|
||||
export function TeamDetails({ teamId }: { teamId: string }) {
|
||||
|
|
@ -15,7 +15,7 @@ export function TeamDetails({ teamId }: { teamId: string }) {
|
|||
const { user } = useLogin();
|
||||
const [tab, setTab] = useState('details');
|
||||
|
||||
const canEdit = team?.teamUser?.find(
|
||||
const canEdit = !!team?.teamUser?.find(
|
||||
({ userId, role }) => role === ROLES.teamOwner && userId === user.id,
|
||||
);
|
||||
|
||||
|
|
@ -26,10 +26,10 @@ export function TeamDetails({ teamId }: { teamId: string }) {
|
|||
</PageHeader>
|
||||
<Tabs selectedKey={tab} onSelect={(value: any) => setTab(value)} style={{ marginBottom: 30 }}>
|
||||
<Item key="details">{formatMessage(labels.details)}</Item>
|
||||
{canEdit && <Item key="admin">{formatMessage(labels.admin)}</Item>}
|
||||
{canEdit && <Item key="manage">{formatMessage(labels.manage)}</Item>}
|
||||
</Tabs>
|
||||
{tab === 'details' && <TeamEditForm teamId={teamId} allowEdit={canEdit} />}
|
||||
{tab === 'admin' && <TeamAdmin teamId={teamId} />}
|
||||
{tab === 'manage' && <TeamManage teamId={teamId} />}
|
||||
</Flexbox>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { useRouter } from 'next/navigation';
|
|||
import { ActionForm, Button, Modal, ModalTrigger } from 'react-basics';
|
||||
import TeamDeleteForm from './TeamDeleteForm';
|
||||
|
||||
export function TeamAdmin({ teamId }: { teamId: string }) {
|
||||
export function TeamManage({ teamId }: { teamId: string }) {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const router = useRouter();
|
||||
const { touch } = useModified();
|
||||
|
|
@ -30,4 +30,4 @@ export function TeamAdmin({ teamId }: { teamId: string }) {
|
|||
);
|
||||
}
|
||||
|
||||
export default TeamAdmin;
|
||||
export default TeamManage;
|
||||
Loading…
Add table
Add a link
Reference in a new issue