-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: camera should correctly pick up qr codes on chrome (#193)
* fix: use canvas to capture video feed when capturing via camera * refactor: move scan qr code modal contents to seprate components * feat: only show scan via camera option when camera is available * chore: squash
- Loading branch information
1 parent
09b468e
commit 252b07b
Showing
32 changed files
with
380 additions
and
182 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/extension/components/ScanQRCodeViaCameraModalContent/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './ScanQRCodeViaCameraModalContent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './ScanQRCodeViaTabModalContent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
enum ScanModeEnum { | ||
Camera = 'camera', | ||
Tab = 'tab', | ||
} | ||
|
||
export default ScanModeEnum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// enums | ||
import { ErrorCodeEnum } from '../enums'; | ||
|
||
// errors | ||
import BaseExtensionError from './BaseExtensionError'; | ||
|
||
export default class CameraNotAllowedError extends BaseExtensionError { | ||
public readonly code: ErrorCodeEnum = ErrorCodeEnum.CameraNotAllowedError; | ||
public readonly name: string = 'CameraNotAllowedError'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// enums | ||
import { ErrorCodeEnum } from '../enums'; | ||
|
||
// errors | ||
import BaseExtensionError from './BaseExtensionError'; | ||
|
||
export default class CameraNotFoundError extends BaseExtensionError { | ||
public readonly code: ErrorCodeEnum = ErrorCodeEnum.CameraNotFoundError; | ||
public readonly name: string = 'CameraNotFoundError'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './useCameraStream'; |
13 changes: 13 additions & 0 deletions
13
src/extension/hooks/useCameraStream/types/IUseCameraStreamState.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// errors | ||
import { BaseExtensionError } from '@extension/errors'; | ||
|
||
interface IUseCameraStreamState { | ||
error: BaseExtensionError | null; | ||
loading: boolean; | ||
reset: () => void; | ||
startStream: () => Promise<void>; | ||
stopStream: () => void; | ||
stream: MediaStream | null; | ||
} | ||
|
||
export default IUseCameraStreamState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type { default as IUseCameraStreamState } from './IUseCameraStreamState'; |
Oops, something went wrong.