Skip to content

Commit

Permalink
adjusting mobile styles (#2604)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Dec 6, 2022
1 parent c4f3ada commit 95937a4
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 6 deletions.
Expand Up @@ -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 }) => ({
Expand All @@ -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 }) => ({
Expand All @@ -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);
Expand Down Expand Up @@ -139,7 +153,7 @@ export const ChangeRequestOverview: FC = () => {
return (
<>
<ChangeRequestHeader changeRequest={changeRequest} />
<Box sx={{ display: 'flex' }}>
<ChangeRequestBody>
<StyledAsideBox>
<ChangeRequestTimeline state={changeRequest.state} />
<ConditionallyRender
Expand Down Expand Up @@ -272,7 +286,7 @@ export const ChangeRequestOverview: FC = () => {
can't be reopened.
</Typography>
</Dialogue>
</Box>
</ChangeRequestBody>
</>
);
};
Expand Up @@ -29,7 +29,7 @@ export const ChangeRequestTitleCell = ({
}

return (
<TextCell>
<TextCell sx={{ minWidth: '200px' }}>
<StyledLink>
<Link
component={RouterLink}
Expand Down
Expand Up @@ -4,6 +4,10 @@ export const useStyles = makeStyles()(theme => ({
header: {
padding: theme.spacing(0, 4),
},
bodyClass: {
padding: theme.spacing(4),
overflowX: 'auto',
},
tabContainer: {
paddingLeft: 0,
paddingBottom: 0,
Expand Down
Expand Up @@ -211,6 +211,7 @@ export const ChangeRequestsTabs = ({
return (
<PageContent
isLoading={loading}
bodyClass={classes.bodyClass}
headerClass={classes.header}
header={
<PageHeader
Expand All @@ -220,6 +221,8 @@ export const ChangeRequestsTabs = ({
value={tabs[activeTab]?.title}
indicatorColor="primary"
textColor="primary"
variant="scrollable"
allowScrollButtonsMobile
>
{tabs.map((tab, index) => (
<Tab
Expand Down
Expand Up @@ -21,6 +21,9 @@ export const useStyles = makeStyles()(theme => ({
[theme.breakpoints.down('md')]: {
padding: theme.spacing(2),
},
[theme.breakpoints.down('sm')]: {
overflowX: 'auto',
},
},
paddingDisabled: {
padding: '0',
Expand Down
Expand Up @@ -30,7 +30,13 @@ export const EnvironmentNameCell = ({
const { searchQuery } = useSearchHighlightContext();

return (
<TextCell>
<TextCell
sx={theme => ({
[theme.breakpoints.up('sm')]: {
minWidth: '350px',
},
})}
>
<Highlighter search={searchQuery}>{environment.name}</Highlighter>
<ConditionallyRender
condition={environment.protected}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/component/project/Project/Project.tsx
Expand Up @@ -240,6 +240,7 @@ const Project = () => {
value={activeTab?.path}
indicatorColor="primary"
textColor="primary"
variant="scrollable"
>
{tabs.map(tab => (
<Tab
Expand Down
Expand Up @@ -153,7 +153,6 @@ const ProjectEnvironmentList = () => {
Cell: ({ row: { original } }: any) => (
<EnvironmentNameCell environment={original} />
),
minWidth: 350,
},
{
Header: 'Type',
Expand Down
Expand Up @@ -109,7 +109,7 @@ exports[`renders an empty list correctly 1`] = `
</div>
</div>
<div
className="body css-54jt3w-bodyContainer"
className="body css-142eaq1-bodyContainer"
>
<table
className="MuiTable-root css-1h6dscb-MuiTable-root-table"
Expand Down

0 comments on commit 95937a4

Please sign in to comment.