Added the roundHistory & groupName states in the GroupContext.jsx
This commit is contained in:
parent
05509ddfda
commit
0725a90976
@ -8,6 +8,8 @@ export const GroupProvider = ({children}) => {
|
|||||||
const [allGroups, setAllGroups] = useState([]);
|
const [allGroups, setAllGroups] = useState([]);
|
||||||
const [groups, setGroups] = useState([]);
|
const [groups, setGroups] = useState([]);
|
||||||
const [round, setRound] = useState([]);
|
const [round, setRound] = useState([]);
|
||||||
|
const [roundHistory, setRoundHistory] = useState([]);
|
||||||
|
const [groupName, setGroupName] = useState("");
|
||||||
|
|
||||||
const handleJoin = (group) => {
|
const handleJoin = (group) => {
|
||||||
setGroups(groups => [...groups, {...group, capital: 25000}]);
|
setGroups(groups => [...groups, {...group, capital: 25000}]);
|
||||||
@ -64,7 +66,8 @@ export const GroupProvider = ({children}) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GroupContext.Provider value={{groups, round, handleRound, getGroupById, updateCapital, endRound, allGroups, resetGame}}>
|
<GroupContext.Provider value={{groups, round, handleRound, getGroupById, updateCapital, endRound,
|
||||||
|
allGroups, resetGame, groupName, setGroupName, roundHistory, setRoundHistory}}>
|
||||||
{children}
|
{children}
|
||||||
</GroupContext.Provider>
|
</GroupContext.Provider>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user