Skip to content

Commit cd334de

Browse files
committed
Merge branch 'frontend-revert-campermission-warning'
2 parents c1c4ca2 + 9cf7634 commit cd334de

File tree

5 files changed

+7
-79
lines changed

5 files changed

+7
-79
lines changed

frontends/web/src/hooks/permissions.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

frontends/web/src/locales/en/app.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,9 +1216,6 @@
12161216
"paste": "to paste text, enable \"SHOW {{label}}\""
12171217
}
12181218
},
1219-
"permission": {
1220-
"camera": "Please grant camera access so the BitBoxApp can scan."
1221-
},
12221219
"random": {
12231220
"button": "Generate random number",
12241221
"description": "Your BitBox generated the following {{bits}}-bit random number:"

frontends/web/src/routes/account/send/components/dialogs/scan-qr-dialog.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ export const ScanQRDialog = ({ parseQRResult, activeScanQR, toggleScanQR, onChan
3232
return (
3333
<Dialog
3434
large
35-
onClose={toggleScanQR}
3635
open={activeScanQR}
37-
title={t('send.scanQR')}>
38-
<div style={{ minHeight: '300px' }}>
39-
<ScanQRVideo
40-
onResult={result => {
41-
parseQRResult(result);
42-
onChangeActiveScanQR(false);
43-
}} />
44-
</div>
36+
title={t('send.scanQR')}
37+
onClose={toggleScanQR}>
38+
<ScanQRVideo
39+
onResult={result => {
40+
parseQRResult(result);
41+
onChangeActiveScanQR(false);
42+
}} />
4543
<DialogButtons>
4644
<Button
4745
secondary

frontends/web/src/routes/account/send/components/inputs/scan-qr-video.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
*/
1616

1717
import { useRef } from 'react';
18-
import { useTranslation } from 'react-i18next';
1918
import { useQRScanner } from '../../../../../hooks/qrcodescanner';
20-
import { useDevicePermission } from '../../../../../hooks/permissions';
2119
import { SpinnerAnimation } from '../../../../../components/spinner/SpinnerAnimation';
2220
import style from '../../send.module.css';
2321

@@ -28,27 +26,20 @@ type TProps = {
2826
export const ScanQRVideo = ({
2927
onResult,
3028
}: TProps) => {
31-
const { t } = useTranslation();
3229
const videoRef = useRef<HTMLVideoElement>(null);
33-
const permission = useDevicePermission('camera');
3430

3531
useQRScanner(videoRef, {
3632
onResult: result => onResult(result.data),
3733
onError: console.error
3834
});
3935

40-
const permissionWarning = permission !== 'granted'
41-
? <div>{t('permission.camera')}</div>
42-
: null;
43-
4436
return (
4537
<>
4638
{/*As a "side effect", the spinner will always
4739
be hidden once the camera / video component
4840
gets loaded.*/}
4941
<div className={style.spinnerAnimationContainer}>
5042
<SpinnerAnimation />
51-
{permissionWarning}
5243
</div>
5344
<video
5445
className={style.qrVideo}

frontends/web/src/routes/account/send/send.module.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@
121121
.spinnerAnimationContainer {
122122
align-items: center;
123123
display: flex;
124-
flex-direction: column;
125-
gap: 4rem;
126124
height: 0;
127125
justify-content: center;
128126
position: relative;

0 commit comments

Comments
 (0)