Skip to content

Commit

Permalink
Fix accessibility of saving reminder banner (#382)
Browse files Browse the repository at this point in the history
closes #380

---------

Co-authored-by: loiswells97 <loiswells97@users.noreply.github.com>
Co-authored-by: Lois Wells <lois.wells@raspberrypi.org>
  • Loading branch information
3 people committed Feb 27, 2023
1 parent d97a6c6 commit dc33827
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
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

0 comments on commit dc33827

Please sign in to comment.