Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 991b4f7

Browse files
feat: Make settings page responsive (#3228)
1 parent 509a601 commit 991b4f7

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
lines changed

site/src/components/Section/Section.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ const useStyles = makeStyles((theme) => ({
6262
boxShadow: `0px 18px 12px 6px ${fade(theme.palette.common.black, 0.02)}`,
6363
marginBottom: theme.spacing(1),
6464
padding: theme.spacing(6),
65+
borderRadius: theme.shape.borderRadius,
66+
67+
[theme.breakpoints.down("sm")]: {
68+
padding: theme.spacing(4, 3, 4, 3),
69+
},
6570
},
6671
inner: ({ layout }: { layout: SectionLayout }) => ({
6772
maxWidth: layout === "fluid" ? "100%" : 500,

site/src/components/TabPanel/TabPanel.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ const useStyles = makeStyles((theme) => ({
3737
display: "flex",
3838
maxWidth: 1920,
3939
padding: theme.spacing(5, 3.5, 0, 4),
40+
41+
[theme.breakpoints.down("sm")]: {
42+
flexDirection: "column",
43+
padding: 0,
44+
},
4045
},
4146

4247
icon: {
@@ -51,12 +56,15 @@ const useStyles = makeStyles((theme) => ({
5156

5257
menuPanel: {
5358
paddingRight: 40,
59+
60+
[theme.breakpoints.down("sm")]: {
61+
padding: 0,
62+
},
5463
},
5564

5665
title: {
57-
marginTop: theme.spacing(4),
66+
marginTop: theme.spacing(6),
5867
fontSize: 32,
59-
letterSpacing: -theme.spacing(0.0375),
6068
},
6169

6270
contentPanel: {
@@ -84,15 +92,7 @@ const useStyles = makeStyles((theme) => ({
8492
},
8593
[theme.breakpoints.down("sm")]: {
8694
contentPanel: {
87-
width: 700,
88-
},
89-
},
90-
[theme.breakpoints.down("sm")]: {
91-
contentPanel: {
92-
width: 550,
93-
},
94-
root: {
95-
marginRight: 0, //disabled scrollbar jump trick to avoid small screen bug with menu
95+
width: "auto",
9696
},
9797
},
9898
}))

site/src/components/TabSidebar/TabSidebar.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ListItem from "@material-ui/core/ListItem"
33
import { makeStyles } from "@material-ui/core/styles"
44
import { FC } from "react"
55
import { NavLink } from "react-router-dom"
6+
import { sidePadding } from "theme/constants"
67
import { combineClasses } from "../../util/combineClasses"
78

89
export interface TabSidebarItem {
@@ -47,10 +48,21 @@ const useStyles = makeStyles((theme) => ({
4748
menu: {
4849
minWidth: 160,
4950
marginTop: theme.spacing(5),
51+
52+
[theme.breakpoints.down("sm")]: {
53+
display: "flex",
54+
borderBottom: `1px solid ${theme.palette.divider}`,
55+
marginBottom: theme.spacing(2),
56+
// Fit all the width
57+
width: `calc(100% + ${sidePadding * 2}px)`,
58+
marginLeft: -sidePadding,
59+
marginTop: sidePadding,
60+
},
5061
},
5162

5263
link: {
5364
textDecoration: "none",
65+
flex: 1,
5466
},
5567

5668
menuItem: {
@@ -85,6 +97,13 @@ const useStyles = makeStyles((theme) => ({
8597
opacity: 1,
8698
},
8799
},
100+
101+
[theme.breakpoints.down("sm")]: {
102+
textAlign: "center",
103+
width: "100%",
104+
paddingTop: theme.spacing(2),
105+
paddingBottom: theme.spacing(2),
106+
},
88107
},
89108

90109
[theme.breakpoints.up("lg")]: {

0 commit comments

Comments
 (0)