mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-03 00:26:41 +07:00
added hoverable hints
This commit is contained in:
parent
c888f13c60
commit
f5ca735049
7 changed files with 278 additions and 29 deletions
30
src/components/common/Hoverable/index.tsx
Normal file
30
src/components/common/Hoverable/index.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
import React, { FC, ReactNode } from 'react';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { DivProps } from '~/utils/types';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface HoverableProps extends DivProps {
|
||||
icon?: ReactNode;
|
||||
}
|
||||
|
||||
const Hoverable: FC<HoverableProps> = ({
|
||||
children,
|
||||
className,
|
||||
icon,
|
||||
...rest
|
||||
}) => (
|
||||
<div
|
||||
{...rest}
|
||||
className={classNames(styles.hoverable, className, {
|
||||
[styles.with_icon]: !!icon,
|
||||
})}
|
||||
>
|
||||
{icon && <div className={styles.icon}>{icon}</div>}
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
|
||||
export { Hoverable };
|
Loading…
Add table
Add a link
Reference in a new issue