Skip to content

Commit b7505b4

Browse files
committed
Merge branch 'select-bb-ios'
2 parents 0c8e947 + d6ccf1c commit b7505b4

File tree

4 files changed

+42
-11
lines changed

4 files changed

+42
-11
lines changed

frontends/web/src/components/bluetooth/bluetooth.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
margin-top: var(--spacing-default);
66
}
77

8+
.innerContainer {
9+
background: var(--background);
10+
}
11+
812
.label {
913
margin-top: var(--spacing-default);
1014
}
@@ -22,4 +26,4 @@
2226
.label {
2327
text-align: center;
2428
}
25-
}
29+
}

frontends/web/src/components/bluetooth/bluetooth.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ const isConnectedOrConnecting = (peripheral: TPeripheral) => {
3131
return peripheral.connectionState === 'connecting' || peripheral.connectionState === 'connected';
3232
};
3333

34-
const _Bluetooth = () => {
34+
type Props = {
35+
peripheralContainerClassName?: string;
36+
}
37+
38+
const _Bluetooth = ({ peripheralContainerClassName }: Props) => {
3539
const { t } = useTranslation();
3640
const state = useSync(getState, syncState);
3741
const [showConnectionIssues, setShowConnectionIssues] = useState(false);
@@ -85,6 +89,7 @@ const _Bluetooth = () => {
8589
) : undefined;
8690
return (
8791
<ActionableItem
92+
className={peripheralContainerClassName}
8893
key={peripheral.identifier}
8994
icon={connectingIcon}
9095
onClick={onClick}>
@@ -109,7 +114,9 @@ const _Bluetooth = () => {
109114
})}
110115
</div>
111116
{state.scanning && (
112-
<HorizontallyCenteredSpinner />
117+
<div>
118+
<HorizontallyCenteredSpinner />
119+
</div>
113120
)}
114121

115122
{showConnectionIssues && (
@@ -131,9 +138,9 @@ const _Bluetooth = () => {
131138
);
132139
};
133140

134-
export const Bluetooth = () => {
141+
export const Bluetooth = ({ peripheralContainerClassName = '' }: Props) => {
135142
if (!runningInIOS()) {
136143
return null;
137144
}
138-
return <_Bluetooth />;
145+
return <_Bluetooth peripheralContainerClassName={peripheralContainerClassName} />;
139146
};

frontends/web/src/components/keystoreconnectprompt.module.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
margin-bottom: calc(var(--space-default) + var(--space-quarter));
44
}
55

6-
.bitboxContainer > div img {
6+
.bitboxContainer > div > img {
77
width: 198px;
88
height: 115px;
99
margin-right: var(--space-default);
@@ -14,6 +14,9 @@
1414
height: 20px;
1515
}
1616

17+
.bluetoothPeripheralContainer {
18+
background: var(--background);
19+
}
1720

1821
.bitboxContainer.failed {
1922
align-items: center;
@@ -36,8 +39,17 @@
3639
font-size: 16px;
3740
}
3841

42+
.dialogButtonsContainer {
43+
margin-top: var(--space-large);
44+
}
45+
46+
.unlockTestButtonContainer {
47+
margin-top: calc(var(--space-large) + var(--space-default));
48+
}
49+
3950
@media (max-width: 768px) {
4051
.text {
4152
font-size: var(--size-default);
4253
}
4354
}
55+

frontends/web/src/components/keystoreconnectprompt.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
import { useTranslation } from 'react-i18next';
1818
import { ReactElement } from 'react';
1919
import { Button } from './forms';
20+
import { Bluetooth } from '@/components/bluetooth/bluetooth';
2021
import { TConnectKeystoreErrorCode, cancelConnectKeystore, syncConnectKeystore } from '@/api/backend';
2122
import { useSubscribeReset } from '@/hooks/api';
2223
import { Dialog, DialogButtons } from './dialog/dialog';
2324
import { BitBox02StylizedDark, BitBox02StylizedLight, Cancel, PointToBitBox02 } from './icon';
2425
import { useDarkmode } from '@/hooks/darkmode';
2526
import { UseBackButton } from '@/hooks/backbutton';
27+
import { runningInIOS } from '@/utils/env';
2628
import { SkipForTesting } from '@/routes/device/components/skipfortesting';
2729
import styles from './keystoreconnectprompt.module.css';
2830

@@ -82,13 +84,19 @@ export const KeystoreConnectPrompt = () => {
8284
Software keystore is unlocked from the app, so we add the SkipForTesting button here (only for development).
8385
The BitBox02 unlock is triggered by inserting it using the globally mounted BitBox02Wizard.
8486
The BitBox01 is ignored - BitBox01 users will simply need to unlock before being prompted.
87+
For iOS, the device picker is needed.
8588
*/}
86-
<PointToBitBox02 />
87-
<SkipForTesting />
89+
{ !runningInIOS() ? <PointToBitBox02 /> : null }
90+
<Bluetooth peripheralContainerClassName={styles.bluetoothPeripheralContainer} />
91+
<div className={!runningInIOS() ? '' : styles.unlockTestButtonContainer}>
92+
<SkipForTesting />
93+
</div>
94+
</div>
95+
<div className={styles.dialogButtonsContainer}>
96+
<DialogButtons>
97+
<Button secondary onClick={cancelConnectKeystore}>{t('dialog.cancel')}</Button>
98+
</DialogButtons>
8899
</div>
89-
<DialogButtons>
90-
<Button secondary onClick={cancelConnectKeystore}>{t('dialog.cancel')}</Button>
91-
</DialogButtons>
92100
</Dialog>
93101
);
94102
case 'error':

0 commit comments

Comments
 (0)