Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed documentation panel width resets after resizing browser window #15454

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@use "../../scss/colors";

.container {
padding: 0px 0px 20px;
background-color: colors.$white;
min-height: 100vh;
padding-bottom: 40px;
background-color: colors.$white;
}

.content {
padding: 0px 35px 20px;
padding: 0 35px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$banner-height: 30px;

.mainContainer {
overflow: hidden;
display: flex;
flex-direction: row;
width: 100%;
height: 100%;
min-height: 680px;

.content {
overflow-y: auto;
width: 100%;
height: 100%;

.dataBlock {
width: 100%;
height: 100%;
}

&.alertBanner {
margin-top: $banner-height;

.dataBlock {
height: calc(100% - #{$banner-height});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from "classnames";
import React, { useMemo } from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { Link, Outlet } from "react-router-dom";
import styled from "styled-components";

import { LoadingPage } from "components";
import { AlertBanner } from "components/base/Banner/AlertBanner";
Expand All @@ -15,27 +15,7 @@ import { ResourceNotFoundErrorBoundary } from "views/common/ResorceNotFoundError
import { StartOverErrorView } from "views/common/StartOverErrorView";

import { InsufficientPermissionsErrorBoundary } from "./InsufficientPermissionsErrorBoundary";

const MainContainer = styled.div`
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: row;
min-height: 680px;
`;

const Content = styled.div`
overflow-y: auto;
width: 100%;
height: 100%;
`;

const DataBlock = styled.div<{ hasBanner?: boolean }>`
width: 100%;
height: 100%;
padding-top: ${({ hasBanner }) => (hasBanner ? 30 : 0)}px;
`;
import styles from "./MainView.module.scss";

const MainView: React.FC = (props) => {
const { formatMessage } = useIntl();
Expand Down Expand Up @@ -79,19 +59,19 @@ const MainView: React.FC = (props) => {
}, [alertToShow, cloudWorkspace, formatMessage]);

return (
<MainContainer>
<div className={styles.mainContainer}>
<InsufficientPermissionsErrorBoundary errorComponent={<StartOverErrorView />}>
<SideBar />
<Content>
<div className={classNames(styles.content, { [styles.alertBanner]: !!alertToShow })}>
{alertToShow && <AlertBanner message={alertMessage} />}
<DataBlock hasBanner={!!alertToShow}>
<div className={styles.dataBlock}>
<ResourceNotFoundErrorBoundary errorComponent={<StartOverErrorView />}>
<React.Suspense fallback={<LoadingPage />}>{props.children ?? <Outlet />}</React.Suspense>
</ResourceNotFoundErrorBoundary>
</DataBlock>
</Content>
</div>
</div>
</InsufficientPermissionsErrorBoundary>
</MainContainer>
</div>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ConnectorDocumentationLayout: React.FC = ({ children }) => {
const screenWidth = useWindowSize().width;

return (
<ReflexContainer orientation="vertical" windowResizeAware>
<ReflexContainer orientation="vertical">
<ReflexElement className={classNames("left-pane", styles.leftPanelStyle)} propagateDimensions minSize={150}>
<LeftPanelContainer>{children}</LeftPanelContainer>
</ReflexElement>
Expand Down