fix(ui): drop useLocalStore from modals

This commit is contained in:
Łukasz Mierzwa
2020-06-05 16:14:55 +01:00
committed by Łukasz Mierzwa
parent c15b3afb78
commit ca0a0b3077
7 changed files with 71 additions and 110 deletions

View File

@@ -1,7 +1,7 @@
import React from "react";
import React, { useState } from "react";
import PropTypes from "prop-types";
import { observer, useLocalStore } from "mobx-react";
import { observer } from "mobx-react";
import { AlertStore } from "Stores/AlertStore";
import { TooltipWrapper } from "Components/TooltipWrapper";
@@ -100,12 +100,7 @@ const NothingToShow = () => (
);
const OverviewModalContent = observer(({ alertStore, onHide }) => {
const allLabels = useLocalStore(() => ({
show: false,
toggle() {
this.show = !this.show;
},
}));
const [showAllLabels, setShowAllLabels] = useState(false);
return (
<React.Fragment>
<div className="modal-header">
@@ -120,8 +115,8 @@ const OverviewModalContent = observer(({ alertStore, onHide }) => {
) : (
<LabelsTable
alertStore={alertStore}
showAllLabels={allLabels.show}
toggleAllLabels={allLabels.toggle}
showAllLabels={showAllLabels}
toggleAllLabels={() => setShowAllLabels(!showAllLabels)}
/>
)}
</div>