Skip to content

Commit

Permalink
chore: minore responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
SySagar committed Dec 15, 2023
1 parent b0fbae1 commit 95255d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/app/home/components/Blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Divider, Stack, Typography } from "@mui/material";
import Chip from "@mui/material/Chip";
import { useNavigate } from "react-router-dom";
import "../home.css";
import useMediaQuery from "@mui/material/useMediaQuery";

interface BlogTypes {
author: string;
Expand All @@ -22,6 +23,7 @@ export default function Blog({
image,
}: BlogTypes) {
const navigate = useNavigate();
const isPhone = useMediaQuery("(max-width:800px)");

const redirectToBlog = () => {
console.log("redirecting to blog");
Expand Down Expand Up @@ -60,6 +62,7 @@ export default function Blog({
/>
</Stack>
<Stack
className="mobile-image"
sx={{
objectFit: "cover",
}}
Expand All @@ -83,10 +86,18 @@ export default function Blog({
alignItems={"flex-start"}
padding={3}
>
<Typography variant="caption" fontWeight={600} color={"#fff"}>
<Typography
variant="caption"
fontWeight={600}
color={isPhone ? "#474747" : "#fff"}
>
{author} · {date}
</Typography>
<Typography variant="h6" fontWeight={550} color={"#fff"}>
<Typography
variant="h6"
fontWeight={550}
color={isPhone ? "#000" : "#fff"}
>
{title}
</Typography>
<Stack
Expand All @@ -100,7 +111,7 @@ export default function Blog({
<Chip
sx={{
height: "15px",
color: "#fff",
color: isPhone ? "#474747" : "#fff",
fontWeight: 400,
fontSize: "0.7rem",
}}
Expand Down
12 changes: 11 additions & 1 deletion src/app/home/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@
.about{
color: black!important;
}
}

.mobile-image{
display: block!important;
}
}

@media only screen and (min-width: 800px) {
.mobile-image{
display: none!important;
}
}

0 comments on commit 95255d8

Please sign in to comment.