btc: default sign method to bridge to reduce master ticket exposure

This commit is contained in:
pkova 2021-06-04 13:55:57 +03:00
parent 2d76c3868e
commit 5a670b75cf
2 changed files with 26 additions and 10 deletions

View File

@ -48,7 +48,7 @@ export default class Send extends Component {
showModal: false,
note: '',
choosingSignMethod: false,
signMethod: 'Sign Transaction',
signMethod: 'bridge',
};
this.initPayment = this.initPayment.bind(this);
@ -86,7 +86,7 @@ export default class Send extends Component {
}
setSignMethod(signMethod) {
this.setState({signMethod});
this.setState({signMethod, choosingSignMethod: false});
}
checkPayee(e){
@ -204,7 +204,7 @@ export default class Send extends Component {
const signReady = (this.state.ready && (parseInt(this.state.satsAmount) > 0)) && !signing;
let invoice = null;
if (signMethod === 'Sign Transaction') {
if (signMethod === 'masterTicket') {
invoice =
<Invoice
network={network}
@ -218,7 +218,7 @@ export default class Send extends Component {
satsAmount={satsAmount}
state={this.props.state}
/>
} else if (signMethod === 'Sign with Bridge') {
} else if (signMethod === 'bridge') {
invoice =
<BridgeInvoice
state={this.props.state}
@ -439,6 +439,22 @@ export default class Send extends Component {
border='none'
style={{cursor: signReady ? 'pointer' : 'default'}} />
</Row>
{signMethod === 'masterTicket' &&
<Row mt={4}>
<Box
backgroundColor='orange'
color='white'
borderRadius='32px'
p={3}
>
<Col>
<Text color='white' fontWeight='bold' fontSize={1}>
To reduce the exposure of your master ticket we recommend signing transactions with Bridge
</Text>
</Col>
</Box>
</Row>
}
</Col>
}
</>

View File

@ -19,26 +19,26 @@ export default function Signer(props) {
backgroundColor='transparent'
fontWeight='bold'
cursor='pointer'
color={(signMethod === 'Sign Transaction') ? 'blue' : 'lightBlue'}
color={(signMethod === 'masterTicket') ? 'blue' : 'lightBlue'}
py='24px'
px='24px'
onClick={() => setSignMethod('Sign Transaction')}
children='Sign Transaction' />
onClick={() => setSignMethod('masterTicket')}
children='Sign with Master Ticket' />
<Button
border='none'
backgroundColor='transparent'
fontWeight='bold'
cursor='pointer'
color={(signMethod === 'Sign with Bridge') ? 'blue' : 'lightBlue'}
color={(signMethod === 'bridge') ? 'blue' : 'lightBlue'}
py='24px'
px='24px'
onClick={() => setSignMethod('Sign with Bridge')}
onClick={() => setSignMethod('bridge')}
children='Sign with Bridge' />
</Box>
:
<Button
primary
children={signMethod}
children={signMethod === 'bridge' ? 'Sign with Bridge' : 'Sign with Master Ticket'}
fontSize={1}
fontWeight='bold'
borderRadius='24px'