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

1455/language tabs a11y #1528

Merged
merged 8 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ All notable changes to this project will be documented in this file. The format

### UI Components

- Fixed:

- Fix a11y language navigation ([#1528](https://github.com/bloom-housing/bloom/pull/1528)) (Dominik Barcikowski)

- Added:
- Preview (disabled) state for Listings Application button ([#1502](https://github.com/bloom-housing/bloom/pull/1502)) (Jared White)
- Automated a11y testing for ui-components ([#1450](https://github.com/bloom-housing/bloom/pull/1450))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("applications/review/confirmation", function () {
})

it("Should redirect to create account page", function () {
cy.get("button").contains("Create Account").click()
cy.get("button.button").contains("Create Account").click()
cy.location("pathname").should("include", "/create-account")
})

Expand Down
24 changes: 15 additions & 9 deletions ui-components/src/navigation/LanguageNav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@

.language-nav__list {
@apply flex;
}

.language-nav__list-button {
@apply py-2;
@apply px-2;
@apply text-gray-500;
@apply font-semibold;
@apply cursor-pointer;
@apply bg-none;

li {
@apply py-2;
@apply px-2;
@apply text-gray-500;
@apply font-semibold;
@apply cursor-pointer;
&:focus {
outline: none;
box-shadow: 0 0 0 2px #fff, 0 0 3px 4px $tailwind-accent-cool;
}

&.is-active {
@apply text-white;
}
&.is-active {
@apply text-white;
}
}
22 changes: 14 additions & 8 deletions ui-components/src/navigation/LanguageNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ const LanguageNav = ({ language }: LanguageNavProps) => {
<nav className="language-nav">
<ul className="language-nav__list">
{language.list?.map((item) => (
<li
key={item.prefix}
onClick={() => {
void router.push(router.asPath, router.asPath, { locale: item.prefix || "en" })
}}
className={routePrefix === item.prefix ? "is-active" : ""}
>
{item.label}
<li key={item.prefix}>
<button
onClick={() => {
void router.push(router.asPath, router.asPath, { locale: item.prefix || "en" })
}}
className={
routePrefix === item.prefix
? "language-nav__list-button is-active"
: "language-nav__list-button"
}
type="button"
>
{item.label}
</button>
</li>
))}
</ul>
Expand Down