Skip to content

Commit f7190ba

Browse files
committed
Fix close button on small screens
1 parent 5045789 commit f7190ba

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

components/Project.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import { styled } from "@mui/material/styles";
3-
import Box from "@mui/material/Box";
43
import ButtonBase from "@mui/material/ButtonBase";
54
import Typography from "@mui/material/Typography";
65

components/ProjectDetails.tsx

+20-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import CancelIcon from "@mui/icons-material/Cancel";
1212
import GitHubIcon from "@mui/icons-material/GitHub";
1313
import PublicIcon from "@mui/icons-material/Public";
1414
import { Logo } from "./icons";
15-
import me from "../json/me.json";
16-
import { Typography, Skeleton, IconButton } from "@mui/material";
15+
import { Typography, Skeleton, IconButton, Box } from "@mui/material";
1716
import Tooltip from "./common/Tooltip";
17+
import me from "../json/me.json";
18+
import theme from "../theme";
1819

1920
export type TechName = keyof typeof me.tech;
2021
const visit = (link: string) => window.open(link);
@@ -29,7 +30,7 @@ const ProjectDetails: React.FC<{ project: IProject; onClose(): void }> = ({
2930
<Swiper
3031
spaceBetween={50}
3132
slidesPerView={1}
32-
effect={"cards"}
33+
effect="cards"
3334
grabCursor
3435
loop={true}
3536
modules={[EffectCards]}
@@ -64,7 +65,14 @@ const ProjectDetails: React.FC<{ project: IProject; onClose(): void }> = ({
6465
>
6566
{project.name}
6667
</a>
67-
<div className="hidden md:block">
68+
<Box
69+
sx={{
70+
display: "none",
71+
[theme.breakpoints.up("md")]: {
72+
display: "block",
73+
},
74+
}}
75+
>
6876
<Button
6977
iconStart={<CancelIcon />}
7078
variant="secondary"
@@ -73,9 +81,15 @@ const ProjectDetails: React.FC<{ project: IProject; onClose(): void }> = ({
7381
>
7482
Close
7583
</Button>
76-
</div>
84+
</Box>
7785

78-
<IconButton onClick={onClose} className="block md:hidden p-0">
86+
<IconButton
87+
onClick={onClose}
88+
sx={{
89+
display: "flex",
90+
[theme.breakpoints.up("md")]: { display: "none" },
91+
}}
92+
>
7993
<CancelIcon className="text-indigo-500" />
8094
</IconButton>
8195
</div>

0 commit comments

Comments
 (0)