From 95937a453863192ac75bcd674b520907e47f2224 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Tue, 6 Dec 2022 17:01:14 +0100 Subject: [PATCH] adjusting mobile styles (#2604) --- .../ChangeRequestOverview.tsx | 18 ++++++++++++++++-- .../ChangeRequestTitleCell.tsx | 2 +- .../ChangeRequestsTabs.styles.ts | 4 ++++ .../ChangeRequestsTabs/ChangeRequestsTabs.tsx | 3 +++ .../common/PageContent/PageContent.styles.ts | 3 +++ .../EnvironmentNameCell.tsx | 8 +++++++- .../src/component/project/Project/Project.tsx | 1 + .../ProjectEnvironment/ProjectEnvironment.tsx | 1 - .../__snapshots__/TagTypeList.test.tsx.snap | 2 +- 9 files changed, 36 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx index e3d626e699..cebe814369 100644 --- a/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx +++ b/frontend/src/component/changeRequest/ChangeRequestOverview/ChangeRequestOverview.tsx @@ -29,6 +29,9 @@ const StyledAsideBox = styled(Box)(({ theme }) => ({ width: '30%', display: 'flex', flexDirection: 'column', + [theme.breakpoints.down('sm')]: { + width: '100%', + }, })); const StyledPaper = styled(Paper)(({ theme }) => ({ @@ -37,6 +40,10 @@ const StyledPaper = styled(Paper)(({ theme }) => ({ width: '70%', padding: theme.spacing(1, 2), borderRadius: theme.shape.borderRadiusLarge, + [theme.breakpoints.down('sm')]: { + marginLeft: 0, + width: '100%', + }, })); const StyledButtonBox = styled(Box)(({ theme }) => ({ @@ -49,6 +56,13 @@ const StyledInnerContainer = styled(Box)(({ theme }) => ({ padding: theme.spacing(2), })); +const ChangeRequestBody = styled(Box)(({ theme }) => ({ + display: 'flex', + [theme.breakpoints.down('sm')]: { + flexDirection: 'column', + }, +})); + export const ChangeRequestOverview: FC = () => { const projectId = useRequiredPathParam('projectId'); const [showCancelDialog, setShowCancelDialog] = useState(false); @@ -139,7 +153,7 @@ export const ChangeRequestOverview: FC = () => { return ( <> - + { can't be reopened. - + ); }; diff --git a/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestTitleCell/ChangeRequestTitleCell.tsx b/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestTitleCell/ChangeRequestTitleCell.tsx index e2048ce665..06f5d97a41 100644 --- a/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestTitleCell/ChangeRequestTitleCell.tsx +++ b/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestTitleCell/ChangeRequestTitleCell.tsx @@ -29,7 +29,7 @@ export const ChangeRequestTitleCell = ({ } return ( - + ({ header: { padding: theme.spacing(0, 4), }, + bodyClass: { + padding: theme.spacing(4), + overflowX: 'auto', + }, tabContainer: { paddingLeft: 0, paddingBottom: 0, diff --git a/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx b/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx index 50101ff0c6..d37cd8c599 100644 --- a/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx +++ b/frontend/src/component/changeRequest/ProjectChangeRequests/ChangeRequestsTabs/ChangeRequestsTabs.tsx @@ -211,6 +211,7 @@ export const ChangeRequestsTabs = ({ return ( {tabs.map((tab, index) => ( ({ [theme.breakpoints.down('md')]: { padding: theme.spacing(2), }, + [theme.breakpoints.down('sm')]: { + overflowX: 'auto', + }, }, paddingDisabled: { padding: '0', diff --git a/frontend/src/component/environments/EnvironmentTable/EnvironmentNameCell/EnvironmentNameCell.tsx b/frontend/src/component/environments/EnvironmentTable/EnvironmentNameCell/EnvironmentNameCell.tsx index 235981fa02..7f81601dba 100644 --- a/frontend/src/component/environments/EnvironmentTable/EnvironmentNameCell/EnvironmentNameCell.tsx +++ b/frontend/src/component/environments/EnvironmentTable/EnvironmentNameCell/EnvironmentNameCell.tsx @@ -30,7 +30,13 @@ export const EnvironmentNameCell = ({ const { searchQuery } = useSearchHighlightContext(); return ( - + ({ + [theme.breakpoints.up('sm')]: { + minWidth: '350px', + }, + })} + > {environment.name} { value={activeTab?.path} indicatorColor="primary" textColor="primary" + variant="scrollable" > {tabs.map(tab => ( { Cell: ({ row: { original } }: any) => ( ), - minWidth: 350, }, { Header: 'Type', diff --git a/frontend/src/component/tags/TagTypeList/__tests__/__snapshots__/TagTypeList.test.tsx.snap b/frontend/src/component/tags/TagTypeList/__tests__/__snapshots__/TagTypeList.test.tsx.snap index dcfa652387..dcf25eedb1 100644 --- a/frontend/src/component/tags/TagTypeList/__tests__/__snapshots__/TagTypeList.test.tsx.snap +++ b/frontend/src/component/tags/TagTypeList/__tests__/__snapshots__/TagTypeList.test.tsx.snap @@ -109,7 +109,7 @@ exports[`renders an empty list correctly 1`] = `