Skip to content

Commit 70557f7

Browse files
committed
Improve responsive design
1 parent 96e40ce commit 70557f7

File tree

3 files changed

+55
-36
lines changed

3 files changed

+55
-36
lines changed

web/src/components/Project.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { type Project as ProjectType } from '../models/ProjectsResponse'
33
import ProjectRepository from '../repositories/ProjectRepository'
44
import styles from './../style/components/Project.module.css'
55

6-
import { Tooltip } from '@mui/material'
6+
import { Box, Tooltip } from '@mui/material'
77
import FavoriteStar from './FavoriteStar'
88

99
interface Props {
@@ -65,10 +65,15 @@ export default function Project(props: Props): JSX.Element {
6565
</div>
6666
</Link>
6767

68-
<Tooltip title={new Date(latestVersion.timestamp).toISOString().slice(0, -8).replace('T', ' ')} placement="left" arrow>
69-
<div className={styles['secondary-typography']}>
68+
<Tooltip title={new Date(latestVersion.timestamp).toISOString().slice(0, -8).replace('T', ' ')} placement="left" arrow >
69+
<Box sx={{
70+
display: {
71+
xs: 'none',
72+
sm: 'inherit'
73+
}
74+
}} className={styles['secondary-typography']}>
7075
{timeSince(new Date(latestVersion.timestamp))} ago
71-
</div>
76+
</Box>
7277
</Tooltip>
7378
</div>
7479
<div className={styles['project-header']}>

web/src/components/SearchBar.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ export default function SearchBar(props: Props): JSX.Element {
5959
p: '2px 4px',
6060
display: 'flex',
6161
alignItems: 'center',
62-
width: 600,
63-
marginTop: '24px',
62+
maxWidth: 600,
6463
marginLeft: '16px',
65-
marginBottom: '32px'
6664
}}
6765
>
6866
<InputBase

web/src/pages/Home.tsx

+45-29
Original file line numberDiff line numberDiff line change
@@ -77,37 +77,53 @@ export default function Home(): JSX.Element {
7777

7878
<div className={styles['project-overview']}>
7979
<Box sx={{
80-
display: 'flex'
80+
display: 'flex',
81+
marginTop: '24px',
82+
marginBottom: '32px',
83+
flexWrap: {
84+
sm: 'nowrap',
85+
xs: 'wrap'
86+
}
8187
}}>
8288

83-
<SearchBar showFavourites={!showAll} onShowFavourites={onShowFavourites} />
84-
85-
<Tooltip title="Upload Documentation" placement="right" arrow>
86-
<IconButton
87-
sx={{ marginLeft: 2, height: '46px', width: '46px', marginTop: '26px'}}
88-
href="/upload"
89-
>
90-
<FileUpload></FileUpload>
91-
</IconButton>
92-
</Tooltip>
93-
94-
<Tooltip title="Claim a Project" placement="right" arrow>
95-
<IconButton
96-
sx={{ marginLeft: 2, height: '46px', width: '46px', marginTop: '26px'}}
97-
href="/upload"
98-
>
99-
<Lock></Lock>
100-
</IconButton>
101-
</Tooltip>
102-
103-
<Tooltip title="Delete a project version" placement="right" arrow>
104-
<IconButton
105-
sx={{ marginLeft: 2, height: '46px', width: '46px', marginTop: '26px'}}
106-
href="/delete"
107-
>
108-
<Delete></Delete>
109-
</IconButton>
110-
</Tooltip>
89+
<Box sx={{
90+
width: {
91+
sm: '100%'
92+
},
93+
maxWidth: '600px',
94+
marginBottom: '8px'
95+
}}>
96+
<SearchBar showFavourites={!showAll} onShowFavourites={onShowFavourites} />
97+
</Box>
98+
99+
<Box sx={{ display: 'flex' }}>
100+
<Tooltip title="Upload Documentation" placement="right" arrow>
101+
<IconButton
102+
sx={{ marginLeft: 2, height: '46px', width: '46px', marginTop: '2px'}}
103+
href="/upload"
104+
>
105+
<FileUpload></FileUpload>
106+
</IconButton>
107+
</Tooltip>
108+
109+
<Tooltip title="Claim a Project" placement="right" arrow>
110+
<IconButton
111+
sx={{ marginLeft: 2, height: '46px', width: '46px', marginTop: '2px'}}
112+
href="/upload"
113+
>
114+
<Lock></Lock>
115+
</IconButton>
116+
</Tooltip>
117+
118+
<Tooltip title="Delete a project version" placement="right" arrow>
119+
<IconButton
120+
sx={{ marginLeft: 2, height: '46px', width: '46px', marginTop: '2px'}}
121+
href="/delete"
122+
>
123+
<Delete></Delete>
124+
</IconButton>
125+
</Tooltip>
126+
</Box>
111127
</Box>
112128

113129
{ projects.length === 0 ?

0 commit comments

Comments
 (0)