diff --git a/client/src/components/Auth/GoogleAuth.js b/client/src/components/Auth/GoogleAuth.js index ed2f6ef..244040b 100644 --- a/client/src/components/Auth/GoogleAuth.js +++ b/client/src/components/Auth/GoogleAuth.js @@ -43,21 +43,21 @@ const GoogleAuth = ({ loading, setLoading }) => { }); return ( - + {loading ? ( { width: "90%", textAlign: "center", fontFamily: "Jost, sans-serif", - fontSize: "25px", + fontSize: { xs: "16px", sm: "22px", md: "25px" }, fontWeight: "400", - lineHeight: "32.0px", + lineHeight: { xs: "20px", sm: "24px", md: "32.0px" }, letterSpacing: " 1px", color: "rgba(0, 0, 0, 0.54)", WebkitFontSmoothing: "antialiased", // Smooths font on Webkit browsers (Chrome, Safari) diff --git a/client/src/components/Auth/Login.js b/client/src/components/Auth/Login.js index 60c9448..7b54707 100644 --- a/client/src/components/Auth/Login.js +++ b/client/src/components/Auth/Login.js @@ -1,4 +1,4 @@ -import { Box, Typography } from "@mui/material"; +import { Box, Typography, useMediaQuery, useTheme } from "@mui/material"; import React, { useContext, useEffect, useState } from "react"; import GoogleAuth from "./GoogleAuth"; import ALogo from "../icons/ALogo"; @@ -8,6 +8,7 @@ import axios from "axios"; import { endpoints } from "../../constants/endpoints"; import LoaderDialog from "./LoaderDialog"; import LoadingSkeleton from "./LoadingSkeleton"; +import Logo from "../icons/Logo"; const Login = ({ loading, setLoading, refreshLoading, setRefreshLoading }) => { const { @@ -18,6 +19,8 @@ const Login = ({ loading, setLoading, refreshLoading, setRefreshLoading }) => { userProblems, setUserProblems, } = useContext(DataContext); + const theme = useTheme(); + const isLargeScreen = useMediaQuery(theme.breakpoints.up("sm")); const navigate = useNavigate(); useEffect(() => { @@ -59,8 +62,10 @@ const Login = ({ loading, setLoading, refreshLoading, setRefreshLoading }) => { display: "flex", justifyContent: "center", alignItems: "center", - height: "100%", + height: { xs: "100vh", sm: "100%" }, width: "100%", + flexDirection: { xs: "column", sm: "row" }, // Stack column on small screens, row on larger screens + overflow: "hidden", // Ensures no overflow issues on smaller screens }} > {!refreshLoading ? ( @@ -69,28 +74,75 @@ const Login = ({ loading, setLoading, refreshLoading, setRefreshLoading }) => { component="img" src="SideImage.jpeg" // Update this path to your PNG file sx={{ - width: "30%", - height: "100%", + width: { xs: "100%", sm: "30%" }, + height: { xs: "30vh", sm: "100%" }, + objectFit: "cover", + display: { xs: "none", sm: "block" }, }} /> - - - + + + {isLargeScreen ? ( + + ) : ( + + + + )} + + { { ) : ( - // )} diff --git a/client/src/components/UserView/Dashboard.js b/client/src/components/UserView/Dashboard.js index 25b55e4..b1bf0bc 100644 --- a/client/src/components/UserView/Dashboard.js +++ b/client/src/components/UserView/Dashboard.js @@ -1,4 +1,4 @@ -import { Box } from "@mui/material"; +import { Box, useMediaQuery, useTheme } from "@mui/material"; import React, { useEffect } from "react"; import Navbar from "./Navbar"; import ProblemsTable from "./ProblemsTable"; @@ -10,25 +10,29 @@ const Dashboard = ({ setLoading }) => { useEffect(() => { setLoading(false); }, []); + const theme = useTheme(); + const isLargeScreen = useMediaQuery(theme.breakpoints.up("md")); return ( - + - + {isLargeScreen && } - + {isLargeScreen && }