Skip to content

Commit c1f83dd

Browse files
committed
Optimize mobile layout
1 parent 20cb312 commit c1f83dd

File tree

4 files changed

+68
-12
lines changed

4 files changed

+68
-12
lines changed
Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,51 @@
1-
.skill-categories-header {
1+
.SkillCategoriesPage-root .skill-categories-header {
22
display: flex;
33
flex-direction: row;
44
justify-content: space-between;
55
margin-bottom: 1rem;
66
flex-wrap: wrap;
77
}
88

9-
.skill-categories-actions {
9+
.SkillCategoriesPage-root .skill-categories-actions {
1010
display: flex;
1111
flex-direction: row;
1212
gap: 1rem;
1313
align-items: center;
14+
justify-content: flex-end;
15+
flex-wrap: wrap;
16+
}
17+
18+
@media screen and (max-width: 600px) {
19+
.SkillCategoriesPage-root .skill-categories-header {
20+
display: flex;
21+
flex-direction: column;
22+
gap: 1rem;
23+
}
24+
25+
.SkillCategoriesPage-root .skill-categories-actions {
26+
display: grid;
27+
grid-template-rows: 1fr 1fr;
28+
grid-template-columns: 1fr 150px;
29+
}
30+
31+
.SkillCategoriesPage-root .skill-categories-actions .search-skill-categories-field {
32+
grid-row: 1;
33+
grid-column: 1;
34+
}
35+
36+
.SkillCategoriesPage-root .skill-categories-actions .download-skills-button {
37+
grid-row: 1;
38+
grid-column: 2;
39+
justify-self: center;
40+
}
41+
42+
.SkillCategoriesPage-root .skill-categories-actions .filter-skill-categories-field {
43+
grid-row: 2;
44+
grid-column: 1;
45+
}
46+
47+
.SkillCategoriesPage-root .skill-categories-actions .new-skill-category-button {
48+
grid-row: 2;
49+
grid-column: 2;
50+
}
1451
}

web-ui/src/pages/SkillCategoriesPage.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,15 @@ const SkillCategoriesPage = () => {
162162
<div className="skill-categories-header">
163163
<Typography variant="h4">Skill Categories</Typography>
164164
<div className="skill-categories-actions">
165-
<Tooltip title="Download Skills" arrow>
165+
<Tooltip className="download-skills-button" title="Download Skills" arrow>
166166
<IconButton onClick={downloadSkills}>
167167
<DownloadIcon/>
168168
</IconButton>
169169
</Tooltip>
170170
<TextField
171-
style={{ minWidth: "200px" }}
171+
className="search-skill-categories-field"
172+
style={{ width: "auto", minWidth: "200px", maxWidth: "300px" }}
172173
label="Search"
173-
fullWidth
174174
placeholder="Category name"
175175
variant="outlined"
176176
size="small"
@@ -181,15 +181,15 @@ const SkillCategoriesPage = () => {
181181
}}
182182
/>
183183
<Autocomplete
184+
className="filter-skill-categories-field"
184185
renderInput={(params) => (
185186
<TextField
186187
{...params}
187-
style={{ minWidth: "200px" }}
188+
style={{ minWidth: "200px", maxWidth: "300px" }}
188189
label="Filter by Skill"
189190
variant="outlined"
190191
size="small"
191192
placeholder="Skill name"
192-
fullWidth
193193
/>
194194
)}
195195
options={skills}
@@ -199,7 +199,8 @@ const SkillCategoriesPage = () => {
199199
onChange={(_, newValue) => setSkillFilter(newValue)}
200200
/>
201201
<Button
202-
style={{ width: "300px" }}
202+
className="new-skill-category-button"
203+
style={{ whiteSpace: "nowrap" }}
203204
variant="contained"
204205
onClick={() => setDialogOpen(true)}
205206
>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.SkillCategoryEditPage-root .edit-skill-category-fields {
2+
margin: 2rem 0;
3+
display: flex;
4+
flex-direction: row;
5+
gap: 2rem;
6+
}
7+
8+
@media screen and (max-width: 600px) {
9+
10+
.SkillCategoryEditPage-root .edit-skill-category-fields {
11+
display: flex;
12+
flex-direction: column;
13+
gap: 1rem;
14+
}
15+
16+
}

web-ui/src/pages/SkillCategoryEditPage.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import SelectSkillsDialog from "../components/select-skills-dialog/SelectSkillsD
2828
import {UPDATE_TOAST} from "../context/actions";
2929
import Dialog from "@mui/material/Dialog";
3030

31+
import "./SkillCategoryEditPage.css";
32+
3133
const PREFIX = 'SkillCategoryEditPage';
3234
const classes = {
3335
root: `${PREFIX}-root`,
@@ -152,12 +154,11 @@ const SkillCategoryEditPage = () => {
152154

153155
return (
154156
<Root className={classes.root}>
155-
<div>
156-
<Typography variant="h4">Edit Skill Category</Typography>
157-
</div>
158-
<div style={{ margin: "2rem 0", display: "flex", gap: "2rem" }}>
157+
<Typography variant="h4">Edit Skill Category</Typography>
158+
<div className="edit-skill-category-fields">
159159
<TextField
160160
label="Name"
161+
style={{ width: "250px" }}
161162
value={category ? category.name : ""}
162163
onChange={(event) => {
163164
setCategory({
@@ -169,6 +170,7 @@ const SkillCategoryEditPage = () => {
169170
/>
170171
<TextField
171172
label="Description"
173+
style={{ width: "400px" }}
172174
value={category ? category.description : ""}
173175
onChange={(event) => {
174176
setCategory({

0 commit comments

Comments
 (0)