diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index cf4a63e2f7..ab2b73711a 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -444,6 +444,27 @@ module.exports = React.createClass({
);
},
+ _renderReferral: function() {
+ const teamToken = window.localStorage.getItem('mx_team_token');
+ if (!teamToken) {
+ return null;
+ }
+ if (typeof teamToken !== 'string') {
+ console.warn('Team token not a string');
+ return null;
+ }
+ const href = window.location.origin +
+ `/#/register?referrer=${this._me}&team_token=${teamToken}`;
+ return (
+
+
Referral
+
+ Refer a friend to Riot:
{href}
+
+
+ );
+ },
+
_renderUserInterfaceSettings: function() {
var client = MatrixClientPeg.get();
@@ -819,6 +840,8 @@ module.exports = React.createClass({
{accountJsx}
+ {this._renderReferral()}
+
{notification_area}
{this._renderUserInterfaceSettings()}
diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js
index 82cdbef9ca..d38441a76c 100644
--- a/src/components/structures/login/Registration.js
+++ b/src/components/structures/login/Registration.js
@@ -57,7 +57,7 @@ module.exports = React.createClass({
// URL of the riot-team-server to get team configurations and track referrals
teamServerURL: React.PropTypes.string.isRequired,
}),
- teamSelected: null,
+ teamSelected: React.PropTypes.object,
defaultDeviceDisplayName: React.PropTypes.string,