generated from RENCI/react-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
69 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React, { useCallback } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Tab, TabList, TabPanel, Tabs } from '@mui/joy'; | ||
import { | ||
Palette as ColorIcon, | ||
DataObject as DetailsIcon, | ||
DeleteForever as RemoveIcon, | ||
} from '@mui/icons-material'; | ||
|
||
export const LayerTabs = ({ layer = {} }) => { | ||
const DetailsPanel = useCallback(() => ( | ||
<TabPanel value={ 0 } component="pre" sx={{ | ||
fontSize: '75%', | ||
color: 'text.primary', | ||
fontFamily: 'monospace', | ||
backgroundColor: 'transparent', | ||
overflowX: 'auto', | ||
m: 0, | ||
}}> | ||
{ JSON.stringify(layer.properties, null, 2) } | ||
</TabPanel> | ||
), []); | ||
|
||
const ColorControlPanel = useCallback(() => ( | ||
<TabPanel value={ 1 }> | ||
ColorRamp & Opacity | ||
</TabPanel> | ||
), []); | ||
|
||
const RemoveLayerPanel = useCallback(() => ( | ||
<TabPanel value={ 2 }> | ||
REMOVE LAYER: Are you sure? | ||
<br /> | ||
<br /> | ||
<br /> | ||
[CONFIRM BUTTON] | ||
</TabPanel> | ||
), []); | ||
|
||
return ( | ||
<Tabs size="sm" aria-label="Layer tabs" defaultValue={ 0 } orientation="vertical" sx={{ | ||
height: '200px', | ||
overflow: 'auto', | ||
}}> | ||
<TabList> | ||
<Tab><DetailsIcon fontSize="small" /></Tab> | ||
<Tab><ColorIcon fontSize="small" /></Tab> | ||
<Tab><RemoveIcon fontSize="small" /></Tab> | ||
</TabList> | ||
<DetailsPanel /> | ||
<ColorControlPanel /> | ||
<RemoveLayerPanel /> | ||
</Tabs> | ||
); | ||
}; | ||
|
||
LayerTabs.propTypes = { | ||
layer: PropTypes.object.isRequired, | ||
}; |