remove unused block
This commit is contained in:
@ -15,7 +15,7 @@ import { Button } from "@fluentui/react-components";
|
|||||||
import { Add12Filled, Dismiss12Filled, Map16Regular } from "@fluentui/react-icons";
|
import { Add12Filled, Dismiss12Filled, Map16Regular } from "@fluentui/react-icons";
|
||||||
|
|
||||||
function MapTest() {
|
function MapTest() {
|
||||||
const { mapTab, currentTab, tabOrder } = useAppStore()
|
const { currentTab, tabOrder } = useAppStore()
|
||||||
const { id } = useMapStore()
|
const { id } = useMapStore()
|
||||||
|
|
||||||
const handleDragEnd = (result: any) => {
|
const handleDragEnd = (result: any) => {
|
||||||
@ -94,44 +94,6 @@ function MapTest() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
|
||||||
<div style={{ height: "100%", width: "100%", position: "relative" }}>
|
|
||||||
<div style={{ display: "flex", flexDirection: "column", height: "100%" }}>
|
|
||||||
<TabList
|
|
||||||
size='small'
|
|
||||||
selectedValue={currentTab}
|
|
||||||
onTabSelect={(_, data) => setCurrentTab(data.value as string)}
|
|
||||||
style={{ borderBottom: '1px solid var(--colorNeutralShadowKey)' }}
|
|
||||||
>
|
|
||||||
{Object.entries(mapTab).map(([key]) => (
|
|
||||||
<Tab key={key} value={key} icon={<Map16Regular />}>
|
|
||||||
{id[key]?.mapLabel ?? `Tab ${key}`}
|
|
||||||
|
|
||||||
<Button style={{ marginLeft: '0.5rem' }} size='small' icon={<Dismiss12Filled />} appearance='subtle' onClick={(e) => {
|
|
||||||
e.stopPropagation()
|
|
||||||
deleteMapTab(key)
|
|
||||||
}} />
|
|
||||||
</Tab>
|
|
||||||
))}
|
|
||||||
|
|
||||||
<Button icon={<Add12Filled />} title="Открыть новую вкладку" appearance='subtle' onClick={() => {
|
|
||||||
const newId = addMapTab();
|
|
||||||
initializeObjectsState(newId, null, null, null, null);
|
|
||||||
initializeMapState(newId);
|
|
||||||
}} />
|
|
||||||
</TabList>
|
|
||||||
|
|
||||||
<div style={{ flexGrow: 1, position: "relative" }}>
|
|
||||||
{Object.entries(mapTab).map(([key]) =>
|
|
||||||
(<div key={key} style={{ height: "100%", position: "relative", display: currentTab === key ? 'unset' : 'none' }}>
|
|
||||||
<MapComponent key={key} id={key} active={currentTab === key} />
|
|
||||||
</div>)
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MapTest;
|
export default MapTest;
|
||||||
|
Reference in New Issue
Block a user