Skip to content

feat: Make settings page responsive #3228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions site/src/components/Section/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ const useStyles = makeStyles((theme) => ({
boxShadow: `0px 18px 12px 6px ${fade(theme.palette.common.black, 0.02)}`,
marginBottom: theme.spacing(1),
padding: theme.spacing(6),
borderRadius: theme.shape.borderRadius,

[theme.breakpoints.down("sm")]: {
padding: theme.spacing(4, 3, 4, 3),
},
},
inner: ({ layout }: { layout: SectionLayout }) => ({
maxWidth: layout === "fluid" ? "100%" : 500,
Expand Down
22 changes: 11 additions & 11 deletions site/src/components/TabPanel/TabPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ const useStyles = makeStyles((theme) => ({
display: "flex",
maxWidth: 1920,
padding: theme.spacing(5, 3.5, 0, 4),

[theme.breakpoints.down("sm")]: {
flexDirection: "column",
padding: 0,
},
},

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

menuPanel: {
paddingRight: 40,

[theme.breakpoints.down("sm")]: {
padding: 0,
},
},

title: {
marginTop: theme.spacing(4),
marginTop: theme.spacing(6),
fontSize: 32,
letterSpacing: -theme.spacing(0.0375),
},

contentPanel: {
Expand Down Expand Up @@ -84,15 +92,7 @@ const useStyles = makeStyles((theme) => ({
},
[theme.breakpoints.down("sm")]: {
contentPanel: {
width: 700,
},
},
[theme.breakpoints.down("sm")]: {
contentPanel: {
width: 550,
},
root: {
marginRight: 0, //disabled scrollbar jump trick to avoid small screen bug with menu
width: "auto",
},
},
}))
19 changes: 19 additions & 0 deletions site/src/components/TabSidebar/TabSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ListItem from "@material-ui/core/ListItem"
import { makeStyles } from "@material-ui/core/styles"
import { FC } from "react"
import { NavLink } from "react-router-dom"
import { sidePadding } from "theme/constants"
import { combineClasses } from "../../util/combineClasses"

export interface TabSidebarItem {
Expand Down Expand Up @@ -47,10 +48,21 @@ const useStyles = makeStyles((theme) => ({
menu: {
minWidth: 160,
marginTop: theme.spacing(5),

[theme.breakpoints.down("sm")]: {
display: "flex",
borderBottom: `1px solid ${theme.palette.divider}`,
marginBottom: theme.spacing(2),
// Fit all the width
width: `calc(100% + ${sidePadding * 2}px)`,
marginLeft: -sidePadding,
marginTop: sidePadding,
},
},

link: {
textDecoration: "none",
flex: 1,
},

menuItem: {
Expand Down Expand Up @@ -85,6 +97,13 @@ const useStyles = makeStyles((theme) => ({
opacity: 1,
},
},

[theme.breakpoints.down("sm")]: {
textAlign: "center",
width: "100%",
paddingTop: theme.spacing(2),
paddingBottom: theme.spacing(2),
},
},

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