Skip to content

Commit f409509

Browse files
authored
Style updates (#264)
* implementing a11y recommendations * style updates * update version
1 parent 0c70979 commit f409509

20 files changed

+130
-88
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
'!<rootDir>/src/(types|i18n)/*',
88
'!<rootDir>/**/__snapshots__/*',
99
'!<rootDir>/e2e/**/*',
10+
'!<rootDir>/src/**/index.ts',
1011
],
1112
testPathIgnorePatterns: ['e2e'],
1213
};

package-lock.json

Lines changed: 26 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tsml-ui",
3-
"version": "1.4.7",
3+
"version": "1.4.8",
44
"private": false,
55
"license": "MIT",
66
"scripts": {
@@ -34,7 +34,7 @@
3434
"typescript": "^4.6.4"
3535
},
3636
"dependencies": {
37-
"bootstrap": "^5.1.3",
37+
"bootstrap": "^5.2.2",
3838
"deepmerge": "^4.2.2",
3939
"luxon": "^3.0.3",
4040
"react": "^17.0.2",

public/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/tests/aasfmarin.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
></div>
2020
<script>
2121
var tsml_react_config = {
22-
'conference_providers': {
22+
conference_providers: {
2323
'sites.google.com': 'Custom',
2424
'tinyurl.com': 'Custom',
2525
'MillValleyCabin.com': 'Custom',
2626
},
27+
show: {
28+
listButtons: true,
29+
},
2730
};
2831
</script>
2932
<script src="/app.js" async></script>

src/components/Controls.tsx

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -140,38 +140,40 @@ export default function Controls({ state, setState, mapbox }: ControlsProps) {
140140
<div className="controls d-print-none gx-3 gx-md-4 gy-3 row">
141141
<div className="col-6 col-lg">
142142
<div className="position-relative">
143-
<form className="input-group" onSubmit={locationSearch}>
144-
<input
145-
aria-label={strings.modes[state.input.mode]}
146-
className="form-control"
147-
disabled={state.input.mode === 'me'}
148-
onChange={e => {
149-
if (state.input.mode === 'search') {
150-
state.input.search = e.target.value;
151-
setState({ ...state });
152-
} else {
153-
setSearch(e.target.value);
154-
}
155-
}}
156-
placeholder={strings.modes[state.input.mode]}
157-
ref={searchInput}
158-
spellCheck="false"
159-
type="search"
160-
value={
161-
state.input.mode === 'location' ? search : state.input.search
162-
}
163-
/>
164-
{modes.length > 1 && (
165-
<button
166-
id="mode"
143+
<form onSubmit={locationSearch}>
144+
<fieldset className="input-group">
145+
<input
167146
aria-label={strings.modes[state.input.mode]}
168-
className="btn btn-outline-secondary dropdown-toggle"
169-
onClick={() =>
170-
setDropdown(dropdown === 'search' ? undefined : 'search')
147+
className="form-control"
148+
disabled={state.input.mode === 'me'}
149+
onChange={e => {
150+
if (state.input.mode === 'search') {
151+
state.input.search = e.target.value;
152+
setState({ ...state });
153+
} else {
154+
setSearch(e.target.value);
155+
}
156+
}}
157+
placeholder={strings.modes[state.input.mode]}
158+
ref={searchInput}
159+
spellCheck="false"
160+
type="search"
161+
value={
162+
state.input.mode === 'location' ? search : state.input.search
171163
}
172-
type="button"
173164
/>
174-
)}
165+
{modes.length > 1 && (
166+
<button
167+
id="mode"
168+
aria-label={strings.modes[state.input.mode]}
169+
className="btn btn-outline-secondary dropdown-toggle"
170+
onClick={() =>
171+
setDropdown(dropdown === 'search' ? undefined : 'search')
172+
}
173+
type="button"
174+
/>
175+
)}
176+
</fieldset>
175177
</form>
176178
{modes.length > 1 && (
177179
<div

src/components/Dropdown.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import React, { Fragment } from 'react';
22

33
import type { State } from '../types';
4-
import { formatClasses as cx, getIndexByKey, formatUrl } from '../helpers';
4+
import {
5+
formatClasses as cx,
6+
formatUrl,
7+
getIndexByKey,
8+
strings,
9+
} from '../helpers';
510

611
type DropdownProps = {
712
defaultValue: string;
@@ -88,7 +93,17 @@ export default function Dropdown({
8893
onClick={e => setFilter(e, filter, key)}
8994
>
9095
<span>{name}</span>
91-
<span className="badge bg-light border ms-3 text-dark">
96+
<span
97+
aria-label={
98+
slugs.length === 1
99+
? strings.match_single
100+
: strings.match_multiple.replace(
101+
'%count%',
102+
slugs.length.toString()
103+
)
104+
}
105+
className="badge bg-light border ms-3 text-dark"
106+
>
92107
{slugs.length}
93108
</span>
94109
</a>

src/components/Map.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ export default function Map({
182182
}, [data, dimensions]);
183183

184184
return (
185-
<div className="border rounded bg-light flex-grow-1 map" ref={mapFrame}>
185+
<div
186+
aria-hidden={true}
187+
className="border rounded bg-light flex-grow-1 map"
188+
ref={mapFrame}
189+
>
186190
{viewport && !!data.locationKeys.length && (
187191
<ReactMapGL
188192
mapStyle={settings.map.style}

src/components/Meeting.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export default function Meeting({
6060
el.scrollIntoView();
6161
}
6262

63+
document.getElementById('tsml-title')?.focus();
64+
6365
//log edit_url
6466
if (meeting.edit_url) {
6567
console.log(`TSML UI edit ${meeting.name}: ${meeting.edit_url}`);
@@ -224,7 +226,7 @@ export default function Meeting({
224226
'online': !!meeting.isOnline,
225227
})}
226228
>
227-
<h1 className="fw-light mb-1">
229+
<h1 className="fw-light mb-1" id="tsml-title" tabIndex={-1}>
228230
<Link meeting={meeting} />
229231
</h1>
230232
<div className="align-items-center border-bottom d-flex h6 mb-3 pb-2">

0 commit comments

Comments
 (0)