-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…y-progress finish/interim screens: re-use layout from blocker screens ; (#820) M2-6958: [Mobile]: Implement UI components for displaying progress ; M2-6960: [Mobile]: Integrate progress tracking into Finish/Interim screens ; M2-6959: [Mobile]: Integrate progress tracking into autocompletion blocker-progress screens ; M2-6949: [Mobile]: Implement App-level timer and hook which will call auto completion services ; Co-authored-by: Nalivaiko, Aleksej <Nalivaiko@scnsoft.com>
- Loading branch information
Showing
40 changed files
with
766 additions
and
324 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
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,27 @@ | ||
export type SafeChecks = | ||
| 'in-progress-activity' | ||
| 'refresh' | ||
| 'start-entity' | ||
| 'uploading' | ||
| 'already-opened' | ||
| 'is-offline'; | ||
|
||
export type LogAutocompletionTrigger = | ||
| 'app-start' | ||
| 'to-foreground' | ||
| 'to-online' | ||
| 'check-availability' | ||
| 'close-entity' | ||
| 'expired-while-alert-opened' | ||
| 'retry-on-banner' | ||
| 'app-level-timer'; | ||
|
||
export type AutocompletionExecuteOptions = { | ||
checksToExclude?: Array<SafeChecks>; | ||
checksToInclude?: Array<SafeChecks>; | ||
forceUpload?: boolean; | ||
}; | ||
|
||
export type AutocompletionEventOptions = AutocompletionExecuteOptions & { | ||
logTrigger: LogAutocompletionTrigger; | ||
}; |
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
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,22 @@ | ||
import { useEffect, useRef } from 'react'; | ||
import { AppState } from 'react-native'; | ||
|
||
function useOnBackground(callback: () => void) { | ||
const callbackRef = useRef(callback); | ||
|
||
callbackRef.current = callback; | ||
|
||
useEffect(() => { | ||
const subscription = AppState.addEventListener('change', status => { | ||
if (status === 'background') { | ||
callbackRef.current(); | ||
} | ||
}); | ||
|
||
return () => { | ||
subscription.remove(); | ||
}; | ||
}, []); | ||
} | ||
|
||
export default useOnBackground; |
Oops, something went wrong.