Skip to content

Commit

Permalink
- Added some visual polish to the lobby.
Browse files Browse the repository at this point in the history
  • Loading branch information
CheBato committed Feb 27, 2025
1 parent 87d338e commit f0fb71b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const JoinableGame: React.FC = () => {
const payload = {
lobbyId: lobbyId,
user: { id: user?.id || sessionStorage.getItem('anonymousUserId'),
username:user?.username || 'anonymousUser'+sessionStorage.getItem('anonymousUserId')?.substring(0,6) },
username:user?.username || 'anonymous '+sessionStorage.getItem('anonymousUserId')?.substring(0,6) },
};
const response = await fetch(`${process.env.NEXT_PUBLIC_ROOT_URL}/api/join-lobby`, {
method: 'POST',
Expand Down
6 changes: 4 additions & 2 deletions src/app/_components/Lobby/Deck/Deck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ const Deck: React.FC = () => {
height: '1px',
};
const scrollableBoxStyleSideboard = {

height: '36vh',
overflow:'auto',
};
const scrollableBoxStyle = {

height: usersSideboard?.length > 0 ? '50vh' : '86vh',
overflow:'auto',
};
const mainContainerStyle = {
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const CreateGameForm = () => {
try {
const payload = {
user: { id: user?.id || sessionStorage.getItem('anonymousUserId'),
username:user?.username || 'anonymousUser'+sessionStorage.getItem('anonymousUserId')?.substring(0,6) },
username:user?.username || 'anonymous '+sessionStorage.getItem('anonymousUserId')?.substring(0,6) },
deck: deckData,
isPrivate: privacy === 'Private',
format: format,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const QuickGameForm: React.FC<ICreateGameFormProps> = () => {
try {
const payload = {
user: { id: user?.id || sessionStorage.getItem('anonymousUserId'),
username:user?.username || 'anonymousUser'+sessionStorage.getItem('anonymousUserId')?.substring(0,6) },
username:user?.username || 'anonymous '+sessionStorage.getItem('anonymousUserId')?.substring(0,6) },
deck: deckData,
};
const response = await fetch(`${process.env.NEXT_PUBLIC_ROOT_URL}/api/enter-queue`,
Expand Down Expand Up @@ -121,6 +121,7 @@ const QuickGameForm: React.FC<ICreateGameFormProps> = () => {
display: 'block',
ml: 'auto',
mr: 'auto',
mt: '5px',
},
errorMessageStyle: {
color: 'var(--initiative-red);',
Expand Down
2 changes: 1 addition & 1 deletion src/app/_contexts/Game.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const GameProvider = ({ children }: { children: ReactNode }) => {
const newSocket = io(`${process.env.NEXT_PUBLIC_ROOT_URL}`, {
path: '/ws',
query: {
user: JSON.stringify(user ? user : { username: 'anonymousUser'+anonymousUserId?.substring(0,6), id: anonymousUserId }),
user: JSON.stringify(user ? user : { username: 'anonymous '+anonymousUserId?.substring(0,6), id: anonymousUserId }),
lobby: JSON.stringify({ lobbyId:lobbyId ? lobbyId : null })
},
});
Expand Down

0 comments on commit f0fb71b

Please sign in to comment.