Skip to content

Commit

Permalink
Prettier fixes + highlight that the buttons simulate behavior
Browse files Browse the repository at this point in the history
The simulation buttons are white text on a red background
  • Loading branch information
shankari committed Apr 11, 2024
1 parent ba3ef43 commit 6ca810d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions www/js/bluetooth/BluetoothCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ const BluetoothCard = ({ device, isClassic, isScanningBLE }: Props) => {
deviceWithBeacons.monitorResult = undefined;
deviceWithBeacons.rangeResult = undefined;
deviceWithBeacons.beacons = [
{uuid: device.uuid,
{
uuid: device.uuid,
major: device.major | 4567,
minor: device.minor | 1945,
proximity: "ProximityNear",
proximity: 'ProximityNear',
accuracy: Math.random() * 1.33,
rssi: Math.random() * -62}
]
rssi: Math.random() * -62,
},
];
deviceWithBeacons.minor = device.minor | 4567;
deviceWithBeacons.minor = device.minor | 4567;
window['cordova'].plugins.locationManager.getDelegate().didRangeBeaconsInRegion({
Expand All @@ -73,7 +75,12 @@ const BluetoothCard = ({ device, isClassic, isScanningBLE }: Props) => {
<Text style={{ backgroundColor: colors.secondaryContainer }} variant="bodyMedium">
{device.rangeResult}
</Text>
<Card.Actions >
<Text
style={{ backgroundColor: colors.danger, color: colors.background }}
variant="bodyMedium">
Simulate by sending UI transitions
</Text>
<Card.Actions style={{ backgroundColor: colors.danger, color: colors.background }}>
<Button mode="elevated" onPress={() => fakeMonitorCallback('CLRegionStateInside')}>
Enter
</Button>
Expand Down
2 changes: 1 addition & 1 deletion www/js/bluetooth/BluetoothScanPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const BluetoothScanPage = ({ ...props }: any) => {
...prevDevices,
[uuid]: {
...prevDevices[uuid],
monitorResult: status? result : undefined,
monitorResult: status ? result : undefined,
rangeResult: undefined,
in_range: status,
},
Expand Down

0 comments on commit 6ca810d

Please sign in to comment.