From 586c73ab3e35a514d3cd0785f5ed385d285ec725 Mon Sep 17 00:00:00 2001 From: Samuel Breznjak Date: Mon, 10 Jul 2023 01:15:27 +0200 Subject: [PATCH] made app responsive --- src/components/Card.tsx | 20 ++- src/components/IconButton.tsx | 7 +- src/components/LeaderboardMain.tsx | 15 +- src/components/Navbar.tsx | 7 +- src/components/ProfileDropdown.tsx | 2 +- src/components/ProfileDropdownButton.tsx | 2 +- src/components/Score.tsx | 2 +- src/components/SignInMain.tsx | 3 +- src/components/TryAgainModal.tsx | 8 +- src/components/VSComponent.tsx | 5 +- src/index.css | 219 +++++++++++++++++++---- src/pages/ErrorPage.tsx | 10 +- src/pages/Game.tsx | 8 +- src/pages/Home.tsx | 6 +- tailwind.config.js | 26 +++ 15 files changed, 257 insertions(+), 83 deletions(-) diff --git a/src/components/Card.tsx b/src/components/Card.tsx index b7fe252..1c99b30 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -22,34 +22,36 @@ export default function Card({ name, avatar_url, stargazers_count, showButtonsPr } return ( -
- {name} +
+ {name} -

{name}

+

{name}

-

has

+

has

{showButtons ?
} + icon={} onClick={() => handleButtonClick((stargazers_count > prevRepo?.stargazers_count))} text="Higher" + classNames="card-button m700:mb-2" /> } + icon={} onClick={() => handleButtonClick(stargazers_count < prevRepo?.stargazers_count)} text="Lower" + classNames="card-button m700:mb-1" />
-

stars than {prevRepo?.name}

+

stars than {prevRepo?.name}

:
-

+

{showButtonsProp ? -

stars on github

+

stars on github

}
diff --git a/src/components/IconButton.tsx b/src/components/IconButton.tsx index d1a52ab..c48de0e 100644 --- a/src/components/IconButton.tsx +++ b/src/components/IconButton.tsx @@ -1,12 +1,13 @@ type ButtonProps = { onClick: any icon: JSX.Element, - text: string + text: string, + classNames: string } -export default function IconButton({ onClick, icon, text }: ButtonProps) { +export default function IconButton({ onClick, icon, text, classNames }: ButtonProps) { return ( - diff --git a/src/components/LeaderboardMain.tsx b/src/components/LeaderboardMain.tsx index 175f968..b89c8ce 100644 --- a/src/components/LeaderboardMain.tsx +++ b/src/components/LeaderboardMain.tsx @@ -36,18 +36,19 @@ export default function LeaderboardMain() { return (
-
-

+
+

Leaderboard

-
- +
+
- + - + + @@ -55,7 +56,7 @@ export default function LeaderboardMain() { return( - + ) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index f531c43..fc131d7 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -11,17 +11,18 @@ export default function Navbar() {
## UsernameHigh scoreHigh scoreHS
{index + 1}{player.username}{player.username} {player.high_score}