Skip to content

Commit 4704486

Browse files
authored
Fixed documentation panel width resets after resizing browser window (#15454)
* Fixed documentation panel width resets after resizing browser window
1 parent 2b14364 commit 4704486

File tree

4 files changed

+41
-32
lines changed

4 files changed

+41
-32
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@use "../../scss/colors";
22

33
.container {
4-
padding: 0px 0px 20px;
5-
background-color: colors.$white;
64
min-height: 100vh;
5+
padding-bottom: 40px;
6+
background-color: colors.$white;
77
}
88

99
.content {
10-
padding: 0px 35px 20px;
10+
padding: 0 35px;
1111
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
$banner-height: 30px;
2+
3+
.mainContainer {
4+
overflow: hidden;
5+
display: flex;
6+
flex-direction: row;
7+
width: 100%;
8+
height: 100%;
9+
min-height: 680px;
10+
11+
.content {
12+
overflow-y: auto;
13+
width: 100%;
14+
height: 100%;
15+
16+
.dataBlock {
17+
width: 100%;
18+
height: 100%;
19+
}
20+
21+
&.alertBanner {
22+
margin-top: $banner-height;
23+
24+
.dataBlock {
25+
height: calc(100% - #{$banner-height});
26+
}
27+
}
28+
}
29+
}

airbyte-webapp/src/packages/cloud/views/layout/MainView/MainView.tsx

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import classNames from "classnames";
12
import React, { useMemo } from "react";
23
import { FormattedMessage, useIntl } from "react-intl";
34
import { Link, Outlet } from "react-router-dom";
4-
import styled from "styled-components";
55

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

1717
import { InsufficientPermissionsErrorBoundary } from "./InsufficientPermissionsErrorBoundary";
18-
19-
const MainContainer = styled.div`
20-
width: 100%;
21-
height: 100%;
22-
overflow: hidden;
23-
display: flex;
24-
flex-direction: row;
25-
min-height: 680px;
26-
`;
27-
28-
const Content = styled.div`
29-
overflow-y: auto;
30-
width: 100%;
31-
height: 100%;
32-
`;
33-
34-
const DataBlock = styled.div<{ hasBanner?: boolean }>`
35-
width: 100%;
36-
height: 100%;
37-
padding-top: ${({ hasBanner }) => (hasBanner ? 30 : 0)}px;
38-
`;
18+
import styles from "./MainView.module.scss";
3919

4020
const MainView: React.FC = (props) => {
4121
const { formatMessage } = useIntl();
@@ -79,19 +59,19 @@ const MainView: React.FC = (props) => {
7959
}, [alertToShow, cloudWorkspace, formatMessage]);
8060

8161
return (
82-
<MainContainer>
62+
<div className={styles.mainContainer}>
8363
<InsufficientPermissionsErrorBoundary errorComponent={<StartOverErrorView />}>
8464
<SideBar />
85-
<Content>
65+
<div className={classNames(styles.content, { [styles.alertBanner]: !!alertToShow })}>
8666
{alertToShow && <AlertBanner message={alertMessage} />}
87-
<DataBlock hasBanner={!!alertToShow}>
67+
<div className={styles.dataBlock}>
8868
<ResourceNotFoundErrorBoundary errorComponent={<StartOverErrorView />}>
8969
<React.Suspense fallback={<LoadingPage />}>{props.children ?? <Outlet />}</React.Suspense>
9070
</ResourceNotFoundErrorBoundary>
91-
</DataBlock>
92-
</Content>
71+
</div>
72+
</div>
9373
</InsufficientPermissionsErrorBoundary>
94-
</MainContainer>
74+
</div>
9575
);
9676
};
9777

airbyte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const ConnectorDocumentationLayout: React.FC = ({ children }) => {
5858
const screenWidth = useWindowSize().width;
5959

6060
return (
61-
<ReflexContainer orientation="vertical" windowResizeAware>
61+
<ReflexContainer orientation="vertical">
6262
<ReflexElement className={classNames("left-pane", styles.leftPanelStyle)} propagateDimensions minSize={150}>
6363
<LeftPanelContainer>{children}</LeftPanelContainer>
6464
</ReflexElement>

0 commit comments

Comments
 (0)