-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pending and permission granted stories for idcapture
- Loading branch information
Showing
1 changed file
with
31 additions
and
8 deletions.
There are no files selected for viewing
39 changes: 31 additions & 8 deletions
39
packages/components/document-capture/id-capture/src/IdCaptureScreen.stories.js
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 |
---|---|---|
@@ -1,18 +1,41 @@ | ||
import { SmartCamera } from "../../../domain/camera/SmartCamera"; | ||
import "./index"; | ||
|
||
const meta = { | ||
component: "id-capture", | ||
render: () => ` | ||
<id-capture | ||
show-navigation | ||
document-capture-modes="camera,upload" | ||
> | ||
</id-capture> | ||
`, | ||
}; | ||
|
||
export default meta; | ||
|
||
|
||
export const IdCaptureScreenPendingPermission = { | ||
loaders: [ | ||
async () => ({ | ||
'data-camera-ready': SmartCamera.stopMedia(), | ||
}), | ||
], | ||
} | ||
export const IdCaptureScreen = { | ||
render: () => ` | ||
<id-capture | ||
show-navigation | ||
document-capture-modes="camera,upload" | ||
> | ||
</id-capture> | ||
`, | ||
} | ||
loaders: [ | ||
async () => ({ | ||
'data-camera-ready': await SmartCamera.getMedia({ | ||
audio: false, | ||
video: { | ||
facingMode: 'environment', | ||
width: { min: 1280 }, | ||
// NOTE: Special case for multi-camera Samsung devices (learnt from Acuant) | ||
// "We found out that some triple camera Samsung devices (S10, S20, Note 20, etc) capture images blurry at edges. | ||
// Zooming to 2X, matching the telephoto lens, doesn't solve it completely but mitigates it." | ||
zoom: SmartCamera.isSamsungMultiCameraDevice() ? 2.0 : 1.0, | ||
}, | ||
}) | ||
}), | ||
], | ||
} |