Skip to content

Commit

Permalink
feat: add Menu component
Browse files Browse the repository at this point in the history
  • Loading branch information
wewoor committed Nov 11, 2020
1 parent 6648524 commit df20a80
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/menu/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import './style.scss';
import * as React from 'react';
import { classNames, prefixClaName } from "mo/common/className";
import ActionBar, { IActionBar, IActionBarItem } from 'mo/components/actionbar';

export interface IMenuItem extends IActionBarItem {}
export interface IMenu extends IActionBar {}

export function Menu(props: IMenu) {
const { className, ...others } = props;
const claNames = classNames(prefixClaName('menu'), className);

return (
<menu className={claNames} >
<ActionBar {...others}/>
</menu>
)
}
42 changes: 42 additions & 0 deletions src/components/menu/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@import 'mo/style/const';
$menu: 'menu';

#{prefix($menu)} {
margin: 0;
min-width: 130px;
padding: 0;

#{prefix('action-bar')} {
padding: 0.5em 0;
}

.action-bar-container {
display: block;
}

.action-item {
border: thin solid transparent;
display: flex;
overflow: visible;
position: static;
text-indent: 1em;
transform: none;
}

.action-label {
font-size: 13px;
height: 1.8em;
}

.action-label.codicon {
line-height: 1.8em;
}

.disabled {
cursor: default;
opacity: 0.4;
pointer-events: none;
}
}


0 comments on commit df20a80

Please sign in to comment.