-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 reportsOrganization
- Loading branch information
Showing
38 changed files
with
315 additions
and
86 deletions.
There are no files selected for viewing
Binary file modified
BIN
+565 Bytes
(100%)
...s-snapshots/Mobile-checks-that-settings-page-can-be-opened-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.5 KB
(100%)
...s-snapshots/Mobile-checks-that-settings-page-can-be-opened-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+22 Bytes
(100%)
...apshots/Mobile-loads-the-budget-page-with-budgeted-amounts-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-188 Bytes
(99%)
...ots/Mobile-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, { | ||
type ReactNode, | ||
createContext, | ||
useState, | ||
useContext, | ||
useEffect, | ||
} from 'react'; | ||
|
||
import debounce from 'debounce'; | ||
|
||
type IScrollContext = { | ||
scrollY: number | undefined; | ||
isBottomReached: boolean; | ||
}; | ||
|
||
const ScrollContext = createContext<IScrollContext | undefined>(undefined); | ||
|
||
type ScrollProviderProps = { | ||
children?: ReactNode; | ||
}; | ||
|
||
export default function ScrollProvider({ children }: ScrollProviderProps) { | ||
const [scrollY, setScrollY] = useState(undefined); | ||
const [isBottomReached, setIsBottomReached] = useState(false); | ||
|
||
useEffect(() => { | ||
const listenToScroll = debounce(e => { | ||
setScrollY(e.target?.scrollTop || 0); | ||
setIsBottomReached( | ||
e.target?.scrollHeight - e.target?.scrollTop <= e.target?.clientHeight, | ||
); | ||
}, 20); | ||
|
||
window.addEventListener('scroll', listenToScroll, { | ||
capture: true, | ||
passive: true, | ||
}); | ||
return () => | ||
window.removeEventListener('scroll', listenToScroll, { | ||
capture: true, | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<ScrollContext.Provider | ||
value={{ scrollY, isBottomReached }} | ||
children={children} | ||
/> | ||
); | ||
} | ||
|
||
export function useScroll(): IScrollContext { | ||
return useContext(ScrollContext); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
packages/desktop-client/src/components/accounts/MobileAccounts.js
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
2 changes: 1 addition & 1 deletion
2
packages/desktop-client/src/components/manager/ConfigServer.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
Oops, something went wrong.