Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added qrcode scanning, styling is still rough
- Loading branch information
Guillaume Louvigny
committed
Dec 4, 2018
1 parent
fd68a64
commit 18b8712
Showing
13 changed files
with
273 additions
and
63 deletions.
There are no files selected for viewing
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
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
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,24 @@ | ||
import React from 'react' | ||
import QRCodeScanner from 'react-native-qrcode-scanner' | ||
|
||
const QRReader = ({ onFound, style }) => <QRCodeScanner | ||
onRead={event => onFound(event.data)} | ||
onError={error => { | ||
console.error(error) | ||
}} | ||
containerStyle={style} | ||
topViewStyle={{ | ||
flex: 0, | ||
width: 0, | ||
height: 0, | ||
}} | ||
bottomViewStyle={{ | ||
flex: 0, | ||
width: 0, | ||
height: 0, | ||
}} | ||
cameraStyle={{ flex: 1, width: undefined, height: undefined, overflow: 'hidden' }} | ||
fadeIn={false} | ||
/> | ||
|
||
export default QRReader |
13 changes: 13 additions & 0 deletions
13
client/react-native/common/components/Library/QRReader.web.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import QrReader from 'react-qr-reader' | ||
|
||
const QRReader = ({ onFound, style }) => <QrReader | ||
onScan={onFound} | ||
onError={error => { | ||
console.error(error) | ||
}} | ||
style={style} | ||
showViewFinder={false} | ||
/> | ||
|
||
export default QRReader |
20 changes: 0 additions & 20 deletions
20
client/react-native/common/components/Library/QRReader/QRReader.js
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
client/react-native/common/components/Library/QRReader/QRReader.native.js
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.