-
Notifications
You must be signed in to change notification settings - Fork 0
/
GlobalContext.ts
37 lines (34 loc) · 1.09 KB
/
GlobalContext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { UserCredential } from "firebase/auth";
import { createContext } from "react";
import { UserAccountDocument } from "./util/database";
/**
* @param {boolean} darkMode
* A true/false value representing whether the app is in dark mode. Should be used for modal backgrounds,
* text colors, etc.
*
* @param {number} dragSensitivity
* A number between 0 and 2 representing the sensitivity of drag motions when playing the game.
*
* @param {number} doubleTapDelay
* A number representing how many miliseconds delay of tolerance are allowed between two taps for it to
* count as a double tap.
*
* @param {number} playAudio
* A boolean representing whether the app should play sound effects or not.
*/
interface GlobalContext {
darkMode: boolean,
dragSensitivity: number,
doubleTapDelay: number,
playAudio: boolean,
userCredential?: UserCredential,
userData?: UserAccountDocument,
}
export const defaultSettings = {
darkMode: false,
dragSensitivity: 60,
doubleTapDelay: 250,
playAudio: true,
}
const GC = createContext<GlobalContext>({ ...defaultSettings });
export default GC;