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

Add alt text to logo #1561

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions apps/admin/src/views/mapoptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,27 @@ class MapOptions extends Component {
}}
/>
</div>
<div>
<label>
Alternativtext för logotyp{" "}
<i
className="fa fa-question-circle"
data-toggle="tooltip"
title="En text beskrivning som ger bildinformation vid skärmläsare eller om bilden saknas."
/>
</label>
<input
type="text"
ref="input_logoAltText"
value={this.state.logoAltText}
className={this.getValidationClass("logoAltText")}
onChange={(e) => {
this.setState({ logoAltText: e.target.value }, () =>
this.validateField("logoAltText")
);
}}
/>
</div>
<div>
<label>
Legend options{" "}
Expand Down
4 changes: 3 additions & 1 deletion apps/client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,8 @@ class App extends React.PureComponent {
config.mapConfig.map.logo || // If neither was set, try to see if we have the legacy admin parameter.
"logo.png"; // If we didn't have this either, fallback to hard-coded value.

const logoAltText = config.mapConfig.map.logoAltText || "Logotype";

return (
<>
<Box
Expand All @@ -975,7 +977,7 @@ class App extends React.PureComponent {
height: (theme) => theme.spacing(6),
}}
>
<LogoImage alt="" src={logoUrl} />
<LogoImage alt={logoAltText} src={logoUrl} />
</Box>
<Divider />
<DrawerHeaderGrid
Expand Down