Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Shell): issues shell phone model menu icon should hidde, close #3886 #4766

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions components/shell/__tests__/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,5 +389,48 @@ describe('Shell', () => {
});
assert(wrapper.find('.next-shell-header').length === 1);
});

// issue:
it('should hidden menu & menu-items-icon in phone', () => {
const div = document.createElement('div');
document.body.appendChild(div);
wrapper = mount(
<Shell
device={'phone'}
className={'iframe-hack'}
style={{ border: '1px solid #eee' }}
>
<Shell.Navigation>
<Nav embeddable aria-label="global navigation">
<Nav.Item icon="account">Nav Item 1</Nav.Item>
<Nav.Item icon="calendar">Nav Item 2</Nav.Item>
<Nav.Item icon="atm">Nav Item 3</Nav.Item>
<Nav.Item icon="account">Nav Item 4</Nav.Item>
<Nav.Item icon="account">Nav Item 5</Nav.Item>
<Nav.Item icon="account">Nav Item 6</Nav.Item>
<Nav.Item icon="account">Nav Item 7</Nav.Item>
</Nav>
</Shell.Navigation>
<Shell.Content>
<div style={{ minHeight: 1200, background: '#fff' }} />
</Shell.Content>
<Shell.ToolDock>
<Shell.ToolDockItem>
<Icon type="calendar" />
</Shell.ToolDockItem>
<Shell.ToolDockItem>
<Icon type="atm" />
</Shell.ToolDockItem>
<Shell.ToolDockItem>
<Icon type="account" />
</Shell.ToolDockItem>
</Shell.ToolDock>
</Shell>,
{attachTo: div}
);
const element = wrapper.find('.next-aside-navigation').at(0).instance();
assert(element.offsetWidth === 0);
assert(window.getComputedStyle(element).overflow === 'hidden');
});
});
});
1 change: 1 addition & 0 deletions components/shell/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@

&#{$shell-prefix}-collapse {
width: 0;
overflow: hidden;
}
}
#{$shell-prefix}-header #{$shell-prefix}-navigation {
Expand Down
Loading