on master help sign in
Merge pull request #131 from urbit/checkbox-labels

Include label in CheckboxButton component

commit6475b53975e3c5d24ad58c4b7e4b6c9271a248cf authorFang <Fang-@users.noreply.github.com> dateMon 6 May 2019, 20:01 (7 years ago) parent31b6cc00a65727
3 files changed+11−13
src/bridge/components/CheckboxButton.js+3−1 src/bridge/components/StatelessTransaction.js+3−6 src/bridge/views/SetKeys.js+5−6
src/bridge/components/CheckboxButton.js+3−1
@@ -16,7 +16,8 @@ const CheckboxButton = props => {
1616 return (
1717 <div
1818 className={`flex items-center ${props.className}`}
19− style={props.style}>
19+ style={{cursor: 'pointer', ...props.style}}
20+ onClick={props.onToggle}>
2021
2122 <ProtoButton
2223 // {...getDomProps(props)}
@@ -38,6 +39,7 @@ const CheckboxButton = props => {
3839
3940 </ProtoButton>
4041
42+ <div>{ props.label }</div>
4143 { props.children }
4244
4345 </div>
src/bridge/components/StatelessTransaction.js+3−6
@@ -428,13 +428,10 @@ class StatelessTransaction extends React.Component {
428428 <CheckboxButton
429429 className={ 'mt-8' }
430430 disabled={ !canApprove }
431− onClick={ setUserApproval }
431+ onToggle={ setUserApproval }
432432 state={ userApproval }
433− >
434− <div onClick={ setUserApproval }>
435− { `I approve this transaction and wish to send.` }
436− </div>
437− </CheckboxButton>
433+ label='I approve this transaction and wish to send.'
434+ ></CheckboxButton>
438435
439436 const sendTxnButton =
440437 <Button
src/bridge/views/SetKeys.js+5−6
@@ -187,13 +187,12 @@ class SetKeys extends React.Component {
187187
188188 <CheckboxButton
189189 className='mt-8'
190− onClick={ this.toggleDiscontinuity }
190+ onToggle={ this.toggleDiscontinuity }
191191 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.)' }
195− </div>
196− </CheckboxButton>
192+ label={`I have lost important off-chain data relating to this point
193+ and need to do a hard-reset.
194+ (For example, rebooting an Arvo ship.)`}
195+ ></CheckboxButton>
197196
198197 <StatelessTransaction
199198 // Upper scope