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

Fix accessibility of saving reminder banner #382

Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Web component icon visibility (#358)
- Renaming project, adding new file or renaming file always triggers autosave (#368)
- Use `HtmlRunner` for `html` projects (#378)
- Accessibility Fixes (#373)
- Accessibility Fixes (#373, #382)

## [0.12.0] - 2023-01-27

Expand Down
1 change: 1 addition & 0 deletions src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ i18n
loginText: 'Log in to your Raspberry Pi account to save your work, and you\'ll be able to access and edit your project whenever you need to.'
},
notifications: {
close: 'close',
loginPrompt: 'To save this project and access it later, don\'t forget to log in or sign up!',
projectRemixed: 'Your remixed project has been saved',
projectRenamed: 'You have renamed your project.',
Expand Down
10 changes: 9 additions & 1 deletion src/utils/Notifications.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { toast } from "react-toastify";
import { InfoIcon, TickIcon } from "../Icons";
import { CloseIcon, InfoIcon, TickIcon } from "../Icons";
import i18n from "../i18n";
import Button from "../components/Button/Button";

const CloseButton = ({ closeToast }) => {
return (
<Button ButtonIcon = {CloseIcon} onClickHandler = {closeToast} title={i18n.t('notifications.close')} label={i18n.t('notifications.close')} />
)
}

const bottomCenterSettings = {
position: toast.POSITION.BOTTOM_CENTER,
Expand All @@ -15,6 +22,7 @@ const topCenterSettings = {
position: toast.POSITION.TOP_CENTER,
autoClose: 6000,
className: 'toast--top-center__message',
closeButton: CloseButton,
containerId: 'top-center',
hideProgressBar: true
}
Expand Down