mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added node edit menu
This commit is contained in:
parent
f185914c7c
commit
74f4c7562b
16 changed files with 320 additions and 175 deletions
23
src/components/menu/MenuItemWithIcon/index.tsx
Normal file
23
src/components/menu/MenuItemWithIcon/index.tsx
Normal file
|
@ -0,0 +1,23 @@
|
|||
import React, { FC } from 'react';
|
||||
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
|
||||
import styles from './styles.module.scss';
|
||||
|
||||
interface MenuItemWithIconProps {
|
||||
children: string;
|
||||
icon: string;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
const MenuItemWithIcon: FC<MenuItemWithIconProps> = ({ children, icon, onClick }) => (
|
||||
<button className={styles.item} onClick={onClick}>
|
||||
<div className={styles.icon}>
|
||||
<Icon icon={icon} size={20} />
|
||||
</div>
|
||||
|
||||
<div className={styles.text}>{children}</div>
|
||||
</button>
|
||||
);
|
||||
|
||||
export { MenuItemWithIcon };
|
29
src/components/menu/MenuItemWithIcon/styles.module.scss
Normal file
29
src/components/menu/MenuItemWithIcon/styles.module.scss
Normal file
|
@ -0,0 +1,29 @@
|
|||
@import "src/styles/variables";
|
||||
|
||||
.item {
|
||||
@include row_shadow;
|
||||
@include hover_opacity;
|
||||
|
||||
font: $font_14_medium;
|
||||
line-height: 20px;
|
||||
padding: $gap + 2px $gap $gap - 2px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
color: white;
|
||||
align-items: stretch;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.icon {
|
||||
flex: 0 0 20px;
|
||||
margin-right: $gap;
|
||||
}
|
||||
|
||||
.text {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
padding-right: $gap;
|
||||
white-space: nowrap;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue