Skip to content

Commit

Permalink
Refresh button public
Browse files Browse the repository at this point in the history
  • Loading branch information
codergautam committed Dec 16, 2024
1 parent 392e187 commit ac80cb6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
11 changes: 10 additions & 1 deletion components/home.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HeadContent from "@/components/headContent";
import { FaDiscord, FaGithub } from "react-icons/fa";
import { FaGear,FaRankingStar, FaYoutube } from "react-icons/fa6";
import { FaArrowRotateRight, FaGear,FaRankingStar, FaYoutube } from "react-icons/fa6";
import { signOut, useSession } from "@/components/auth/auth";
import 'react-responsive-modal/styles.css';
import { useEffect, useState, useRef } from "react";
Expand Down Expand Up @@ -1979,6 +1979,15 @@ setShowCountryButtons(false)
}))}}

inCoolMathGames={inCoolMathGames} maintenance={maintenance} inCrazyGames={inCrazyGames} loading={loading} onFriendsPress={()=>setFriendsModal(true)} loginQueued={loginQueued} setLoginQueued={setLoginQueued} inGame={multiplayerState?.inGame || screen === "singleplayer"} openAccountModal={() => setAccountModalOpen(true)} session={session} reloadBtnPressed={reloadBtnPressed} backBtnPressed={backBtnPressed} setGameOptionsModalShown={setGameOptionsModalShown} onNavbarPress={() => onNavbarLogoPress()} gameOptions={gameOptions} screen={screen} multiplayerState={multiplayerState} shown={!multiplayerState?.gameData?.public && !leagueModal} />

{/* reload button for public game */}
{ multiplayerState?.gameData?.public && multiplayerState?.gameData?.state === "guess" && (
<div className="gameBtnContainer" style={{position: 'fixed',top: '60px', left: '10px', zIndex: 1000000}}>

<button className="gameBtn navBtn backBtn reloadBtn" onClick={()=>reloadBtnPressed()}><FaArrowRotateRight /></button>
</div>
)}

{/* ELO/League button */}
{screen === "home" && !mapModal && session && session?.token?.secret && (
<button className="gameBtn leagueBtn" onClick={()=>{setLeagueModal(true)}} style={{backgroundColor: eloData?.league?.color }}>
Expand Down
2 changes: 1 addition & 1 deletion components/ui/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function Navbar({ maintenance, joinCodePress, inCrazyGames, inCoo
<button className="gameBtn navBtn backBtn mobile" onClick={backBtnPressed}><FaArrowLeft /></button>
</div>
{reloadBtn && (
<button className="gameBtn navBtn backBtn" style={{backgroundColor: '#000099'}} onClick={reloadBtnPressed}><FaArrowRotateRight /></button>
<button className="gameBtn navBtn backBtn reloadBtn" onClick={reloadBtnPressed}><FaArrowRotateRight /></button>
)}


Expand Down
8 changes: 8 additions & 0 deletions styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ html {
.backBtn:hover {
background-color: darkred;
}

.reloadBtn {
background-color: #000099;
// width: 100px;
}
.reloadBtn:hover {
background-color: #00005f;
}
h1, h2, h3, span {
font-weight: 500;
color: white;
Expand Down

0 comments on commit ac80cb6

Please sign in to comment.