diff --git a/src/components/AddDeviceFooter/AddDeviceFooter.tsx b/src/components/AddDeviceFooter/AddDeviceFooter.tsx index 9da87d9..8a77307 100644 --- a/src/components/AddDeviceFooter/AddDeviceFooter.tsx +++ b/src/components/AddDeviceFooter/AddDeviceFooter.tsx @@ -10,6 +10,11 @@ import SerialInput from './SerialInput'; const SERIAL_SIZE = 8; const INPUT_PLACEHOLDER = `Insert ${SERIAL_SIZE} digits serial`; +interface Props { + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; +} + const buildOptions = (devices: Pax.lib.Devices[]) => { return devices.map(device => { return { value: device, label: device }; @@ -23,7 +28,7 @@ const addNewDeviceButtonDisabled = (serialInput: string | undefined) => { return false; }; -const AddDeviceFooter = () => { +const AddDeviceFooter = (props: Props) => { const defaultDevice = SUPPORTED_DEVICES[0]; const [serialInput, setSerialInput] = useState(undefined); const [deviceValue, setDeviceValue] = @@ -56,6 +61,8 @@ const AddDeviceFooter = () => { value={serialInput} onValueChange={setSerialInput} placeholder={INPUT_PLACEHOLDER} + onFocus={props.onFocus} + onBlur={props.onBlur} />