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