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

DBC22-951: Removed tab order for Gov of BC header logo link on mobile only #166

Merged
merged 2 commits into from
Nov 1, 2023
Merged
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
12 changes: 8 additions & 4 deletions src/frontend/src/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import logo from './images/dbc-logo.svg';
// Styling
import './Header.scss';


// Third party packages
import {useMediaQuery} from '@uidotdev/usehooks';

export default function Header() {
// State hooks
const [expanded, setExpanded] = useState(false);
Expand All @@ -22,6 +26,8 @@ export default function Header() {
return <Nav.Link active={false} onClick={() => setTimeout(() => setExpanded(false))}>{title}</Nav.Link>
};

const largeScreen = useMediaQuery('only screen and (min-width : 768px)');

// Rendering
return (
<header className="header--shown">
Expand All @@ -33,10 +39,8 @@ export default function Header() {
<span className="line line3"></span>
</Navbar.Toggle>

<Navbar.Brand href="#home">
<a href="/" className="header-link">
<img className="header-logo" src={logo} alt="Government of British Columbia" />
</a>
<Navbar.Brand href="#home" tabIndex={largeScreen ? "0": "-1"}>
<img className="header-logo" src={logo} alt="Government of British Columbia" />
</Navbar.Brand>

<div className="nav-divider"></div>
Expand Down
Loading