-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1088 from ParabolInc/segment-hotfix
- Loading branch information
Showing
30 changed files
with
986 additions
and
820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, {Component} from 'react'; | ||
import Helmet from 'react-helmet'; | ||
|
||
export default class ParabolHelmet extends Component { | ||
static contextTypes = { | ||
analytics: PropTypes.object | ||
}; | ||
|
||
static propTypes = { | ||
title: PropTypes.string | ||
}; | ||
|
||
componentDidMount() { | ||
this.context.analytics.title = this.props.title; | ||
} | ||
|
||
componentWillReceiveProps(nextProps) { | ||
if (nextProps.title !== this.props.title) { | ||
this.context.analytics.title = nextProps.title; | ||
} | ||
} | ||
|
||
render() { | ||
return <Helmet {...this.props} />; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,35 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, {Component} from 'react'; | ||
import React from 'react'; | ||
import {DragDropContext as dragDropContext} from 'react-dnd'; | ||
import HTML5Backend from 'react-dnd-html5-backend'; | ||
import {Switch} from 'react-router-dom'; | ||
import {socketClusterReducer} from 'redux-socket-cluster'; | ||
import AsyncRoute from 'universal/components/AsyncRoute/AsyncRoute'; | ||
import socketWithPresence from 'universal/decorators/socketWithPresence/socketWithPresence'; | ||
import withReducer from '../../decorators/withReducer/withReducer'; | ||
import withAsync from 'react-async-hoc'; | ||
|
||
const parentMod = () => System.import('universal/components/DashboardWrapper/DashboardWrapper'); | ||
const meetingMod = () => System.import('universal/modules/meeting/containers/MeetingContainer/MeetingContainer'); | ||
|
||
class SocketRoute extends Component { | ||
shouldComponentUpdate() { | ||
return false; | ||
} | ||
render() { | ||
return ( | ||
<Switch> | ||
<AsyncRoute | ||
path="(/me|/newteam|/team)" | ||
mod={parentMod} | ||
/> | ||
<AsyncRoute | ||
path="/meeting/:teamId/:localPhase?/:localPhaseItem?" | ||
mod={meetingMod} | ||
/> | ||
</Switch> | ||
); | ||
} | ||
} | ||
const dashWrapper = () => System.import('universal/components/DashboardWrapper/DashboardWrapper'); | ||
const meetingContainer = () => System.import('universal/modules/meeting/containers/MeetingContainer/MeetingContainer'); | ||
|
||
const SocketRoute = () => { | ||
return ( | ||
<Switch> | ||
<AsyncRoute isAbstract path="(/me|/newteam|/team)" mod={dashWrapper} /> | ||
<AsyncRoute path="/meeting/:teamId/:localPhase?/:localPhaseItem?" mod={meetingContainer} /> | ||
</Switch> | ||
); | ||
}; | ||
|
||
SocketRoute.propTypes = { | ||
match: PropTypes.object.isRequired | ||
}; | ||
|
||
const fetchStyles = { | ||
'/static/css/Draft.css': () => ({stylesLoaded: true}) | ||
}; | ||
|
||
export default | ||
withAsync(undefined, fetchStyles)( | ||
withReducer({socket: socketClusterReducer})( | ||
dragDropContext(HTML5Backend)( | ||
socketWithPresence( | ||
SocketRoute | ||
) | ||
withReducer({socket: socketClusterReducer})( | ||
dragDropContext(HTML5Backend)( | ||
socketWithPresence( | ||
SocketRoute | ||
) | ||
) | ||
); |
Oops, something went wrong.