Compare commits
1 Commits
e09e1d04d0
...
fix
| Author | SHA1 | Date | |
|---|---|---|---|
| d06504ee2d |
@@ -7,8 +7,8 @@ import useRequireAuth from "../../hooks/useRequireAuth.jsx"
|
||||
import ButtonGreen from "../../components/Buttons/ButtonGreen.jsx"
|
||||
import { motion } from "framer-motion"
|
||||
|
||||
const PlayerSetup = () => {
|
||||
const [username] = useRequireAuth({ key: "username", redirectTo: "/" })
|
||||
const GameLobbySetup = () => {
|
||||
const [username] = useRequireAuth({ key: "username", redirectTo: "/login" })
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
|
||||
@@ -18,18 +18,17 @@ const PlayerSetup = () => {
|
||||
const [isPublic, setIsPublic] = useState(true)
|
||||
|
||||
const handleCreateLobby = () => {
|
||||
const privacyFlag = isPublic ? 0 : 1
|
||||
console.log({
|
||||
deckIds,
|
||||
playerCount: maxPlayers,
|
||||
privacy: privacyFlag,
|
||||
maxPlayers,
|
||||
isPublic,
|
||||
})
|
||||
// Itt küldd el az API-nak a lobby létrehozását
|
||||
// navigate("/game-lobby", { state: { lobbyId: response.lobbyId } })
|
||||
}
|
||||
|
||||
if (deckIds.length === 0) {
|
||||
navigate("/choosedeck")
|
||||
navigate("/choose-deck")
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -116,7 +115,7 @@ const PlayerSetup = () => {
|
||||
<div className="flex justify-center gap-4 mt-8">
|
||||
<ButtonGreen
|
||||
text="Vissza"
|
||||
onClick={() => navigate("/choosedeck")}
|
||||
onClick={() => navigate("/choose-deck")}
|
||||
width="w-auto px-8"
|
||||
className="bg-gray-600 hover:bg-gray-700"
|
||||
/>
|
||||
@@ -132,4 +131,4 @@ const PlayerSetup = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default PlayerSetup
|
||||
export default GameLobbySetup
|
||||
|
||||
Reference in New Issue
Block a user