Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
UCHAT-3952-sidebar-resize- bug fix for UI getting distorted when navi…
Browse files Browse the repository at this point in the history
…gating through pinned posts.
  • Loading branch information
nykashish authored and ayusdash committed Sep 18, 2019
1 parent 1b904ab commit b626b59
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/channel_layout/center_channel/center_channel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import PropTypes from 'prop-types';
import {Route, Switch, Redirect} from 'react-router-dom';
import classNames from 'classnames';

import $ from 'jquery';

import PermalinkView from 'components/permalink_view';
import ChannelHeaderMobile from 'components/channel_header_mobile';
import ChannelIdentifierRouter from 'components/channel_layout/channel_identifier_router';
Expand All @@ -31,6 +33,11 @@ export default class CenterChannel extends React.PureComponent {
if (this.props.location.pathname !== nextProps.location.pathname && nextProps.location.pathname.includes('/pl/')) {
this.setState({returnTo: this.props.location.pathname});
}
this.leftMargin = $('#app-content').css('margin-left');
}

componentDidUpdate() {
$('#app-content').css('margin-left', this.leftMargin);
}

render() {
Expand Down
2 changes: 2 additions & 0 deletions components/channel_view/channel_view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default class ChannelView extends React.PureComponent {
if (this.props.match.url !== nextProps.match.url) {
this.createDeferredPostView();
}
this.leftMargin = $('#app-content').css('margin-left');
}

getChannelView = () => {
Expand Down Expand Up @@ -105,6 +106,7 @@ export default class ChannelView extends React.PureComponent {
this.props.actions.goToLastViewedChannel();
}
}
$('#app-content').css('margin-left', this.leftMargin);
}

render() {
Expand Down
7 changes: 7 additions & 0 deletions components/permalink_view/permalink_view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import PropTypes from 'prop-types';
import {FormattedMessage, intlShape} from 'react-intl';
import {Link} from 'react-router-dom';

import $ from 'jquery';

import ChannelHeader from 'components/channel_header';
import PostView from 'components/post_view';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
Expand Down Expand Up @@ -53,6 +55,11 @@ export default class PermalinkView extends React.PureComponent {
if (this.props.match.params.postid !== nextProps.match.params.postid) {
this.doPermalinkEvent(nextProps);
}
this.leftMargin = $('#app-content').css('margin-left');
}

componentDidUpdate() {
$('#app-content').css('margin-left', this.leftMargin);
}

doPermalinkEvent = async (props) => {
Expand Down

0 comments on commit b626b59

Please sign in to comment.