-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: screen to indicate when cancel invite was unsuccessful (#263)
* chore: created screen * chore: translations * chore:update invite with tanstack * chore: added navigation to unable to invite screen * chore: add notes * chore: added missing useEffect dependency * chore: switch project on accept of invite * chore: added screen to navigation * core:remove unneccessary plural * chore: translations * chore: remove unecessary console log * chore: pr rfixes
- Loading branch information
Showing
9 changed files
with
185 additions
and
37 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
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