From e38090c7554b60d31ceb190446c255a120906db9 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Wed, 17 Mar 2021 11:07:26 +0700 Subject: [PATCH] #23 added lab disabling switch --- .../editors/EditorPublicSwitch/index.tsx | 17 +++-------------- src/components/main/Header/index.tsx | 2 +- src/react-app-env.d.ts | 1 + 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/components/editors/EditorPublicSwitch/index.tsx b/src/components/editors/EditorPublicSwitch/index.tsx index be6feed0..c654a559 100644 --- a/src/components/editors/EditorPublicSwitch/index.tsx +++ b/src/components/editors/EditorPublicSwitch/index.tsx @@ -6,25 +6,14 @@ import { Button } from '~/components/input/Button'; interface IProps extends IEditorComponentProps {} const EditorPublicSwitch: FC = ({ data, setData }) => { - const tooltip = useRef(null); const onChange = useCallback(() => setData({ ...data, is_promoted: !data.is_promoted }), [ data, setData, ]); - const pop = usePopper(tooltip?.current?.parentElement, tooltip.current, { - placement: 'bottom', - modifiers: [ - { - name: 'offset', - options: { - offset: [0, 4], - }, - }, - ], - }); - - useEffect(() => console.log(pop), [pop]); + if (process.env.REACT_APP_LAB_ENABLED !== '1') { + return null; + } return (