-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cases] error handling and feedback improvements (#91)
* [feat] add loading feedback to qr code scanner button. * [feat] add loading feedback to AddCase screen button. * [feat] add loading feedback to confirm eligibility button. * [feat] loading feedback for ineligibility and opt out actions. * [feat] add loading feedback to file claim action. * [fix] restructure CaseScreen and CaseContext to prevent unnecessary reloads. * [refactor] integrate getCaseStatus with case context. * [refactor] case status -> claim status. * [feat] create basic loading spinner component. * [feat] replace loading text with spinner on all screens. * [feat] add light grey background as image placeholder. * [refactor] loading screen component. * [refactor] move add/remove case to case context. * [cleanup] add ios/ to gitignore. * [cleanup] use case context function for fetching context data. * [cleanup] remove unused import. * [wip][feat] configure timeout behavior for poor network connection settings. * [refactor] move resetAndPushToRoute to auth queries; cleanup. * [feat] create resetAndPushToHome that navigates to the home screen (relative to whether they're logged in or not). * [feat] create wip full stop error function; refactor screen loading component. * [cleanup] misc cleanup; update screen loading text for clarity. * [cleanup] update doc strings. * [feat] begin integrating error handler for case fetching functions. * [wip] continue adding error handling to case related screens. * [feat] add error handler to all case related screens. * [fix] case context code performance and clarity improvements. * [cleanup] misc refactoring and adding comments. * [fix] resolve missing caseData on FileClaim screen.
- Loading branch information
1 parent
d37a573
commit 3154f46
Showing
28 changed files
with
567 additions
and
307 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ node_modules/ | |
.expo/ | ||
dist/ | ||
web-build/ | ||
ios/ | ||
|
||
# Native | ||
*.orig.* | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
42 changes: 42 additions & 0 deletions
42
src/Components/ScreenLoadingComponent/ScreenLoadingComponent.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,42 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { View, Text } from 'react-native'; | ||
import { ActivityIndicator } from 'react-native-paper'; | ||
|
||
import styles from './styles'; | ||
import { colors } from '../../styles/colors'; | ||
import { fonts } from '../../styles/fonts'; | ||
|
||
export default function ScreenLoadingComponent() { | ||
const [loadingPromptExists, setLoadingPromptExists] = | ||
useState<boolean>(false); | ||
const [timeoutReached, setTimeoutReached] = useState<boolean>(false); | ||
|
||
useEffect(() => { | ||
setTimeout(() => { | ||
setLoadingPromptExists(true); | ||
setTimeout(() => { | ||
setTimeoutReached(true); | ||
}, 10000); | ||
}, 5000); | ||
}, []); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<ActivityIndicator size="small" color={colors.midRed} /> | ||
{loadingPromptExists && ( | ||
<View> | ||
{!timeoutReached ? ( | ||
<Text style={fonts.body}>This is taking longer than usual...</Text> | ||
) : ( | ||
<Text style={fonts.body}> | ||
There seems to be an issue connecting with Impact Fund servers...{' '} | ||
{'\n'} | ||
{'\n'} | ||
Please check your internet connection or try again later. | ||
</Text> | ||
)} | ||
</View> | ||
)} | ||
</View> | ||
); | ||
} |
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,10 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
export default StyleSheet.create({ | ||
container: { | ||
width: 300, | ||
alignItems: 'center', | ||
marginTop: 20, | ||
rowGap: 20, | ||
}, | ||
}); |
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.