mirror of
https://github.com/sasjs/server.git
synced 2025-12-11 19:44:35 +00:00
fix: show permission component only in server mode
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import * as React from 'react'
|
import React, { useState, useContext } from 'react'
|
||||||
|
|
||||||
import { Box, Paper, Tab, styled } from '@mui/material'
|
import { Box, Paper, Tab, styled } from '@mui/material'
|
||||||
import TabContext from '@mui/lab/TabContext'
|
import TabContext from '@mui/lab/TabContext'
|
||||||
@@ -8,6 +8,8 @@ import TabPanel from '@mui/lab/TabPanel'
|
|||||||
import Permission from './permission'
|
import Permission from './permission'
|
||||||
import Profile from './profile'
|
import Profile from './profile'
|
||||||
|
|
||||||
|
import { AppContext, ModeType } from '../../context/appContext'
|
||||||
|
|
||||||
const StyledTab = styled(Tab)({
|
const StyledTab = styled(Tab)({
|
||||||
background: 'black',
|
background: 'black',
|
||||||
margin: '0 5px 5px 0'
|
margin: '0 5px 5px 0'
|
||||||
@@ -18,7 +20,8 @@ const StyledTabpanel = styled(TabPanel)({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const Settings = () => {
|
const Settings = () => {
|
||||||
const [value, setValue] = React.useState('profile')
|
const appContext = useContext(AppContext)
|
||||||
|
const [value, setValue] = useState('profile')
|
||||||
|
|
||||||
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
|
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
|
||||||
setValue(newValue)
|
setValue(newValue)
|
||||||
@@ -43,7 +46,9 @@ const Settings = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
>
|
>
|
||||||
<StyledTab label="Profile" value="profile" />
|
<StyledTab label="Profile" value="profile" />
|
||||||
|
{appContext.mode === ModeType.Server && (
|
||||||
<StyledTab label="Permission" value="permission" />
|
<StyledTab label="Permission" value="permission" />
|
||||||
|
)}
|
||||||
</TabList>
|
</TabList>
|
||||||
</Box>
|
</Box>
|
||||||
<StyledTabpanel value="profile">
|
<StyledTabpanel value="profile">
|
||||||
|
|||||||
Reference in New Issue
Block a user