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 {}
const EditorPublicSwitch: FC<IProps> = ({ data, setData }) => {
const tooltip = useRef<HTMLDivElement>(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 (
<Button

View file

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

View file

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