Skip to content

Commit

Permalink
removed observer code that wasnt needed
Browse files Browse the repository at this point in the history
  • Loading branch information
scrummish committed Mar 14, 2024
1 parent 1737d94 commit f6089c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { ConfigTab, DetailsTab, GraphTab } from "./tabs";
import useMediaQuery from "@mui/material/useMediaQuery";
import React from "react";
import { useLayout } from "../../layout";
import { observer } from "mobx-react";

function a11yProps(id) {
return {
Expand All @@ -19,7 +18,7 @@ function a11yProps(id) {
};
}

export const ActiveLayerDetails = observer(({ viewState, terria }) => {
export const ActiveLayerDetails = ({ viewState, terria }) => {
const { activatedLayer, currentTabIndex, setCurrentTabIndex, chartItems } =
useLayers();
const { drawerIsOpen } = useLayout();
Expand Down Expand Up @@ -111,4 +110,4 @@ export const ActiveLayerDetails = observer(({ viewState, terria }) => {
</Box>
</Stack>
);
});
};
5 changes: 2 additions & 3 deletions lib/custom-ui/context/layers-context.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { createContext, useContext, useMemo, useState } from "react";
import PropTypes from "prop-types";
import { observer } from "mobx-react";

export const LayersContext = createContext({});

export const useLayers = () => useContext(LayersContext);

export const LayersProvider = observer(({ children }) => {
export const LayersProvider = ({ children }) => {
const [currentTabIndex, setCurrentTabIndex] = useState(0);
const [layers, setLayers] = useState([{ name: "default" }]);
const [activeLayerId, setActiveLayerId] = useState(null);
Expand Down Expand Up @@ -153,7 +152,7 @@ export const LayersProvider = observer(({ children }) => {
{children}
</LayersContext.Provider>
);
});
};

LayersProvider.propTypes = {
children: PropTypes.node
Expand Down

0 comments on commit f6089c6

Please sign in to comment.