Skip to content

Commit

Permalink
Updating design of popover (#9)
Browse files Browse the repository at this point in the history
and added manage button that needs to be hooked up
  • Loading branch information
cchaos authored and legrego committed Jul 31, 2018
1 parent 9c4f71e commit 21c6929
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
EuiContextMenuPanel,
EuiContextMenuItem,
EuiFieldSearch,
EuiHorizontalRule,
EuiButton,
} from '@elastic/eui';
import { SpaceAvatar } from '../../components/space_avatar';
import { SPACE_SEARCH_COUNT_THRESHOLD } from '../../../../common/constants';
Expand All @@ -32,6 +32,8 @@ export class SpacesMenu extends Component {
items = [this.renderSearchField(), this.renderSpacesListPanel(items, searchTerm)];
}

items.push(this.renderManageButton());

return (
<EuiContextMenuPanel
className="spacesMenu"
Expand Down Expand Up @@ -76,15 +78,23 @@ export class SpacesMenu extends Component {

renderSearchField = () => {
return (
<EuiContextMenuPanel key="spacesMenuSearchField">
<EuiContextMenuItem key="spacesMenuSearchField">
<EuiFieldSearch
className="spacesMenu__searchField"
placeholder="Find a space"
incremental={true}
onSearch={this.onSearch}
compressed
/>
<EuiHorizontalRule />
</EuiContextMenuPanel>
</EuiContextMenuItem>
);
}

renderManageButton = () => {
return (
<EuiContextMenuItem>
<EuiButton size="s" style={{ width: `100%` }}>Manage spaces</EuiButton>
</EuiContextMenuItem>
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.spacesMenu__spacesList {
max-height: 300px;
max-height: 320px;
overflow-y: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ export class NavControlPopover extends Component {
<EuiPopover
button={button}
isOpen={this.state.isOpen}
panelPaddingSize={'none'}
closePopover={this.closePortal}
anchorPosition={'rightCenter'}
panelPaddingSize="none"
ownFocus
>
<SpacesMenu spaces={this.state.spaces} onSelectSpace={this.onSelectSpace} />
</EuiPopover>
Expand Down

0 comments on commit 21c6929

Please sign in to comment.