diff --git a/client/src/common/contexts/SettingsProvider.jsx b/client/src/common/contexts/SettingsProvider.jsx new file mode 100644 index 0000000..fdd35be --- /dev/null +++ b/client/src/common/contexts/SettingsProvider.jsx @@ -0,0 +1,18 @@ +import {createContext, useState} from "react"; + +export const SettingsContext = createContext({}); + +export const SettingsProvider = ({children}) => { + const [rounds, setRounds] = useState(localStorage.getItem("rounds") || 10); + + const updateRounds = (newValue) => { + localStorage.setItem("rounds", newValue); + setRounds(newValue); + } + + return ( + + {children} + + ); +} \ No newline at end of file