Skip to content

Break navbar on mobile #649

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
18 changes: 0 additions & 18 deletions admin/dist/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -362,21 +362,3 @@ button > svg {
margin-right: 30px;
font-size: 0.9em;
}

.ms-navbar-left,
.ms-navbar-right {
flex: 1 0 0%;
}

.ms-navbar-right {
flex: 1 1 0%;
}

.ms-navbar-center {
flex-grow: 0;

li {
/* Prevent menu items from having their text wrapped if the screen is too small */
flex-shrink: 0;
}
}
8 changes: 5 additions & 3 deletions admin/src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ const App = () => {
<Route path="/password-reset" component={PasswordReset} />
<Route path="*">
{isLoggedIn && (
<div style={{ marginBottom: "2em" }}>
<Nav nav={nav} className="uk-margin-top" />
<div className="uk-container uk-margin-top">
<div className="uk-margin-left uk-margin-right">
<div className="uk-container-expand">
<Nav nav={nav} />
</div>
<div className="uk-container">
<div className="uk-grid">
<div className="uk-width-1-4@m">
<SideNav nav={nav} />
Expand Down
27 changes: 13 additions & 14 deletions admin/src/nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,21 @@ export const NavItem = (props) => {
};

export const Nav = ({ nav: { brand, items } }) => (
<nav className="uk-navbar-container">
<div data-uk-navbar>
<div className="ms-navbar-left uk-margin-left uk-margin-right uk-navbar-left">
<Link to="/" className="uk-navbar-item uk-logo">
{brand}
</Link>
</div>
<ul className="ms-navbar-center uk-navbar-nav">
{items.map((item, i) => (
<NavItem key={i} to={item.target} icon={item.icon}>
<nav data-uk-navbar>
<div className="uk-navbar-center" style={{ gap: "0 2em" }}>
<Link to="/" className="uk-navbar-item uk-logo">
{brand}
</Link>

{/* Using a <ul> each with a _single_ <li> sounds insane,
but that's apparently the way UI-kit is built */}
{items.map((item, i) => (
<ul className="uk-navbar-nav" key={i}>
<NavItem to={item.target} icon={item.icon}>
{item.text}
</NavItem>
))}
</ul>
{/* Used to compensate for the left side, to make the center truly centered */}
<div className="ms-navbar-right"></div>
</ul>
))}
</div>
</nav>
);
Expand Down