mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 12:36:24 +08:00
feat:add isOwner
This commit is contained in:
@@ -60,7 +60,7 @@ const tabMap: {
|
||||
];
|
||||
|
||||
const WorkspaceSetting = () => {
|
||||
const { currentWorkspace } = useAppState();
|
||||
const { currentWorkspace, isOwner } = useAppState();
|
||||
|
||||
const [activeTab, setActiveTab] = useState<TabNames>(tabMap[0].name);
|
||||
const handleTabChange = (tab: TabNames) => {
|
||||
@@ -70,7 +70,20 @@ const WorkspaceSetting = () => {
|
||||
const activeTabPanelRender = tabMap.find(
|
||||
tab => tab.name === activeTab
|
||||
)?.panelRender;
|
||||
|
||||
let tableArr: {
|
||||
name: TabNames;
|
||||
icon: ReactNode;
|
||||
panelRender: (workspace: WorkspaceUnit) => ReactNode;
|
||||
}[] = tabMap;
|
||||
if (!isOwner) {
|
||||
tableArr = [
|
||||
{
|
||||
name: 'general',
|
||||
icon: <EditIcon />,
|
||||
panelRender: workspace => <GeneralPage workspace={workspace} />,
|
||||
},
|
||||
];
|
||||
}
|
||||
return (
|
||||
<StyledSettingContainer>
|
||||
<StyledSettingSidebar>
|
||||
@@ -78,7 +91,7 @@ const WorkspaceSetting = () => {
|
||||
Workspace Settings
|
||||
</StyledSettingSidebarHeader>
|
||||
<StyledSettingTabContainer>
|
||||
{tabMap.map(({ icon, name }) => {
|
||||
{tableArr.map(({ icon, name }) => {
|
||||
return (
|
||||
<WorkspaceSettingTagItem
|
||||
key={name}
|
||||
|
||||
Reference in New Issue
Block a user