Skip to content

Commit

Permalink
Turn section into an ordered list to improve screen reader experience #…
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiosironi committed Jun 21, 2024
1 parent 1e46784 commit b26fa1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/read-side/html-pages/search-page/_index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use 'functions';
@use 'list';

.search-categories {
@include list.basics();
display: flex;
flex-flow: row wrap;
gap: functions.px-to-rem(32px);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import * as RA from 'fp-ts/ReadonlyArray';
import { pipe } from 'fp-ts/function';
import { HtmlFragment, toHtmlFragment } from '../../../../types/html-fragment';
import { renderListItems } from '../../shared-components/list-items';
import { renderSearchForm } from '../../shared-components/search-form';
import { ViewModel } from '../view-model';

const renderSearchCategories = (viewModel: ViewModel) => pipe(
viewModel,
RA.map((category) => `<a href="${category.href}">${category.title}</a>`),
RA.map((category) => toHtmlFragment(`<a href="${category.href}">${category.title}</a>`)),
renderListItems,
(categories) => `
<section class="search-categories">
${categories.join('')}
</section>
<ul role="list" class="search-categories">
${categories}
</ul>
`,
);

Expand Down

0 comments on commit b26fa1d

Please sign in to comment.