firmware/installPybricksDialog: remove hard-coded hub name size check

The UI has been rearranged so we now have firmware metadata available
when we validate the hub name.
This commit is contained in:
David Lechner
2023-02-16 14:10:07 -06:00
committed by David Lechner
parent 13c69918e1
commit a841562c6c
3 changed files with 76 additions and 10 deletions
@@ -376,15 +376,17 @@ const AcceptLicensePanel: React.VoidFunctionComponent<AcceptLicensePanelProps> =
type SelectOptionsPanelProps = {
hubName: string;
metadata: FirmwareMetadata | undefined;
onChangeHubName(hubName: string): void;
};
const ConfigureOptionsPanel: React.VoidFunctionComponent<SelectOptionsPanelProps> = ({
hubName,
metadata,
onChangeHubName,
}) => {
const i18n = useI18n();
const isHubNameValid = validateHubName(hubName);
const isHubNameValid = metadata ? validateHubName(hubName, metadata) : true;
return (
<div className={dialogBody}>
@@ -512,6 +514,11 @@ export const InstallPybricksDialog: React.VoidFunctionComponent = () => {
panel={
<ConfigureOptionsPanel
hubName={hubName}
metadata={
isCustomFirmwareRequested
? customFirmwareData?.metadata
: firmwareData?.metadata
}
onChangeHubName={setHubName}
/>
}