diff --git a/src/alerts.ts b/src/alerts.ts index f05a8134..4e372ef0 100644 --- a/src/alerts.ts +++ b/src/alerts.ts @@ -3,12 +3,14 @@ import { IToastProps } from '@blueprintjs/core'; import alerts from './alerts/alerts'; +import ble from './ble/alerts'; import explorer from './explorer/alerts'; import { CreateToast } from './i18nToaster'; /** This collects alerts from all of the subsystems of the app */ const alertDomains = { alerts, + ble, explorer, }; diff --git a/src/ble/alerts/NoWebBluetooth.tsx b/src/ble/alerts/NoWebBluetooth.tsx new file mode 100644 index 00000000..175cd784 --- /dev/null +++ b/src/ble/alerts/NoWebBluetooth.tsx @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +// Copyright (c) 2022 The Pybricks Authors + +import { Button, Intent } from '@blueprintjs/core'; +import React from 'react'; +import { CreateToast } from '../../i18nToaster'; +import { isIOS, isLinux } from '../../utils/os'; +import { I18nId, useI18n } from './i18n'; + +const NoWebBluetooth: React.VoidFunctionComponent = () => { + const i18n = useI18n(); + return ( + <> +

{i18n.translate(I18nId.NoWebBluetoothMessage)}

+ {!isLinux() && !isIOS() && ( +

{i18n.translate(I18nId.NoWebBluetoothSuggestion)}

+ )} + {isLinux() && ( + <> +

{i18n.translate(I18nId.NoWebBluetoothLinux)}

+

+ + chrome://flags/#enable-experimental-web-platform-features + +