diff --git a/lang/ui.ca.json b/lang/ui.ca.json index 2f3e3bc5c..bca7bb52a 100644 --- a/lang/ui.ca.json +++ b/lang/ui.ca.json @@ -1130,14 +1130,6 @@ "defaultMessage": "Torna a connectar la teva micro:bit i torna-ho a provar.", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "Has d'actualitzar el microprogramari de la teva micro:bit per fer ús d'aquesta característica.", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "Actualitza el microprogramari de la micro:bit ", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "Malauradament, WebUSB no és compatible amb aquest navegador i el teu programa es desarà al teu ordinador. Segueix els passos de la pantalla següent per transferir-lo ala teva micro:bit. Et recomanem Google Chrome o Microsoft Edge perquè et puguis connectar directament a la teva micro:bit.", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.de.json b/lang/ui.de.json index d3d8703c1..42bf46a69 100644 --- a/lang/ui.de.json +++ b/lang/ui.de.json @@ -1130,14 +1130,6 @@ "defaultMessage": "Bitte schließe deinen micro:bit erneut an und versuche es nochmal.", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "Um diese Funktion nutzen zu können, musst du deine micro:bit Firmware aktualisieren .", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "Bitte aktualisiere die micro:bit Firmware", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "Leider wird WebUSB in diesem Browser nicht unterstützt und dein Programm wird stattdessen auf deinem Computer gespeichert. Folge den Schritten auf dem nächsten Bildschirm, um es auf deinen micro:bit zu übertragen. Wir empfehlen Google Chrome oder Microsoft Edge, damit du dich direkt mit deinem micro:bit verbinden kannst.", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.en.json b/lang/ui.en.json index e83ebd588..f12fc199a 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -1120,7 +1120,7 @@ "description": "Part of WebUSB error message" }, "webusb-error-clear-connect-title": { - "defaultMessage": "Unable to claim interface", + "defaultMessage": "Another page or browser tab is connected to this micro:bit", "description": "Title of error for WebUsb connection" }, "webusb-error-default-title": { @@ -1128,17 +1128,9 @@ "description": "Default title for error messages relating to WebUSB" }, "webusb-error-reconnect-microbit-description": { - "defaultMessage": "Please reconnect your micro:bit and try again.", + "defaultMessage": "

Please follow these steps, then try again:

", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "You need to update your micro:bit firmware to make use of this feature.", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "Please update the micro:bit firmware", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "Unfortunately, WebUSB is not supported in this browser and your program will be saved to your computer instead. Follow the steps on the next screen to transfer it to your micro:bit. We recommend Google Chrome or Microsoft Edge so you can connect directly to your micro:bit.", "description": "Explantion shown when user's browser doesn't support WebUSB" @@ -1171,4 +1163,4 @@ "defaultMessage": "Zoom out", "description": "Text label for zoom out button" } -} \ No newline at end of file +} diff --git a/lang/ui.es-es.json b/lang/ui.es-es.json index d615ce3dd..aa0e6f85c 100644 --- a/lang/ui.es-es.json +++ b/lang/ui.es-es.json @@ -1130,14 +1130,6 @@ "defaultMessage": "Por favor reconecta el micro:bit e intentalo de nuevo.", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "Necesitas actualizar el firmware del micro:bit para usar esta función.", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "Actualiza el firmware micro:bit", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "Desafortunadamente, este navegador no admite WebUSB, por lo que el programa se guardará en el ordenador. Sigue los pasos indicados en la siguiente pantalla para transferirlo al micro:bit. Recomendamos Google Chrome o Microsoft Edge para poder conectarte directamente al micro:bit.", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.fr.json b/lang/ui.fr.json index 3c8cf76f4..459567c90 100644 --- a/lang/ui.fr.json +++ b/lang/ui.fr.json @@ -1130,14 +1130,6 @@ "defaultMessage": "Veuillez reconnecter votre micro:bit et réessayer.", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "Vous devez mettre à jour le micrologiciel de votre micro:bit pour utiliser cette fonctionnalité.", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "Veuillez mettre à jour le micrologiciel de micro:bit", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "Malheureusement, WebUSB n'est pas pris en charge dans ce navigateur et votre programme sera sauvegardé sur votre ordinateur. Suivez les étapes sur l'écran suivant pour le transférer vers votre micro:bit. Nous vous recommandons Google Chrome ou Microsoft Edge afin que vous puissiez vous connecter directement à votre micro:bit.", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.ja.json b/lang/ui.ja.json index b8b56e462..00816c9ef 100644 --- a/lang/ui.ja.json +++ b/lang/ui.ja.json @@ -1130,14 +1130,6 @@ "defaultMessage": "micro:bitを再接続して、やり直してください。", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "この機能を利用するには、micro:bitファームウェアを更新する必要があります。", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "micro:bit のファームウェアを更新してください。", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "残念ながら、WebUSBはこのブラウザではサポートされていないので、代わりにプログラムをコンピュータに保存します。 次の画面の手順に従ってmicro:bitに転送してください。micro:bitと直接接続できるように、Google ChromeまたはMicrosoft Edgeをお勧めします。", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.ko.json b/lang/ui.ko.json index 47ec75d06..4f0fa7668 100644 --- a/lang/ui.ko.json +++ b/lang/ui.ko.json @@ -1130,14 +1130,6 @@ "defaultMessage": "micro:bit 연결을 확인한 후, 다시 시도해 보세요.", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "이 기능을 활용하려면 micro:bit 펌웨어를 업데이트해야 합니다.", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "micro:bit 펌웨어를 업데이트 하세요.", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "이 브라우저가 WebUSB를 지원하지 않아 프로그램이 컴퓨터에 저장됩니다. micro:bit로 전송하려면 다음 화면의 단계를 따르세요. micro:bit에 직접 연결할 수 있도록 Google Chrome 또는 Microsoft Edge 사용을 권장합니다.", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.nl.json b/lang/ui.nl.json index 8ab388e35..b2ded615d 100644 --- a/lang/ui.nl.json +++ b/lang/ui.nl.json @@ -1130,14 +1130,6 @@ "defaultMessage": "Verbind je micro:bit opnieuw en probeer het nog eens.", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "Je moet je micro:bit firmware updaten om deze functie te gebruiken.", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "Werk de firmware van de micro:bit bij", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "Helaas wordt WebUSB niet ondersteund in deze browser en zal je programma worden opgeslagen op je computer. Volg de stappen op het volgende scherm om het naar de micro:bit te verplaatsen. We raden Google Chrome of Microsoft Edge aan, zodat je direct verbinding kunt maken met je micro:bit.", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.zh-cn.json b/lang/ui.zh-cn.json index 661ee1a8e..bf60c362a 100644 --- a/lang/ui.zh-cn.json +++ b/lang/ui.zh-cn.json @@ -1130,14 +1130,6 @@ "defaultMessage": "请重新连接 micro:bit 然后再次尝试。", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "您需要 update your micro:bit firmware 才能使用此功能。", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "请更新 micro:bit 固件", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "很遗憾,此浏览器不支持 WebUSB,您的程序将被保存到您的计算机上。请按照下一个屏幕上的步骤将其传输到您的 micro:bit。我们建议您使用 Google Chrome 或 Microsoft Edge 浏览器,以便您可以直接连接到您的 micro:bit。", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/lang/ui.zh-tw.json b/lang/ui.zh-tw.json index 47d0b0ca5..b25af3439 100644 --- a/lang/ui.zh-tw.json +++ b/lang/ui.zh-tw.json @@ -1130,14 +1130,6 @@ "defaultMessage": "請重新連接你的 micro:bit 後再試一次。", "description": "Part of WebUSB error message" }, - "webusb-error-update-req-description": { - "defaultMessage": "您需要更新您的 micro:bit 韌體,以使用此功能。", - "description": "WebUSB error telling user to update firmware" - }, - "webusb-error-update-req-title": { - "defaultMessage": "請更新 micro:bit 韌體", - "description": "Error text telling user to update firmware" - }, "webusb-not-supported": { "defaultMessage": "很抱歉,此瀏覽器不支援 WebUSB,您的程式將儲存至您的電腦。請依照下一個畫面上的步驟,將其傳輸至您的 micro:bit。我們建議您使用 Google Chrome 或 Microsoft Edge,以便能直接連線至您的 micro:bit。", "description": "Explantion shown when user's browser doesn't support WebUSB" diff --git a/src/messages/ui.ca.json b/src/messages/ui.ca.json index db70d5413..a789f7519 100644 --- a/src/messages/ui.ca.json +++ b/src/messages/ui.ca.json @@ -2417,18 +2417,6 @@ "value": "Torna a connectar la teva micro:bit i torna-ho a provar." } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "Has dactualitzar el microprogramari de la teva micro:bit per fer ús daquesta característica." - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "Actualitza el microprogramari de la micro:bit " - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.de.json b/src/messages/ui.de.json index 8cc1572e6..b4e57babe 100644 --- a/src/messages/ui.de.json +++ b/src/messages/ui.de.json @@ -2499,32 +2499,6 @@ "value": "Bitte schließe deinen micro:bit erneut an und versuche es nochmal." } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "Um diese Funktion nutzen zu können, musst du deine " - }, - { - "children": [ - { - "type": 0, - "value": "micro:bit Firmware aktualisieren " - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": "." - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "Bitte aktualisiere die micro:bit Firmware" - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.en.json b/src/messages/ui.en.json index 10477babc..0b5f4dff4 100644 --- a/src/messages/ui.en.json +++ b/src/messages/ui.en.json @@ -2430,13 +2430,13 @@ "webusb-error-clear-connect-description-2": [ { "type": 0, - "value": "Close any other tabs that may be using WebUSB (e.g. MakeCode, Python Editor), or unplug and replug the micro:bit before trying again." + "value": "Close any other pages or tabs that may be using WebUSB (e.g. MakeCode, Python Editor), or unplug and replug the micro:bit before trying again." } ], "webusb-error-clear-connect-title": [ { "type": 0, - "value": "Unable to claim interface" + "value": "Another page or browser tab is connected to this micro:bit" } ], "webusb-error-default-title": [ @@ -2446,35 +2446,61 @@ } ], "webusb-error-reconnect-microbit-description": [ - { - "type": 0, - "value": "Please reconnect your micro:bit and try again." - } - ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "You need to " - }, { "children": [ { "type": 0, - "value": "update your micro:bit firmware" + "value": "Please follow these steps, then try again:" } ], "type": 8, - "value": "link" + "value": "p" }, { - "type": 0, - "value": " to make use of this feature." - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "Please update the micro:bit firmware" + "children": [ + { + "children": [ + { + "type": 0, + "value": "unplug the USB cable" + } + ], + "type": 8, + "value": "li" + }, + { + "children": [ + { + "type": 0, + "value": "unplug the battery pack if one is attached" + } + ], + "type": 8, + "value": "li" + }, + { + "children": [ + { + "type": 0, + "value": "reconnect the USB cable" + } + ], + "type": 8, + "value": "li" + }, + { + "children": [ + { + "type": 0, + "value": "reconnect the battery pack if one was attached" + } + ], + "type": 8, + "value": "li" + } + ], + "type": 8, + "value": "ul" } ], "webusb-not-supported": [ diff --git a/src/messages/ui.es-es.json b/src/messages/ui.es-es.json index e8514d9fc..16521d834 100644 --- a/src/messages/ui.es-es.json +++ b/src/messages/ui.es-es.json @@ -2443,32 +2443,6 @@ "value": "Por favor reconecta el micro:bit e intentalo de nuevo." } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "Necesitas " - }, - { - "children": [ - { - "type": 0, - "value": "actualizar el firmware del micro:bit" - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": " para usar esta función." - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "Actualiza el firmware micro:bit" - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.fr.json b/src/messages/ui.fr.json index 6609d1414..c4ec989fe 100644 --- a/src/messages/ui.fr.json +++ b/src/messages/ui.fr.json @@ -2443,32 +2443,6 @@ "value": "Veuillez reconnecter votre micro:bit et réessayer." } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "Vous devez " - }, - { - "children": [ - { - "type": 0, - "value": "mettre à jour le micrologiciel de votre micro:bit" - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": " pour utiliser cette fonctionnalité." - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "Veuillez mettre à jour le micrologiciel de micro:bit" - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.ja.json b/src/messages/ui.ja.json index 0b4b8dbe5..2835a439d 100644 --- a/src/messages/ui.ja.json +++ b/src/messages/ui.ja.json @@ -2445,32 +2445,6 @@ "value": "micro:bitを再接続して、やり直してください。" } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "この機能を利用するには、" - }, - { - "children": [ - { - "type": 0, - "value": "micro:bitファームウェアを更新" - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": "する必要があります。" - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "micro:bit のファームウェアを更新してください。" - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.ko.json b/src/messages/ui.ko.json index 4813008aa..60055a44e 100644 --- a/src/messages/ui.ko.json +++ b/src/messages/ui.ko.json @@ -2439,32 +2439,6 @@ "value": "micro:bit 연결을 확인한 후, 다시 시도해 보세요." } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "이 기능을 활용하려면 " - }, - { - "children": [ - { - "type": 0, - "value": "micro:bit 펌웨어를 업데이트" - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": "해야 합니다." - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "micro:bit 펌웨어를 업데이트 하세요." - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.nl.json b/src/messages/ui.nl.json index af753f47b..b55ab54dd 100644 --- a/src/messages/ui.nl.json +++ b/src/messages/ui.nl.json @@ -2486,32 +2486,6 @@ "value": "Verbind je micro:bit opnieuw en probeer het nog eens." } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "Je moet " - }, - { - "children": [ - { - "type": 0, - "value": "je micro:bit firmware" - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": " updaten om deze functie te gebruiken." - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "Werk de firmware van de micro:bit bij" - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.zh-cn.json b/src/messages/ui.zh-cn.json index 360498f1c..6c57d2d5a 100644 --- a/src/messages/ui.zh-cn.json +++ b/src/messages/ui.zh-cn.json @@ -2452,32 +2452,6 @@ "value": "请重新连接 micro:bit 然后再次尝试。" } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "您需要 " - }, - { - "children": [ - { - "type": 0, - "value": "update your micro:bit firmware" - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": " 才能使用此功能。" - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "请更新 micro:bit 固件" - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/messages/ui.zh-tw.json b/src/messages/ui.zh-tw.json index fff0089b2..cf35b26e6 100644 --- a/src/messages/ui.zh-tw.json +++ b/src/messages/ui.zh-tw.json @@ -2451,32 +2451,6 @@ "value": "請重新連接你的 micro:bit 後再試一次。" } ], - "webusb-error-update-req-description": [ - { - "type": 0, - "value": "您需要" - }, - { - "children": [ - { - "type": 0, - "value": "更新您的 micro:bit 韌體" - } - ], - "type": 8, - "value": "link" - }, - { - "type": 0, - "value": ",以使用此功能。" - } - ], - "webusb-error-update-req-title": [ - { - "type": 0, - "value": "請更新 micro:bit 韌體" - } - ], "webusb-not-supported": [ { "type": 0, diff --git a/src/project/project-actions.tsx b/src/project/project-actions.tsx index c794e27bd..f370e1f60 100644 --- a/src/project/project-actions.tsx +++ b/src/project/project-actions.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: MIT */ import { Link, List, ListItem, Stack } from "@chakra-ui/layout"; -import { Text, VStack } from "@chakra-ui/react"; +import { Box, HStack, Text, UnorderedList, VStack } from "@chakra-ui/react"; import { isMakeCodeForV1Hex as isMakeCodeForV1HexNoErrorHandling } from "@microbit/microbit-universal-hex"; import { saveAs } from "file-saver"; import { ReactNode } from "react"; @@ -70,6 +70,9 @@ import { validateNewFilename, } from "./project-utils"; import ProjectNameQuestion from "./ProjectNameQuestion"; +import WebUSBErrorDialog from "../workbench/connect-dialogs/WebUSBErrorDialog"; +import reconnectWebm from "../workbench/connect-dialogs/reconnect.webm"; +import reconnectMp4 from "../workbench/connect-dialogs/reconnect.mp4"; /** * Distinguishes the different ways to trigger the load action. @@ -843,12 +846,11 @@ export class ProjectActions { await this.handleFirmwareUpdate(e.code, userAction, finalFocusRef); return; case "clear-connect": + return this.handleClearConnectError(finalFocusRef); case "timeout-error": - case "reconnect-microbit": { - return this.actionFeedback.expectedError( - this.webusbErrorMessage(e.code) - ); - } + return this.handleTimeoutError(finalFocusRef); + case "reconnect-microbit": + return this.handleReconnectMicrobitError(finalFocusRef); default: { return this.actionFeedback.unexpectedError(e); } @@ -873,72 +875,46 @@ export class ProjectActions { this.save(finalFocusRef, true); } - private webusbErrorMessage(code: WebUSBErrorCode) { - switch (code) { - case "update-req": - return { - title: this.intl.formatMessage({ - id: "webusb-error-update-req-title", - }), - description: ( - - {this.intl.formatMessage( - { - id: "webusb-error-update-req-description", - }, - { - link: (chunks: ReactNode) => ( - - {chunks} - - ), - } - )} - - ), - }; - case "clear-connect": - return { - title: this.intl.formatMessage({ - id: "webusb-error-clear-connect-title", - }), - description: ( - -

- {this.intl.formatMessage({ - id: "webusb-error-clear-connect-description-1", - })} -

-

- {this.intl.formatMessage({ - id: "webusb-error-clear-connect-description-2", - })} -

-
- ), - }; - case "reconnect-microbit": - return { - title: this.intl.formatMessage({ id: "webusb-error-default-title" }), - description: this.intl.formatMessage({ - id: "webusb-error-reconnect-microbit-description", - }), - }; - case "timeout-error": - return { - title: this.intl.formatMessage({ id: "timeout-error-title" }), - description: this.intl.formatMessage({ - id: "timeout-error-description", - }), - }; - default: - throw new Error("Unknown code"); - } + private async handleClearConnectError(finalFocusRef: FinalFocusRef) { + return this.dialogs.show((callback) => ( + +

+ {this.intl.formatMessage({ + id: "webusb-error-clear-connect-description-2", + })} +

+ + } + /> + )); + } + private async handleReconnectMicrobitError(finalFocusRef: FinalFocusRef) { + return this.dialogs.show((callback) => ( + } + /> + )); + } + + private async handleTimeoutError(finalFocusRef: FinalFocusRef) { + return this.dialogs.show((callback) => ( + } + /> + )); } private async handlePostSaveDialog(finalFocusRef: FinalFocusRef) { @@ -1046,3 +1022,30 @@ export const defaultedProject = ( name: fs.project.name ?? intl.formatMessage({ id: "untitled-project" }), }; }; + +const ReconnectTextAndVideo = () => ( + + + {chunks}, + li: (chunks: ReactNode) => ( + + {chunks} + + ), + ul: (chunks: ReactNode) => ( + {chunks} + ), + }} + /> + + + + + +); diff --git a/src/workbench/connect-dialogs/WebUSBErrorDialog.tsx b/src/workbench/connect-dialogs/WebUSBErrorDialog.tsx new file mode 100644 index 000000000..bf7288ead --- /dev/null +++ b/src/workbench/connect-dialogs/WebUSBErrorDialog.tsx @@ -0,0 +1,82 @@ +/** + * (c) 2021 - 2024, Micro:bit Educational Foundation and contributors + * + * SPDX-License-Identifier: MIT + */ +import { Button } from "@chakra-ui/button"; +import { HStack, Text, VStack } from "@chakra-ui/react"; +import { ReactNode, useCallback } from "react"; +import { FormattedMessage } from "react-intl"; +import { GenericDialog } from "../../common/GenericDialog"; +import { FinalFocusRef } from "../../project/project-actions"; + +interface WebUSBErrorDialogProps { + callback: () => void; + finalFocusRef: FinalFocusRef; + title: ReactNode; + description: ReactNode; +} + +export const WebUSBErrorDialog = ({ + callback, + finalFocusRef, + title, + description, +}: WebUSBErrorDialogProps) => { + const handleClose = useCallback(() => { + callback(); + }, [callback]); + return ( + } + footer={} + size="2xl" + /> + ); +}; + +interface WebUSBErrorBodyProps { + title: ReactNode; + description: ReactNode; +} + +const WebUSBErrorBody = ({ title, description }: WebUSBErrorBodyProps) => ( + + {typeof title === "string" ? ( + + {title} + + ) : ( + title + )} + {typeof description === "string" ? {description} : description} + +); + +interface WebUSBErrorDialogFooterProps { + onCancel: () => void; +} + +const WebUSBErrorDialogFooter = ({ + onCancel, +}: WebUSBErrorDialogFooterProps) => { + return ( + + + + ); +}; + +export default WebUSBErrorDialog; diff --git a/src/workbench/connect-dialogs/reconnect.mp4 b/src/workbench/connect-dialogs/reconnect.mp4 new file mode 100644 index 000000000..bed34541d Binary files /dev/null and b/src/workbench/connect-dialogs/reconnect.mp4 differ diff --git a/src/workbench/connect-dialogs/reconnect.webm b/src/workbench/connect-dialogs/reconnect.webm new file mode 100644 index 000000000..ba939d49b Binary files /dev/null and b/src/workbench/connect-dialogs/reconnect.webm differ