1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

#23 added lab disabling switch

This commit is contained in:
Fedor Katurov 2021-03-17 11:07:26 +07:00
parent 2d0638d1fd
commit e38090c755
3 changed files with 5 additions and 15 deletions

View file

@ -6,25 +6,14 @@ import { Button } from '~/components/input/Button';
interface IProps extends IEditorComponentProps {} interface IProps extends IEditorComponentProps {}
const EditorPublicSwitch: FC<IProps> = ({ data, setData }) => { const EditorPublicSwitch: FC<IProps> = ({ data, setData }) => {
const tooltip = useRef<HTMLDivElement>(null);
const onChange = useCallback(() => setData({ ...data, is_promoted: !data.is_promoted }), [ const onChange = useCallback(() => setData({ ...data, is_promoted: !data.is_promoted }), [
data, data,
setData, setData,
]); ]);
const pop = usePopper(tooltip?.current?.parentElement, tooltip.current, { if (process.env.REACT_APP_LAB_ENABLED !== '1') {
placement: 'bottom', return null;
modifiers: [ }
{
name: 'offset',
options: {
offset: [0, 4],
},
},
],
});
useEffect(() => console.log(pop), [pop]);
return ( return (
<Button <Button

View file

@ -89,7 +89,7 @@ const HeaderUnconnected: FC<IProps> = memo(
ФЛОУ ФЛОУ
</Link> </Link>
{is_user && ( {is_user && process.env.REACT_APP_LAB_ENABLED === '1' && (
<Link <Link
className={classNames(styles.item, { [styles.is_active]: pathname === URLS.BASE })} className={classNames(styles.item, { [styles.is_active]: pathname === URLS.BASE })}
to={URLS.LAB} to={URLS.LAB}

View file

@ -3,5 +3,6 @@ declare namespace NodeJS {
interface ProcessEnv { interface ProcessEnv {
readonly REACT_APP_API_URL: string; readonly REACT_APP_API_URL: string;
readonly REACT_APP_REMOTE_CURRENT: string; readonly REACT_APP_REMOTE_CURRENT: string;
readonly REACT_APP_LAB_ENABLED: string;
} }
} }