Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 7907165

Browse files
takaokoujiGemini
andcommitted
fix: correctly apply styles to firmware update instructions
- Wrap FormattedMessage in Box components to apply className - Ensure MicrobitMore instructions and success/fail messages are styled correctly Co-Authored-By: Gemini <noreply@google.com>
1 parent 04c9aa7 commit 7907165

1 file changed

Lines changed: 29 additions & 22 deletions

File tree

src/components/connection-modal/update-peripheral-step.jsx

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,32 @@ class UpdatePeripheralStep extends React.Component {
139139
if (this.props.extensionId === 'microbitMore') {
140140
resultsContent = (
141141
<Box className={styles.scratchLinkError}>
142+
<Box className={styles.centeredRow}>
143+
<FormattedMessage
144+
defaultMessage="MicrobitMore update successful!"
145+
description="Message to indicate that the MicrobitMore update was successful"
146+
id="gui.connection.updatePeripheral.microbitMoreUpdateSuccessful"
147+
/>
148+
</Box>
149+
<Box className={classNames(styles.centeredRow, styles.importantInstruction)}>
150+
<FormattedMessage
151+
defaultMessage="Tilt your micro:bit to light up all 25 LEDs to complete."
152+
description="Instructions to tilt the micro:bit to complete the update process"
153+
id="gui.connection.updatePeripheral.microbitMoreTiltToLightUp"
154+
/>
155+
</Box>
156+
</Box>
157+
);
158+
} else {
159+
resultsContent = (
160+
<Box className={styles.centeredRow}>
142161
<FormattedMessage
143-
className={styles.centeredRow}
144-
defaultMessage="MicrobitMore update successful!"
145-
description="Message to indicate that the MicrobitMore update was successful"
146-
id="gui.connection.updatePeripheral.microbitMoreUpdateSuccessful"
147-
/>
148-
<FormattedMessage
149-
className={classNames(styles.centeredRow, styles.importantInstruction)}
150-
defaultMessage="Tilt your micro:bit to light up all 25 LEDs to complete."
151-
description="Instructions to tilt the micro:bit to complete the update process"
152-
id="gui.connection.updatePeripheral.microbitMoreTiltToLightUp"
162+
defaultMessage="Update successful!"
163+
description="Message to indicate that the peripheral update was successful"
164+
id="gui.connection.updatePeripheral.updateSuccessful"
153165
/>
154166
</Box>
155167
);
156-
} else {
157-
resultsContent = (<FormattedMessage
158-
defaultMessage="Update successful!"
159-
description="Message to indicate that the peripheral update was successful"
160-
id="gui.connection.updatePeripheral.updateSuccessful"
161-
/>);
162168
}
163169
} else if (this.state.err.message === 'No valid interfaces found.') {
164170
// this is a special case where the micro:bit's communication firmware is too old to support WebUSB
@@ -179,12 +185,13 @@ class UpdatePeripheralStep extends React.Component {
179185
} else {
180186
resultsContent = (
181187
<Box className={styles.scratchLinkError}>
182-
<FormattedMessage
183-
className={styles.centeredRow}
184-
defaultMessage="Update failed."
185-
description="Message to indicate that the peripheral update failed"
186-
id="gui.connection.updatePeripheral.updateFailed"
187-
/>
188+
<Box className={styles.centeredRow}>
189+
<FormattedMessage
190+
defaultMessage="Update failed."
191+
description="Message to indicate that the peripheral update failed"
192+
id="gui.connection.updatePeripheral.updateFailed"
193+
/>
194+
</Box>
188195
<textarea
189196
className={styles.scratchLinkErrorDetails}
190197
readOnly

0 commit comments

Comments
 (0)