mirror of
https://github.com/dzeiocom/components.git
synced 2025-04-24 03:42:11 +00:00
fix: Allow to havem obile only links for navbar, menu not displaying
Signed-off-by: Avior <f.bouillon@aptatio.com>
This commit is contained in:
parent
bf4ceeb469
commit
752611414c
@ -20,6 +20,7 @@ interface MenuItem {
|
||||
icon?: Icon
|
||||
name: string
|
||||
subMenu?: Array<MenuItem>
|
||||
mobileOnly?: boolean
|
||||
}
|
||||
|
||||
interface Props {
|
||||
@ -132,7 +133,7 @@ export default class Navbar extends React.Component<Props, State> {
|
||||
{/* Menu */}
|
||||
{!this.state.isMobile && (
|
||||
<ul>
|
||||
{!this.state.isMobile && this.props.menu.map((item) => (
|
||||
{this.props.menu.filter((it) => !it.mobileOnly).map((item) => (
|
||||
<li key={item.path}><Button type="ghost" href={item.path} icon={item.icon} onClick={item.subMenu ? this.onClick(item.subMenu) : undefined}>{item.name}</Button></li>
|
||||
))}
|
||||
{this.props.user && (
|
||||
@ -161,7 +162,7 @@ export default class Navbar extends React.Component<Props, State> {
|
||||
</div>
|
||||
)}
|
||||
{this.state.subMenu && (
|
||||
<div style={{position: 'fixed', top: 76, right: this.state.subMenu.x}}>
|
||||
<div style={{position: 'fixed', top: 76, right: this.state.subMenu.x, zIndex: 1}}>
|
||||
<Menu className={css.menu} outline items={this.state.subMenu.menu} />
|
||||
</div>
|
||||
)}
|
||||
|
@ -59,7 +59,6 @@ interface State {
|
||||
*/
|
||||
open: boolean
|
||||
activeMenu?: string
|
||||
isMobile: boolean
|
||||
userMenu?: boolean
|
||||
subMenu?: {
|
||||
y: number
|
||||
@ -74,8 +73,7 @@ interface State {
|
||||
export default class Sidebar extends React.Component<Props, State> {
|
||||
|
||||
public state: State = {
|
||||
open: true,
|
||||
isMobile: false
|
||||
open: true
|
||||
}
|
||||
|
||||
public componentDidMount() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user