on master help sign in
- pass showCrumbs through header props

- change conditionals to ternary style

commit76148f847af4f67b2445e0824ad25212a0d1808e authorChris Johnson <chris@cjohnson.io> dateMon 29 Apr 2019, 14:52 (8 years ago) parentf2e52b4
2 files changed+14−11
src/bridge/Bridge.js+13−8 src/bridge/components/Header.js+1−3
src/bridge/Bridge.js+13−8
@@ -277,15 +277,19 @@ class Bridge extends React.Component {
277277
278278 const View = router(routeCrumbs.peek())
279279
280− let colClass
281− let colStyle
280+ // For the invite acceptance flow, widen the screen to use the full
281+ // container, and hide the breadcrumbs
282+ const colClass = routeCrumbs.contains(ROUTE_NAMES.INVITE_TICKET)
283+ ? 'col-md-12'
284+ : 'col-md-offset-1 col-md-10'
282285
283− if (routeCrumbs.contains(ROUTE_NAMES.INVITE_TICKET)) {
284− colClass = 'col-md-12'
285− } else {
286− colClass = 'col-md-offset-1 col-md-10'
287− colStyle = {maxWidth: '620px'}
288− }
286+ const colStyle = routeCrumbs.contains(ROUTE_NAMES.INVITE_TICKET)
287+ ? {}
288+ : {maxWidth: '620px'}
289+
290+ const showCrumbs = routeCrumbs.contains(ROUTE_NAMES.INVITE_TICKET)
291+ ? false
292+ : true
289293
290294 return (
291295 <Container>
@@ -296,6 +300,7 @@ class Bridge extends React.Component {
296300 skipRoute={ this.skipRoute }
297301 networkType={ networkType }
298302 wallet={ wallet }
303+ showCrumbs={ showCrumbs }
299304 pointCursor={ pointCursor } />
300305
301306 <Row className={ 'row wrapper' }>
src/bridge/components/Header.js+1−3
@@ -41,9 +41,7 @@ const Crumbs = (props) => {
4141}
4242
4343const Header = (props) => {
44− let showCrumbs = !props.routeCrumbs.contains(ROUTE_NAMES.INVITE_TICKET)
45−
46− if (showCrumbs) {
44+ if (props.showCrumbs) {
4745 return (
4846 <div className={'flex items-center h-10'}>
4947 <Crumbs