-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Es/unable to cancel invite #263
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a67f5f2
chore: created screen
ErikSin 9e03945
chore: translations
ErikSin 844a199
chore:update invite with tanstack
ErikSin b49a072
chore: added navigation to unable to invite screen
ErikSin ee597ab
chore: add notes
ErikSin 9a61da1
chore: added missing useEffect dependency
ErikSin 9231295
chore: switch project on accept of invite
ErikSin 8d0119b
chore: added screen to navigation
ErikSin 11cca63
core:remove unneccessary plural
ErikSin c6448dd
chore: translations
ErikSin 294d398
chore: remove unecessary console log
ErikSin 81b8932
chore: pr rfixes
ErikSin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
76 changes: 76 additions & 0 deletions
76
...ontend/screens/Settings/ProjectSettings/YourTeam/ReviewAndInvite/UnableToCancelInvite.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,76 @@ | ||
import * as React from 'react'; | ||
import {StyleSheet, View} from 'react-native'; | ||
import {Button} from '../../../../../sharedComponents/Button'; | ||
import ErrorIcon from '../../../../../images/Error.svg'; | ||
import {defineMessages, useIntl} from 'react-intl'; | ||
import {Text} from '../../../../../sharedComponents/Text'; | ||
import {DeviceNameWithIcon} from '../../../../../sharedComponents/DeviceNameWithIcon'; | ||
import {RoleWithIcon} from '../../../../../sharedComponents/RoleWithIcon'; | ||
import { | ||
COORDINATOR_ROLE_ID, | ||
NativeRootNavigationProps, | ||
} from '../../../../../sharedTypes'; | ||
import {useProjectSettings} from '../../../../../hooks/server/projects'; | ||
|
||
const m = defineMessages({ | ||
unableToCancel: { | ||
id: 'screens.Settings.YourTeam.unableToCancel', | ||
defaultMessage: 'Unable to Cancel Invitation', | ||
}, | ||
deviceHasJoined: { | ||
id: 'screens.Settings.YourTeam.deviceHasJoined', | ||
defaultMessage: 'Device Has Joined {projectName}', | ||
}, | ||
close: { | ||
id: 'screens.Settings.YourTeam.close', | ||
defaultMessage: 'Close', | ||
}, | ||
}); | ||
|
||
export const UnableToCancelInvite = ({ | ||
navigation, | ||
route, | ||
}: NativeRootNavigationProps<'UnableToCancelInvite'>) => { | ||
const {formatMessage} = useIntl(); | ||
const {role, ...deviceInfo} = route.params; | ||
const {data} = useProjectSettings(); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<View style={{alignItems: 'center'}}> | ||
<ErrorIcon /> | ||
<Text style={{marginTop: 20, fontSize: 20, fontWeight: 'bold'}}> | ||
{formatMessage(m.unableToCancel)} | ||
</Text> | ||
{data?.name && ( | ||
<Text style={{marginTop: 10}}> | ||
{formatMessage(m.deviceHasJoined, {projectName: data.name})} | ||
</Text> | ||
)} | ||
<DeviceNameWithIcon {...deviceInfo} style={{marginTop: 10}} /> | ||
<RoleWithIcon | ||
style={{marginTop: 20}} | ||
role={role === COORDINATOR_ROLE_ID ? 'coordinator' : 'participant'} | ||
/> | ||
</View> | ||
<Button | ||
style={{marginTop: 10}} | ||
fullWidth | ||
onPress={() => { | ||
navigation.navigate('YourTeam'); | ||
}}> | ||
{formatMessage(m.close)} | ||
</Button> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
padding: 20, | ||
paddingTop: 80, | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
flex: 1, | ||
}, | ||
}); |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setTimeout is a workaround.
Race condition is happening where:
allprojects
is refetchedBetween steps 2 and 3 there is a race condition, where the project has not been created yet, so the project in unavailable. This was discussed with @EvanHahn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see adding a comment explaining this, but I hope to fix this soon in any case.