Skip to content

Commit 665c750

Browse files
committed
update(app): hack to hide tooltip on usermenu. Should have a proper way of hiding it (antd issue)
1 parent 4307c52 commit 665c750

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

src/components/layout/AppSidenav.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { withRouter, RouteComponentProps } from 'react-router-dom';
33
import styled from 'styled-components';
4-
import { Layout, Menu, Icon } from 'antd';
4+
import { Layout, Menu, Icon, Tooltip } from 'antd';
55
import { navRoutes, INavRoute, INavGroup, getDefaultSelectedKeys } from '../../utils/navUtils';
66
import { slugify } from '../../utils/stringUtils';
77
import SidenavContext, { ISelectedKeys } from '../../contexts/SidenavContext';
@@ -160,7 +160,13 @@ class AppSidenav extends React.PureComponent<RouteComponentProps, { collapsedWid
160160
}
161161
}}
162162
>
163-
<span>{itemLabel}</span>
163+
<Tooltip
164+
placement="right"
165+
title={collapsed ? itemLabel : null}
166+
overlayClassName="custom-tooltip"
167+
>
168+
<span>{itemLabel}</span>
169+
</Tooltip>
164170
</Menu.Item>
165171
);
166172
})}
@@ -181,8 +187,14 @@ class AppSidenav extends React.PureComponent<RouteComponentProps, { collapsedWid
181187
}
182188
}}
183189
>
184-
<Icon type={iconType} />
185-
<span>{label}</span>
190+
<Tooltip
191+
placement="right"
192+
title={collapsed ? label : null}
193+
overlayClassName="custom-tooltip"
194+
>
195+
<Icon type={iconType} />
196+
<span>{label}</span>
197+
</Tooltip>
186198
</Menu.Item>
187199
);
188200
})}

src/stylesheets/app.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,15 @@ body {
1212
position: fixed;
1313
left: 0 !important;
1414
}
15+
16+
.ant-dropdown-menu-inline-collapsed-tooltip {
17+
display: none;
18+
}
19+
20+
.ant-menu-inline-collapsed-tooltip {
21+
display: none;
22+
}
23+
24+
.custom-tooltip {
25+
left: 67px !important;
26+
}

0 commit comments

Comments
 (0)