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

#23 changed toggle colors

This commit is contained in:
Fedor Katurov 2021-03-19 16:26:02 +07:00
commit dddb86c778
6 changed files with 52 additions and 32 deletions

View file

@ -1,7 +1,8 @@
import React, { FC, useCallback, useEffect, useRef } from 'react';
import React, { FC, useCallback } from 'react';
import { IEditorComponentProps } from '~/redux/node/types';
import { usePopper } from 'react-popper';
import { Button } from '~/components/input/Button';
import { Icon } from '~/components/input/Icon';
import styles from './styles.module.scss';
import { Superpower } from '~/components/boris/Superpower';
interface IProps extends IEditorComponentProps {}
@ -15,9 +16,8 @@ const EditorPublicSwitch: FC<IProps> = ({ data, setData }) => {
return (
<Superpower>
<Button
color={data.is_promoted ? 'primary' : 'secondary'}
color={data.is_promoted ? 'primary' : 'lab'}
type="button"
iconLeft={data.is_promoted ? 'waves' : 'lab'}
size="giant"
label={
data.is_promoted
@ -25,8 +25,17 @@ const EditorPublicSwitch: FC<IProps> = ({ data, setData }) => {
: 'Видно только сотрудникам в лаборатории'
}
onClick={onChange}
className={styles.button}
round
/>
>
{data.is_promoted ? (
<Icon icon="waves" size={24} />
) : (
<div className={styles.lab_wrapper}>
<Icon icon="lab" size={24} />
</div>
)}
</Button>
</Superpower>
);
};