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

replaced div with button

This commit is contained in:
Fedor Katurov 2021-03-05 17:50:28 +07:00
parent 44bbc4cd4c
commit 40af254e5c
3 changed files with 19 additions and 16 deletions

View file

@ -1,9 +1,7 @@
import React, { FC, useCallback, useEffect, useRef } from 'react';
import styles from './styles.module.scss';
import { Icon } from '~/components/input/Icon';
import { IEditorComponentProps } from '~/redux/node/types';
import classNames from 'classnames';
import { usePopper } from 'react-popper';
import { Button } from '~/components/input/Button';
interface IProps extends IEditorComponentProps {}
@ -29,20 +27,19 @@ const EditorPublicSwitch: FC<IProps> = ({ data, setData }) => {
useEffect(() => console.log(pop), [pop]);
return (
<div
className={classNames(styles.wrap, { [styles.promoted]: data.is_promoted })}
onClick={onChange}
>
<div className={styles.tooltip} ref={tooltip}>
{data.is_promoted
<Button
color={data.is_promoted ? 'primary' : 'secondary'}
type="button"
iconLeft={data.is_promoted ? 'waves' : 'lab'}
size="giant"
label={
data.is_promoted
? 'Доступно всем на главной странице'
: 'Видно только сотрудникам в лаборатории'}
</div>
<div className={styles.icon}>
{data.is_promoted ? <Icon size={24} icon="waves" /> : <Icon size={24} icon="lab" />}
</div>
</div>
: 'Видно только сотрудникам в лаборатории'
}
onClick={onChange}
round
/>
);
};