Commit Graph
16 Commits
Author SHA1 Message Date
David Lechner dd322b5aac tree-wide: use noopener instead of noreferrer for target="_blank"
This will allow us to see when users click links to the pybricks.com
website from the app.
2022-12-20 12:09:04 -06:00
David Lechner 9fe62467d5 alerts: use shorthand return 2022-11-22 15:56:56 -06:00
David Lechner fa00c0aea6 firmware/sagas: fix progress alerts
These were being replaced (dismissed then new alert) instead of updated.
2022-10-21 16:26:43 -05:00
David Lechner 4400c0663e alerts/UnexpectedErrorAlert: fix not showing message
This was not showing the actual error message.

Also hide the technical details when no stack trace is available.
2022-10-21 16:26:43 -05:00
David Lechner fc4cb8eb78 alerts: add alertsHideAlert actions
This is used instead of using toaster.dismiss() directly.
2022-10-19 18:26:37 -05:00
David Lechner 28cf87c356 alerts: allow overriding key
This adds an optional key parameter to alertsShowAlert() to allow
overriding the key. This allows us to call flashProgress using that
action instead of having to use the toaster directly.
2022-10-19 18:26:37 -05:00
David Lechner fa27649fe3 toasterTypes: change toaster to ref
Instead of rendering the toaster separate from the main index, add it
there so we can inherit all of the context providers. This requires
passing the ref object instead of the toaster instance itself, so
sagas have to be updated.
2022-10-19 18:26:37 -05:00
David Lechner b447bd7a3a replace use of deprecated IToaster and IToastProps 2022-09-06 10:56:38 -05:00
David Lechner c84afea181 style: make use of more blueprint styles
https://blueprintjs.com/docs/#core/typography

Also fix wrapping license text while we are touching this.
2022-07-27 16:55:46 -05:00
David Lechner 934330272f alerts/sagas: avoid reentrancy for dismiss
This fixes react complaining about calling setState from an invalid
context.
2022-07-22 15:29:11 -05:00
David Lechner 9d1f3651c5 alerts/actions: fix alertsShowAlert action with props 2022-07-22 14:45:47 -05:00
David Lechner d6df128860 i18n: use automatic type inference of translation keys
Finally figured out a way to make typescript strongly type translation
keys so we can avoid the tedium of creating enums of translation keys.
2022-07-22 13:48:50 -05:00
David Lechner 85deb42f76 firmware: add multi-step dialog 2022-07-20 12:32:17 -05:00
David Lechner 7232bf6153 add better error message when no files to backup
Instead of showing unexpected error, show message explaining that
there are no files to be backed up and how to fix it.

Fixes: https://github.com/pybricks/support/issues/681
2022-07-06 17:56:08 -05:00
David Lechner a3e55c828a move useI18n to i18n.ts
Since we are using the react-i18n babel loader plugin, useI18n can only
be used once per file. Also we have to remember to add the istanbul
ignore next comment each time we use it. By moving this to a common
file, it can be easily copied and pasted when a new submodule is
created and we don't have to remember the rules when calling it.
2022-05-21 13:57:58 -05:00
David Lechner e7366c8afd rework alerts
This starts moving alerts to the same subsystem where they are relevant
instead of putting everything in notifications.

So far, only the explorer file in use error is handled like this.
2022-05-20 19:25:18 -05:00