From df799ca2efa36e7318d4c0b7346b7ef067d48ad4 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Date: Tue, 10 Sep 2019 10:35:55 +0530 Subject: [PATCH] UCHAT-3952-sidebar-resize- bug fix for UI getting distorted when navigating through pinned posts. --- .../__snapshots__/admin_console.test.jsx.snap | 10 +-- .../__snapshots__/admin_sidebar.test.jsx.snap | 85 ++++++++++++++++--- .../center_channel/center_channel.jsx | 7 ++ components/channel_view/channel_view.jsx | 2 + components/permalink_view/permalink_view.jsx | 7 ++ 5 files changed, 96 insertions(+), 15 deletions(-) diff --git a/components/admin_console/__snapshots__/admin_console.test.jsx.snap b/components/admin_console/__snapshots__/admin_console.test.jsx.snap index f64d420a7fd6..44e403f62f4d 100644 --- a/components/admin_console/__snapshots__/admin_console.test.jsx.snap +++ b/components/admin_console/__snapshots__/admin_console.test.jsx.snap @@ -117,6 +117,11 @@ exports[`components/AdminConsole should generate the routes 1`] = ` path="/site_config/emoji" render={[Function]} /> + - + } + /> + + } + /> + + } + /> + + } + /> + + } + /> + { @@ -105,6 +106,7 @@ export default class ChannelView extends React.PureComponent { this.props.actions.goToLastViewedChannel(); } } + $('#app-content').css('margin-left', this.leftMargin); } render() { diff --git a/components/permalink_view/permalink_view.jsx b/components/permalink_view/permalink_view.jsx index e9fbe84e0548..fdaaed2d2926 100644 --- a/components/permalink_view/permalink_view.jsx +++ b/components/permalink_view/permalink_view.jsx @@ -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'; @@ -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) => {