on master help sign in
Merge pull request #131 from urbit/checkbox-labels
6475b53Fang
src/bridge/components/CheckboxButton.js+3−1
@@ -16,7 +16,8 @@ const CheckboxButton = props => {
16 return (
16 return (
17 <div
17 <div
18 className={`flex items-center ${props.className}`}
18 className={`flex items-center ${props.className}`}
19− style={props.style}>
19+ style={{cursor: 'pointer', ...props.style}}
20+ onClick={props.onToggle}>
20
21
21 <ProtoButton
22 <ProtoButton
22 // {...getDomProps(props)}
23 // {...getDomProps(props)}
@@ -38,6 +39,7 @@ const CheckboxButton = props => {
38
39
39 </ProtoButton>
40 </ProtoButton>
40
41
42+ <div>{ props.label }</div>
41 { props.children }
43 { props.children }
42
44
43 </div>
45 </div>
src/bridge/components/StatelessTransaction.js+3−6
@@ -428,13 +428,10 @@ class StatelessTransaction extends React.Component {
428 <CheckboxButton
428 <CheckboxButton
429 className={ 'mt-8' }
429 className={ 'mt-8' }
430 disabled={ !canApprove }
430 disabled={ !canApprove }
431− onClick={ setUserApproval }
431+ onToggle={ setUserApproval }
432 state={ userApproval }
432 state={ userApproval }
433− >
434− <div onClick={ setUserApproval }>
435− { `I approve this transaction and wish to send.` }
433+ label='I approve this transaction and wish to send.'
436− </div>
437− </CheckboxButton>
434+ ></CheckboxButton>
438
435
439 const sendTxnButton =
436 const sendTxnButton =
440 <Button
437 <Button
src/bridge/views/SetKeys.js+5−6
@@ -187,13 +187,12 @@ class SetKeys extends React.Component {
187
187
188 <CheckboxButton
188 <CheckboxButton
189 className='mt-8'
189 className='mt-8'
190− onClick={ this.toggleDiscontinuity }
190+ onToggle={ this.toggleDiscontinuity }
191 state={ state.discontinuity }
191 state={ state.discontinuity }
192− >
193− <div style={{cursor: 'pointer'}} onClick={ this.toggleDiscontinuity }>
194− { 'I have lost important off-chain data relating to this point and need to do a hard-reset. (For example, rebooting an Arvo ship.)' }
192+ label={`I have lost important off-chain data relating to this point
195− </div>
193+ and need to do a hard-reset.
194+ (For example, rebooting an Arvo ship.)`}
196− </CheckboxButton>
195+ ></CheckboxButton>
197
196
198 <StatelessTransaction
197 <StatelessTransaction
199 // Upper scope
198 // Upper scope