mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-13 10:04:15 +00:00
firmware: consolidate back/next button props
This reduces duplicate code and fixes "Back" not being translated on the last step.
This commit is contained in:
@@ -461,6 +461,8 @@ export const InstallPybricksDialog: React.VoidFunctionComponent = () => {
|
||||
title={i18n.translate('title')}
|
||||
isOpen={isOpen}
|
||||
onClose={() => dispatch(firmwareInstallPybricksDialogCancel())}
|
||||
backButtonProps={{ text: i18n.translate('backButton.label') }}
|
||||
nextButtonProps={{ text: i18n.translate('nextButton.label') }}
|
||||
finalButtonProps={{
|
||||
text: i18n.translate('flashFirmwareButton.label'),
|
||||
onClick: () =>
|
||||
@@ -482,7 +484,6 @@ export const InstallPybricksDialog: React.VoidFunctionComponent = () => {
|
||||
onCustomFirmwareZip={setCustomFirmwareZip}
|
||||
/>
|
||||
}
|
||||
nextButtonProps={{ text: i18n.translate('nextButton.label') }}
|
||||
/>
|
||||
<DialogStep
|
||||
id="license"
|
||||
@@ -495,7 +496,6 @@ export const InstallPybricksDialog: React.VoidFunctionComponent = () => {
|
||||
onLicenseAcceptedChanged={setLicenseAccepted}
|
||||
/>
|
||||
}
|
||||
backButtonProps={{ text: i18n.translate('backButton.label') }}
|
||||
nextButtonProps={{
|
||||
disabled: !licenseAccepted,
|
||||
text: i18n.translate('nextButton.label'),
|
||||
@@ -510,14 +510,11 @@ export const InstallPybricksDialog: React.VoidFunctionComponent = () => {
|
||||
onChangeHubName={setHubName}
|
||||
/>
|
||||
}
|
||||
backButtonProps={{ text: i18n.translate('backButton.label') }}
|
||||
nextButtonProps={{ text: i18n.translate('nextButton.label') }}
|
||||
/>
|
||||
<DialogStep
|
||||
id="bootloader"
|
||||
title={i18n.translate('bootloaderPanel.title')}
|
||||
panel={<BootloaderModePanel hubType={selectedHubType} />}
|
||||
backButtonProps={{ text: i18n.translate('backButton.label') }}
|
||||
/>
|
||||
</MultistepDialog>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user