Skip to content

Commit

Permalink
Update human and bots default values
Browse files Browse the repository at this point in the history
  • Loading branch information
Selvio committed Nov 28, 2024
1 parent af38a61 commit a829a43
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/components/InitialView/InitialView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const InitialView: FC<InitialViewProps> = ({ startGame }) => {
<div className="flex items-center gap-6 justify-center mb-8">
<div className="text-3xl">
Logged In as:{" "}
<span className="bg-yellow-400 px-2">
<span className="text-white text-shadow-custom">
{accountData.auth_name}
</span>
</div>
Expand Down
43 changes: 20 additions & 23 deletions src/components/SetNameModal/SetNameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,29 +123,26 @@ const SetNameModal: FC<SetNameModalProps> = ({
</div>
<div className="flex justify-between">
{Array.from({ length: MAX_PLAYERS }, (_, i) => i + 1).map(
(value) => {
if (value === 1) return null;
return (
<label
className="flex items-center gap-2"
htmlFor={`players-${value}`}
key={value}
>
<input
checked={players === value}
className={cx(
"appearance-none w-7 h-7 rounded-full border-4 border-gray-500 transition-all duration-200 cursor-pointer",
"checked:bg-yellow-400 checked:shadow-[0_0_6px_2px_rgba(255,223,0,0.08),0_0_15px_4px_rgba(255,223,0,0.15)]",
)}
id={`players-${value}`}
onChange={handleSelectPlayers}
type="radio"
value={value}
/>
{value}
</label>
);
},
(value) => (
<label
className="flex items-center gap-2"
htmlFor={`players-${value}`}
key={value}
>
<input
checked={players === value}
className={cx(
"appearance-none w-7 h-7 rounded-full border-4 border-gray-500 transition-all duration-200 cursor-pointer",
"checked:bg-yellow-400 checked:shadow-[0_0_6px_2px_rgba(255,223,0,0.08),0_0_15px_4px_rgba(255,223,0,0.15)]",
)}
id={`players-${value}`}
onChange={handleSelectPlayers}
type="radio"
value={value}
/>
{value}
</label>
),
)}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/context/AppContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const AppContextProvider: FC<PropsWithChildren> = ({ children }) => {
});
const [accountData, setAccountData] = useState<Account>();
const [region, setRegion] = useState<Region | null>(null);
const [players, setPlayers] = useState(2);
const [bots, setBots] = useState(0);
const [players, setPlayers] = useState(1);
const [bots, setBots] = useState(2);

const { data: userData, isLoading: isLoadingUserData } =
useQuery<AuthResponse>({
Expand Down
4 changes: 2 additions & 2 deletions src/context/useAppContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ interface AppContextInterface {
export const AppContext = createContext<AppContextInterface>({
accountData: undefined,
bestRegion: null,
bots: 0,
bots: 2,
gameData: { petName: "", code: "", type: EGameType.SOLO },
globalStats: undefined,
isLoadingGlobalStats: false,
isLoadingUserData: false,
keys: null,
players: 2,
players: 1,
region: null,
setAccountData: () => {},
setBots: () => {},
Expand Down

0 comments on commit a829a43

Please sign in to comment.