Skip to content
Snippets Groups Projects
Commit 04c38250 authored by Alexander Rose's avatar Alexander Rose
Browse files

tweaked action-menu offset

parent 5ccb329a
Branches
No related tags found
No related merge requests found
......@@ -66,18 +66,20 @@ export namespace ActionMenu {
const { header, items, onSelect } = this.props;
if (typeof items === 'string') return null;
if (isItem(items)) return <Action item={items} onSelect={onSelect} />
return <div className='msp-control-offset'>
return <div>
{header && <div className='msp-control-group-header'>
<button className='msp-btn msp-btn-block' onClick={this.toggleExpanded}>
<span className={`msp-icon msp-icon-${this.state.isExpanded ? 'collapse' : 'expand'}`} />
{header}
</button>
</div>}
<div className='msp-control-offset'>
{(!header || this.state.isExpanded) && items.map((x, i) => {
if (typeof x === 'string') return null;
if (isItem(x)) return <Action key={i} item={x} onSelect={onSelect} />
return <Section key={i} header={typeof x[0] === 'string' ? x[0] : void 0} items={x} onSelect={onSelect} />
})}
</div>
</div>;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment