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:
parent
2d0638d1fd
commit
e38090c755
3 changed files with 5 additions and 15 deletions
|
@ -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
|
||||||
|
|
|
@ -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}
|
||||||
|
|
1
src/react-app-env.d.ts
vendored
1
src/react-app-env.d.ts
vendored
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue