-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## End game screen & Homepage preferences ### GameBoard/page.tsx - Added check that if lobbyState exists and a game doesn't exist that we send the user to the lobby. - Added check if we have winners in the gameState. If we have winners we permanently open the preference page with the end game screen. ### Preferences/page.tsx - Added Preferences screen for the homePage it is similar to the preferences currently it adds the block list and logout. ### Controlhub.tsx - Added Preferences link ### OpponentCardTray.tsx - Changed sendManualDisconnectMessage to sendMessage since they do the same. ### SetUp.tsx (lobby) - Added the manualDisconnect to the handleExit function since we know a user wishes to leave the lobby if they click exit. ### PreferencesComponent.tsx - Redid the preference page so we receive the tabs, openState, title and subtitle from a parent component. - Changed the background color so its more in line with the design - minor design fixes for differentiating between homePage and gameBoard ### BlockListTab.tsx - Added the BlockListTab to list of components for handling blocking users. ### Preferences.types.ts - Added buttonFnc to preference buttons this way we send what the buttons does from a parent component - remade the PreferenceProps to support receiving properties from a parent component ### CardSleevesTab.tsx - Removed the scroll from cardSleevesTab and moved it to a parent component (this will make scrolls available in other screens). ### CurrentGameTab.tsx - Added Concede functionality - Minor design fix ### EndGameTab.tsx - Added a new endGameTab which checks what type of game we are in and returns the appropriate component. ### GameOptionsTab.tsx & KeyboardShortcutsTab.tsx - Minor design fix ### BlockedUser.tsx - Added a new component that represents a row in blocked users accepts username for now. ### EndGameOptionsCustom.tsx - New EndGameTab component for custom/private games ### EndGameOptionsQuickMatch - New EndGameTab component for quickMatches - I used the API call enter-queue to reenter the user into a queue. After multiple testing scenarios this was by far the most elegant and stable option. ### PreferenceButton.tsx - Added buttonFunctionalities - Added disabled check. ### VerticalTabs.tsx - Added the scroll for overflow here so its accessible to all subTabs. - Added the endGame screen tab, BlockedUserTab and Logout tab. ### Game.context.tsx - Added resetStates which resets the states of GameState and LobbyState. I found that we need to do this to requeue a user into the queue otherwise the user will just be sent back into the game. - Added socketKey as a userEffect dependable since when a user wanted to requeue we closed the connection with the socket but the user wasn't able to reconnect to a new socket since there wasn't a dependable triggered. This way when we change the socketKey for the user in resetStates we can make sure the user can requeue with a new socket. - Removed sendManualDisconnectMessage since it was redundant (we can send the message via sendMessage()). ### User.context.tsx - Added callbackUrl to logout function. Since if we logout in the preference page it redirects to the preference page which it shouldn't. This way we always redirect to the homepage. ### Lobby/page.tsx - Changed how we check if a game is onGoing we have a new parameter in the lobbyState that gives us that information. We do this since otherwise when users want to rejoin the lobby from the match we can't send gameState as null from the BE hence why we set this parameter to allow users back into the lobby. ### quickGame/page.tsx - minor design fixes. ------------------------------------------------- ### new changes - Refactored the way time was count down when two users matched in the quickMatch - Refactored both endgame screens to allow for users to send and receive rematch requests - Refactored states so all rematches, requeues work correctly. - Refactored requeue to use the same socket instead of an API call - Fixes to certain hooks so we don't get warnings or errors when requeueing or rematching. --------- Co-authored-by: Dan Bastin <[email protected]>
- Loading branch information
Showing
25 changed files
with
809 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
'use client'; | ||
import { Box, Typography } from '@mui/material'; | ||
import PreferencesComponent from '@/app/_components/_sharedcomponents/Preferences/PreferencesComponent'; | ||
import React from 'react'; | ||
import { s3ImageURL } from '@/app/_utils/s3Utils'; | ||
import { useRouter } from 'next/navigation' | ||
|
||
const Preferences: React.FC = () => { | ||
const router = useRouter(); | ||
const handleExit = () => { | ||
router.push('/'); | ||
} | ||
|
||
// ----------------------Styles-----------------------------// | ||
const styles = { | ||
lobbyTextStyle:{ | ||
ml:'30px', | ||
fontSize: '3.0em', | ||
fontWeight: '600', | ||
color: 'white', | ||
alignSelf: 'flex-start', | ||
mb: '0px', | ||
cursor: 'pointer', | ||
}, | ||
mainContainer:{ | ||
height: '100vh', | ||
overflow: 'hidden', | ||
backgroundImage: `url(${s3ImageURL('ui/board-background-1.webp')})`, | ||
backgroundSize: 'cover', | ||
backgroundPosition: 'center', | ||
display:'grid', | ||
}, | ||
disclaimer: { | ||
position: 'absolute', | ||
bottom: 0, | ||
width: '100%', | ||
padding: '1rem', | ||
textAlign: 'center', | ||
fontSize: '0.90rem', | ||
} | ||
}; | ||
|
||
return ( | ||
<Box sx={styles.mainContainer}> | ||
<Typography sx={styles.lobbyTextStyle} onClick={handleExit}>KARABAST</Typography> | ||
<PreferencesComponent | ||
isPreferenceOpen={true} | ||
tabs={['keyboardShortcuts','cardSleeves','gameOptions','blockList']} | ||
variant={'homePage'} | ||
/> | ||
<Typography variant="body1" sx={styles.disclaimer}> | ||
Karabast is in no way affiliated with Disney or Fantasy Flight Games. | ||
Star Wars characters, cards, logos, and art are property of Disney | ||
and/or Fantasy Flight Games. | ||
</Typography> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default Preferences; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 0 additions & 61 deletions
61
src/app/_components/_sharedcomponents/Preferences/Preferences.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.