Skip to content

Commit

Permalink
Constant navbar width (#216)
Browse files Browse the repository at this point in the history
- Navbar items have now a fixed witdth when they become active
  • Loading branch information
Lolginer authored Nov 22, 2023
1 parent f2d98ea commit 467920f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ export default class App extends Component {
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="me-auto">
<NavLink data-testid="tab-snapshots" className="nav-link" activeClassName="active" to="/snapshots">Snapshots</NavLink>
<NavLink data-testid="tab-policies" className="nav-link" activeClassName="active" to="/policies">Policies</NavLink>
<NavLink data-testid="tab-tasks" className="nav-link" activeClassName="active" to="/tasks">Tasks <>
<NavLink data-testid="tab-snapshots" data-title="Snapshots" className="nav-link" activeClassName="active" to="/snapshots">Snapshots</NavLink>
<NavLink data-testid="tab-policies" data-title="Policies" className="nav-link" activeClassName="active" to="/policies">Policies</NavLink>
<NavLink data-testid="tab-tasks" data-title="Tasks" className="nav-link" activeClassName="active" to="/tasks">Tasks <>
{runningTaskCount > 0 && <>({runningTaskCount})</>}
</>
</NavLink>
<NavLink data-testid="tab-repo" className="nav-link" activeClassName="active" to="/repo">Repository</NavLink>
<NavLink data-testid="tab-preferences" className="nav-link" activeClassName="active" to="/preferences">Preferences</NavLink>
<NavLink data-testid="tab-repo" data-title="Repository" className="nav-link" activeClassName="active" to="/repo">Repository</NavLink>
<NavLink data-testid="tab-preferences" data-title="Preferences" className="nav-link" activeClassName="active" to="/preferences">Preferences</NavLink>
</Nav>
</Navbar.Collapse>
</Navbar>
Expand Down
10 changes: 10 additions & 0 deletions src/css/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ body {
#kopia .navbar-light .navbar-nav .nav-link.active,
#kopia .navbar-light .navbar-nav .show>.nav-link {
color: var(--color-text-nav);
text-align: center;
}

#kopia .navbar-light .navbar-nav .nav-link::after {
display: block;
content: attr(data-title);
font-weight: bold;
height: 0px;
overflow: hidden;
visibility: hidden;
}

#kopia .navbar-light .navbar-nav .nav-link:hover {
Expand Down

0 comments on commit 467920f

Please sign in to comment.