-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into goal_speedup2
- Loading branch information
Showing
25 changed files
with
457 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
packages/desktop-client/src/components/budget/BudgetMonthCountContext.js
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
packages/desktop-client/src/components/budget/BudgetMonthCountContext.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { | ||
createContext, | ||
type Dispatch, | ||
type ReactNode, | ||
type SetStateAction, | ||
useContext, | ||
useState, | ||
} from 'react'; | ||
|
||
type BudgetMonthCountContextValue = { | ||
displayMax: number; | ||
setDisplayMax: Dispatch<SetStateAction<number>>; | ||
}; | ||
|
||
let BudgetMonthCountContext = createContext<BudgetMonthCountContextValue>(null); | ||
|
||
type BudgetMonthCountProviderProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
export function BudgetMonthCountProvider({ | ||
children, | ||
}: BudgetMonthCountProviderProps) { | ||
let [displayMax, setDisplayMax] = useState(1); | ||
|
||
return ( | ||
<BudgetMonthCountContext.Provider value={{ displayMax, setDisplayMax }}> | ||
{children} | ||
</BudgetMonthCountContext.Provider> | ||
); | ||
} | ||
|
||
export function useBudgetMonthCount() { | ||
return useContext(BudgetMonthCountContext); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.