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 {}
|
||||
|
||||
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
|
||||
|
|
|
@ -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}
|
||||
|
|
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 {
|
||||
readonly REACT_APP_API_URL: string;
|
||||
readonly REACT_APP_REMOTE_CURRENT: string;
|
||||
readonly REACT_APP_LAB_ENABLED: string;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue