Allow base referral URL to be configurable

pull/21833/head
Luke Barnard 2017-01-31 15:17:43 +00:00
parent c2b0c603c0
commit c261ca1f5e
2 changed files with 5 additions and 1 deletions

View File

@ -171,6 +171,7 @@ export default React.createClass({
brand={this.props.config.brand} brand={this.props.config.brand}
collapsedRhs={this.props.collapse_rhs} collapsedRhs={this.props.collapse_rhs}
enableLabs={this.props.config.enableLabs} enableLabs={this.props.config.enableLabs}
referralBaseUrl={this.props.config.referralBaseUrl}
/>; />;
if (!this.props.collapse_rhs) right_panel = <RightPanel opacity={this.props.sideOpacity}/>; if (!this.props.collapse_rhs) right_panel = <RightPanel opacity={this.props.sideOpacity}/>;
break; break;

View File

@ -92,6 +92,9 @@ module.exports = React.createClass({
// True to show the 'labs' section of experimental features // True to show the 'labs' section of experimental features
enableLabs: React.PropTypes.bool, enableLabs: React.PropTypes.bool,
// The base URL to use in the referral link. Defaults to window.location.origin.
referralBaseUrl: React.PropTypes.string,
// true if RightPanel is collapsed // true if RightPanel is collapsed
collapsedRhs: React.PropTypes.bool, collapsedRhs: React.PropTypes.bool,
}, },
@ -453,7 +456,7 @@ module.exports = React.createClass({
console.warn('Team token not a string'); console.warn('Team token not a string');
return null; return null;
} }
const href = window.location.origin + const href = (this.props.referralBaseUrl || window.location.origin) +
`/#/register?referrer=${this._me}&team_token=${teamToken}`; `/#/register?referrer=${this._me}&team_token=${teamToken}`;
return ( return (
<div> <div>