Skip to content
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

feat: add scrim to common remove modal #1050

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 53 additions & 47 deletions packages/legacy/core/App/components/modals/CommonRemoveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, o
marginBottom: Platform.OS === 'ios' ? 108 : 80,
position: 'relative',
},
overlay: {
flex: 1,
backgroundColor: 'rgba(0,0,0,0.5)',
},
headerView: {
alignItems: 'flex-end',
marginTop: 65,
Expand Down Expand Up @@ -286,55 +290,57 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, o

return (
<Modal transparent={true} visible={visible} animationType="slide">
<View style={[styles.headerView]}>
<TouchableOpacity
accessibilityLabel={t('Global.Close')}
accessibilityRole={'button'}
testID={testIdWithKey('Close')}
onPress={() => onCancel && onCancel()}
hitSlop={hitSlop}
<View style={styles.overlay}>
<View style={[styles.headerView]}>
<TouchableOpacity
accessibilityLabel={t('Global.Close')}
accessibilityRole={'button'}
testID={testIdWithKey('Close')}
onPress={() => onCancel && onCancel()}
hitSlop={hitSlop}
>
<Icon name={'close'} size={42} color={ColorPallet.brand.modalIcon} />
</TouchableOpacity>
</View>
<SafeAreaView
edges={['left', 'right', 'bottom']}
style={[
{
backgroundColor: ColorPallet.brand.modalPrimaryBackground,
},
]}
>
<Icon name={'close'} size={42} color={ColorPallet.brand.modalIcon} />
</TouchableOpacity>
</View>
<SafeAreaView
edges={['left', 'right', 'bottom']}
style={[
{
backgroundColor: ColorPallet.brand.modalPrimaryBackground,
},
]}
>
<ScrollView style={[styles.container]}>
<>
{headerImageForType()}
{contentForType()}
</>
</ScrollView>
<View style={[styles.controlsContainer]}>
<ContentGradient backgroundColor={ColorPallet.brand.modalPrimaryBackground} height={30} />
<View style={[{ paddingTop: 10 }]}>
<Button
title={titleForConfirmButton()}
accessibilityLabel={labelForConfirmButton()}
testID={testIdForConfirmButton()}
onPress={onSubmit}
buttonType={
usage === ModalUsage.ContactRemoveWithCredentials ? ButtonType.ModalPrimary : ButtonType.ModalCritical
}
/>
</View>
<View style={[{ paddingTop: 10 }]}>
<Button
title={t('Global.Cancel')}
accessibilityLabel={t('Global.Cancel')}
testID={testIdForCancelButton()}
onPress={onCancel}
buttonType={ButtonType.ModalSecondary}
/>
<ScrollView style={[styles.container]}>
<>
{headerImageForType()}
{contentForType()}
</>
</ScrollView>
<View style={[styles.controlsContainer]}>
<ContentGradient backgroundColor={ColorPallet.brand.modalPrimaryBackground} height={30} />
<View style={[{ paddingTop: 10 }]}>
<Button
title={titleForConfirmButton()}
accessibilityLabel={labelForConfirmButton()}
testID={testIdForConfirmButton()}
onPress={onSubmit}
buttonType={
usage === ModalUsage.ContactRemoveWithCredentials ? ButtonType.ModalPrimary : ButtonType.ModalCritical
}
/>
</View>
<View style={[{ paddingTop: 10 }]}>
<Button
title={t('Global.Cancel')}
accessibilityLabel={t('Global.Cancel')}
testID={testIdForCancelButton()}
onPress={onCancel}
buttonType={ButtonType.ModalSecondary}
/>
</View>
</View>
</View>
</SafeAreaView>
</SafeAreaView>
</View>
</Modal>
)
}
Expand Down
Loading