From e082129d05cef7bcac47e5bbe97ea4936391a4ac Mon Sep 17 00:00:00 2001 From: SANKALP PANDEY Date: Thu, 22 Feb 2024 19:36:31 +0530 Subject: [PATCH] FEAT: added the restyricted screen size query --- src/Styles/Dashboard/main.css | 12 ++ src/app/Dashboard/page.tsx | 242 ++++++++++++++++++---------------- src/app/page.tsx | 12 +- 3 files changed, 150 insertions(+), 116 deletions(-) diff --git a/src/Styles/Dashboard/main.css b/src/Styles/Dashboard/main.css index 6b1fbc1..ee472dd 100644 --- a/src/Styles/Dashboard/main.css +++ b/src/Styles/Dashboard/main.css @@ -20,4 +20,16 @@ h2 , h3 , span ,p{ } .y{ font-size: 17px; +} +.screenSizeDiv{ + +margin-top: 55%; + width: 100%; + height: 100px; + + +} +.screenTitle{ + font-family: "Shantell Sans", cursive; + font-size: 30px; } \ No newline at end of file diff --git a/src/app/Dashboard/page.tsx b/src/app/Dashboard/page.tsx index 976ba52..942ac12 100644 --- a/src/app/Dashboard/page.tsx +++ b/src/app/Dashboard/page.tsx @@ -110,6 +110,19 @@ const VersionDashboard: React.FC = () => { const [oldestRepoCard, setShowOldestRepoCard] = useState(true); const [newestRepoCard, setNewRepoCard] = useState(false); const [show, setShow] = useState(true); + const [smallScreen , setSmallScreen] = useState(false) + + const checkScreenSize = ()=>{ + + const isMobile = typeof window !== 'undefined' && window.matchMedia("(max-width:1024px)").matches; + if (isMobile) { + setSmallScreen(true) + } + else{ + setSmallScreen(false) + } + + } const getFollowerAnalysisData = async () => { try { @@ -284,6 +297,7 @@ const VersionDashboard: React.FC = () => { }; useEffect(() => { + checkScreenSize() getFollowerAnalysisData(); getFollowingAnalysisData(); getLanguageCountAnalysisData(); @@ -297,91 +311,99 @@ const VersionDashboard: React.FC = () => { getTotalStarData(); }, []); - return followerAnlData.followerCount !== 0 && - followingAnlData.followingCount !== 0 ? ( + return smallScreen ? ( +
+

+ For the perfect view, kindly visit this website on the desktop. +

+
+ ) : (
-
-
- - - +
+ + + + + +
+ +
+
+ - - -
- -
-
- -
- -
- - -
-
- demo -
-
- -
- {mostRecCommit && ( - - )} -
+
-
-
- +
-
- -

Welcomeeeee

Crafted By - Sankalp's Github Profile

-
-
-
-
- -
- - {" "} -

{ - setNewRepoCard(false), setShowOldestRepoCard(true); - }} - className="text-blue-600 font-extrabold font-mono hover:text-yellow-300 hover:cursor-pointer" - > - Oldest Repo - -

-
- - + demo +
+ + +
+ {mostRecCommit && } +
+
+
+
+ +
+
+ +

+ Welcomeeeee{" "} + + {" "} +

+ Crafted By - Sankalp's Github Profile{" "} +

+
+

+
+
+
+
+ +
+ + {" "} +

{ + setNewRepoCard(false), setShowOldestRepoCard(true); + }} + className="text-blue-600 font-extrabold font-mono hover:text-yellow-300 hover:cursor-pointer" > + Oldest Repo +

+
+ +

{ setNewRepoCard(true), setShowOldestRepoCard(false); @@ -390,41 +412,39 @@ const VersionDashboard: React.FC = () => { > Newest Repo

-
-
-
- {oldestRepoCard && ( -
{oldRepo && }
- )} - {newestRepoCard && ( -
-
- {oldRepo && } -
-
- )} -
-
-
+ +
+
+ {oldestRepoCard && ( +
{oldRepo && }
+ )} + {newestRepoCard && ( +
+
{oldRepo && }
+
+ )} +
+
+
-
- - - -
+
+ + +
- ) : ( - <> +
); -}; + }; + + + export default VersionDashboard -export default VersionDashboard; diff --git a/src/app/page.tsx b/src/app/page.tsx index eeb2a19..0293890 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,12 +1,14 @@ -import Image from "next/image"; - -import "../Styles/Dashboard/followerProgress.css" +import React from 'react'; +import "../Styles/Dashboard/followerProgress.css"; export default function Home() { - return ( -

nkn

+ return ( +
+

Welcome to Desktop Version

+

Other Content

+
); }