Skip to content

Commit

Permalink
Added menuLeft and menuRight icons (#1797)
Browse files Browse the repository at this point in the history
And updated EuiNavDrawer’s collapse/expand button to use it
  • Loading branch information
cchaos authored Apr 4, 2019
1 parent fde22a8 commit 0f24882
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Converted `EuiTableHeaderMobile` to TS ([#1786](https://github.com/elastic/eui/pull/1786))
- Added `menuLeft` and `menuRight` icons ([#1797](https://github.com/elastic/eui/pull/1797))
- Updated EuiNavDrawer’s collapse/expand button to use `menuLeft` and `menuRight` icons ([#1797](https://github.com/elastic/eui/pull/1797))

## [`9.8.0`](https://github.com/elastic/eui/tree/v9.8.0)

Expand Down
2 changes: 2 additions & 0 deletions src-docs/src/views/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ const iconTypes = [
'mapMarker',
'memory',
'merge',
'menuLeft',
'menuRight',
'minusInCircle',
'minusInCircleFilled',
'node',
Expand Down
31 changes: 31 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4587,6 +4587,37 @@ exports[`EuiIcon props type memory is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type menuLeft is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1.014 7.382a.501.501 0 0 0-.013.152c-.014.4.133.806.439 1.112l2.12 2.122a.5.5 0 1 0 .708-.708L2.208 8H14.5a.5.5 0 0 0 0-1H2.379l1.889-1.89a.5.5 0 0 0-.707-.706L1.44 6.524c-.241.242-.383.544-.426.858zM14.5 3h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zm0 8h-7a.5.5 0 1 0 0 1h7a.5.5 0 1 0 0-1z"
fill-rule="evenodd"
/>
</svg>
`;

exports[`EuiIcon props type menuRight is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M14.986 7.382a.501.501 0 0 1 .013.152c.014.4-.133.806-.439 1.112l-2.12 2.122a.5.5 0 1 1-.708-.708L13.792 8H1.5a.5.5 0 0 1 0-1h12.121l-1.889-1.89a.5.5 0 0 1 .707-.706l2.121 2.12c.241.242.383.544.426.858zM1.5 3h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1zm0 8h7a.5.5 0 1 1 0 1h-7a.5.5 0 1 1 0-1z"
/>
</svg>
`;

exports[`EuiIcon props type merge is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
Expand Down
3 changes: 3 additions & 0 deletions src/components/icon/assets/menuLeft.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/components/icon/assets/menuRight.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ import managementApp from './assets/app_management.svg';
import mapMarker from './assets/map_marker.svg';
import memory from './assets/memory.svg';
import merge from './assets/merge.svg';
import menuLeft from './assets/menuLeft.svg';
import menuRight from './assets/menuRight.svg';
import metricbeatApp from './assets/app_metricbeat.svg';
import minusInCircle from './assets/minus_in_circle.svg';
import minusInCircleFilled from './assets/minus_in_circle_filled.svg';
Expand Down Expand Up @@ -475,6 +477,8 @@ const typeToIconMap = {
mapMarker,
memory,
merge,
menuLeft,
menuRight,
metricbeatApp,
minusInCircle,
minusInCircleFilled,
Expand Down
2 changes: 1 addition & 1 deletion src/components/nav_drawer/nav_drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class EuiNavDrawer extends Component {
{([sideNavCollapse, sideNavExpand]) => (
<EuiListGroupItem
label={this.state.isCollapsed ? sideNavExpand : sideNavCollapse}
iconType={this.state.isCollapsed ? 'sortRight' : 'sortLeft'}
iconType={this.state.isCollapsed ? 'menuRight' : 'menuLeft'}
size="s"
showToolTip={this.state.isCollapsed}
onClick={this.state.isCollapsed ? () => {this.expandDrawer(); this.collapseFlyout();} : () => this.collapseDrawer()}
Expand Down

0 comments on commit 0f24882

Please sign in to comment.