parent
5ebdff6f92
commit
9368cfcf96
8 changed files with 110 additions and 53 deletions
Binary file not shown.
@ -1,36 +1,34 @@ |
||||
.video-js{ |
||||
.video-js { |
||||
width: 100% !important; |
||||
height: 100% !important; |
||||
border-radius: 20px; |
||||
button{ |
||||
&:focus{ |
||||
button { |
||||
&:focus { |
||||
outline: none !important; |
||||
} |
||||
} |
||||
.vjs-tech{ |
||||
border-radius: 20px; |
||||
.vjs-tech { |
||||
border-radius: 20px !important; |
||||
} |
||||
.vjs-big-play-button{ |
||||
font-size: 3.3em; |
||||
width: 50px; |
||||
height: 48px; |
||||
transform: translateX(25px); |
||||
background-color: #37D386; |
||||
border-radius: 50%; |
||||
border: 0px; |
||||
.vjs-big-play-button { |
||||
font-size: 3.3em !important; |
||||
width: 50px !important; |
||||
height: 48px !important; |
||||
transform: translateX(25px) !important; |
||||
background-color: #37d386 !important; |
||||
border-radius: 50% !important; |
||||
border: 0px !important; |
||||
} |
||||
.vjs-control-bar{ |
||||
.vjs-control-bar { |
||||
direction: ltr !important; |
||||
border-bottom-left-radius: 20px; |
||||
border-bottom-right-radius: 20px; |
||||
.vjs-progress-control{ |
||||
border-bottom-left-radius: 20px; |
||||
border-bottom-right-radius: 20px; |
||||
border-bottom-left-radius: 20px !important; |
||||
border-bottom-right-radius: 20px !important; |
||||
.vjs-progress-control { |
||||
border-bottom-left-radius: 20px !important; |
||||
border-bottom-right-radius: 20px !important; |
||||
& > * { |
||||
direction: ltr !important; |
||||
|
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
} |
||||
|
@ -1,42 +1,36 @@ |
||||
import React, { Component } from 'react' |
||||
import QrReader from 'react-qr-scanner' |
||||
import React, { Component } from "react"; |
||||
import QrReader from "react-qr-reader"; |
||||
|
||||
export default class Scanner extends Component { |
||||
constructor(props){ |
||||
super(props) |
||||
constructor(props) { |
||||
super(props); |
||||
this.state = { |
||||
delay: 100, |
||||
result: '', |
||||
} |
||||
result: "", |
||||
}; |
||||
|
||||
this.handleScan = this.handleScan.bind(this) |
||||
this.handleScan = this.handleScan.bind(this); |
||||
} |
||||
handleScan(data){ |
||||
handleScan(data) { |
||||
this.props.parent.setState({ |
||||
value: data, |
||||
}) |
||||
}); |
||||
} |
||||
|
||||
handleError(err){ |
||||
console.error(err) |
||||
handleError(err) { |
||||
console.error(err); |
||||
} |
||||
render(){ |
||||
const previewStyle = { |
||||
width: 320, |
||||
borderRadius: '10px' |
||||
} |
||||
|
||||
return( |
||||
render() { |
||||
return ( |
||||
<> |
||||
<QrReader |
||||
delay={this.state.delay} |
||||
style={previewStyle} |
||||
delay={300} |
||||
onError={this.handleError} |
||||
onScan={this.handleScan} |
||||
legacyMode={true} |
||||
facingMode={'user'} |
||||
/> |
||||
style={{ width: "100%" }} |
||||
facingMode={this.props.parent.state.facingMode} |
||||
/> |
||||
</> |
||||
) |
||||
); |
||||
} |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue