added delete btn in settings screen

This commit is contained in:
Sadaqat Ali 2022-08-28 23:23:44 +05:00
parent f7fb64bafa
commit 185a6c1552
6 changed files with 37 additions and 1 deletions

View File

@ -54,4 +54,8 @@ export default EStyleSheet.create({
textButton: {
justifyContent: 'center',
},
iconBtn: {
borderRadius: 0,
width: 50,
},
});

View File

@ -4,11 +4,13 @@ import { View, Text } from 'react-native';
// Constants
// Components
import EStyleSheet from 'react-native-extended-stylesheet';
import { DropdownButton } from '../../dropdownButton';
import { TextButton } from '../../buttons';
import { ToggleSwitch } from '../../toggleSwitch';
// Styles
import styles from './settingsItemStyles';
import IconButton from '../../iconButton';
class SettingsItemView extends PureComponent {
/* Props
@ -73,6 +75,17 @@ class SettingsItemView extends PureComponent {
/>
);
case 'icon':
return (
<IconButton
onPress={() => handleOnButtonPress(actionType)}
name="trash-bin-outline"
size={24}
color={EStyleSheet.value('$primaryRed')}
style={styles.iconBtn}
/>
);
default:
return (
<TextButton

View File

@ -251,7 +251,8 @@
"feedback_success": "Email successfully open",
"feedback_fail": "Email client could not open",
"server_fail": "Server not available",
"show_imgs": "Show Images"
"show_imgs": "Show Images",
"delete_account": "Delete Account"
},
"voters": {
"voters_info": "Voters Info",

View File

@ -1,6 +1,8 @@
const SHOW_HIDE_IMGS = 'show_hide_images';
const DELETE_ACCOUNT = 'delete_account';
// TODO: Add more settings types here
export default {
SHOW_HIDE_IMGS,
DELETE_ACCOUNT
};

View File

@ -312,6 +312,11 @@ class SettingsContainer extends Component {
case 'feedback':
this._handleSendFeedback();
break;
case settingsTypes.DELETE_ACCOUNT:
console.log('delete account');
break;
default:
break;
}

View File

@ -277,6 +277,17 @@ const SettingsScreen = ({
actionType="feedback"
handleOnButtonPress={handleOnButtonPress}
/>
<SettingsItem
title={intl.formatMessage({
id: 'settings.delete_account',
})}
text={intl.formatMessage({
id: 'settings.delete_account',
})}
type="icon"
actionType={settingsTypes.DELETE_ACCOUNT}
handleOnButtonPress={handleOnButtonPress}
/>
</View>
</ScrollView>
</Fragment>