summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webapp/components/logged_in.jsx16
-rw-r--r--webapp/components/sidebar.jsx8
-rw-r--r--webapp/components/textbox.jsx2
-rw-r--r--webapp/sass/layout/_post.scss2
-rw-r--r--webapp/sass/routes/_signup.scss15
-rw-r--r--webapp/utils/utils.jsx13
6 files changed, 37 insertions, 19 deletions
diff --git a/webapp/components/logged_in.jsx b/webapp/components/logged_in.jsx
index fd09aac9e..f7a6be647 100644
--- a/webapp/components/logged_in.jsx
+++ b/webapp/components/logged_in.jsx
@@ -14,6 +14,7 @@ const TutorialSteps = Constants.TutorialSteps;
const Preferences = Constants.Preferences;
import ErrorBar from 'components/error_bar.jsx';
import * as Websockets from 'action_creators/websocket_actions.jsx';
+import LoadingScreen from 'components/loading_screen.jsx';
import {browserHistory} from 'react-router';
@@ -44,6 +45,13 @@ export default class LoggedIn extends React.Component {
super(params);
this.onUserChanged = this.onUserChanged.bind(this);
+
+ this.state = {
+ user: null
+ };
+ }
+ isValidState() {
+ return this.state.user != null;
}
onUserChanged() {
// Grab the current user
@@ -75,6 +83,8 @@ export default class LoggedIn extends React.Component {
if (tutorialStep <= TutorialSteps.INTRO_SCREENS) {
browserHistory.push(Utils.getTeamURLFromAddressBar() + '/tutorial');
}
+
+ this.setState({user});
}
componentWillMount() {
// Emit view action
@@ -186,6 +196,8 @@ export default class LoggedIn extends React.Component {
Websockets.close();
UserStore.removeChangeListener(this.onUserChanged);
+ Utils.resetTheme();
+
$('body').off('click.userpopover');
$('body').off('mouseenter mouseleave', '.post');
$('body').off('mouseenter mouseleave', '.post.post--comment.same--root');
@@ -195,6 +207,10 @@ export default class LoggedIn extends React.Component {
$(window).off('keydown.preventBackspace');
}
render() {
+ if (!this.isValidState()) {
+ return <LoadingScreen/>;
+ }
+
let content = [];
if (this.props.children) {
content = this.props.children;
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx
index 45bca7212..b22d3ec34 100644
--- a/webapp/components/sidebar.jsx
+++ b/webapp/components/sidebar.jsx
@@ -238,7 +238,9 @@ export default class Sidebar extends React.Component {
});
}
- handleLeaveDirectChannel(channel) {
+ handleLeaveDirectChannel(e, channel) {
+ e.preventDefault();
+
if (!this.isLeaving.get(channel.id)) {
this.isLeaving.set(channel.id, true);
@@ -258,7 +260,7 @@ export default class Sidebar extends React.Component {
}
if (channel.id === this.state.activeId) {
- browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/town-square');
+ browserHistory.push('/' + this.state.currentTeam.name + '/channels/town-square');
}
}
@@ -422,7 +424,7 @@ export default class Sidebar extends React.Component {
overlay={removeTooltip}
>
<span
- onClick={() => handleClose(channel)}
+ onClick={(e) => handleClose(e, channel)}
className='btn-close'
>
{'×'}
diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx
index 63d5486a4..c77e1f9a3 100644
--- a/webapp/components/textbox.jsx
+++ b/webapp/components/textbox.jsx
@@ -130,7 +130,7 @@ export default class Textbox extends React.Component {
const helpText = (
<div
- style={{visibility: hasText ? 'visible' : 'hidden', opacity: hasText ? '0.5' : '0'}}
+ style={{visibility: hasText ? 'visible' : 'hidden', opacity: hasText ? '0.3' : '0'}}
className='help__format-text'
>
<b>
diff --git a/webapp/sass/layout/_post.scss b/webapp/sass/layout/_post.scss
index 05ef09643..f29448bde 100644
--- a/webapp/sass/layout/_post.scss
+++ b/webapp/sass/layout/_post.scss
@@ -77,7 +77,7 @@ body.ios {
.help__format-text {
@include opacity(0);
- @include single-transition(all .2s ease);
+ @include single-transition(all, .5s, ease, .5s);
display: inline-block;
font-size: .85em;
margin-right: 10px;
diff --git a/webapp/sass/routes/_signup.scss b/webapp/sass/routes/_signup.scss
index 062e4c9a5..6d6092170 100644
--- a/webapp/sass/routes/_signup.scss
+++ b/webapp/sass/routes/_signup.scss
@@ -98,7 +98,6 @@
.inner__content {
margin: 30px 0 20px;
- padding: 0 1rem;
}
.block--gray {
@@ -132,14 +131,12 @@
font-size: 2.2em;
font-weight: 600;
margin: .5em 0 0;
- padding-left: 1rem;
}
.signup-team__subdomain {
font-size: 1.5em;
font-weight: 300;
margin: .2em 0 1.2em;
- padding-left: 1rem;
text-transform: uppercase;
}
@@ -151,6 +148,7 @@
background: #dddddd;
height: 1px;
margin: 2em 0;
+ margin: 2.5em 0 2.5em -1rem;
text-align: left;
span {
@@ -171,10 +169,6 @@
padding-left: 18px;
}
- .signup__email-container {
- margin-left: 1rem;
- }
-
.btn {
font-size: 1em;
font-weight: 600;
@@ -200,7 +194,7 @@
display: block;
height: 40px;
line-height: 34px;
- margin: 1em 0 1em 10px;
+ margin: 1em 0;
min-width: 200px;
padding: 0 1em;
width: 200px;
@@ -262,7 +256,6 @@
}
&.btn-full {
- margin-left: 0;
padding-left: 35px;
text-align: left;
width: 100%;
@@ -374,11 +367,11 @@
}
.margin--extra {
- margin-top: 3em;
+ margin-top: 2.5em;
}
.margin--extra-2x {
- margin-top: 6em;
+ margin-top: 5em;
}
}
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 83519a6ec..b248368fc 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -795,6 +795,10 @@ export function applyTheme(theme) {
updateCodeTheme(theme.codeTheme);
}
+export function resetTheme() {
+ applyTheme(Constants.THEMES.default);
+}
+
export function applyFont(fontName) {
const body = $('body');
@@ -1255,12 +1259,15 @@ export function windowHeight() {
}
export function openDirectChannelToUser(user, successCb, errorCb) {
+ AsyncClient.savePreference(
+ Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW,
+ user.id,
+ 'true'
+ );
+
const channelName = this.getDirectChannelName(UserStore.getCurrentId(), user.id);
let channel = ChannelStore.getByName(channelName);
- const preference = PreferenceStore.setPreference(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, user.id, 'true');
- AsyncClient.savePreferences([preference]);
-
if (channel) {
if ($.isFunction(successCb)) {
successCb(channel, true);