added remove icon with ui fine tuning

This commit is contained in:
Nouman Tahir 2022-10-11 16:58:07 +05:00
parent 0331ef9ec4
commit d8973d328c
4 changed files with 20 additions and 2 deletions

View File

@ -31,6 +31,7 @@ const TagContainer = ({
communityTitle,
prefix,
suffix,
removeEnabled,
}) => {
const [label, setLabel] = useState(value);
const [isCommunity, setIsCommunity] = useState(false);
@ -96,6 +97,7 @@ const TagContainer = ({
disabled={disabled}
prefix={prefix}
suffix={suffix}
removeEnabled={removeEnabled}
/>
);
};

View File

@ -21,6 +21,8 @@ export default EStyleSheet.create({
height: 22,
backgroundColor: '$iconColor',
borderRadius: 50,
flexDirection:'row',
alignItems:'center'
},
isFilter: {
backgroundColor: 'transparent',

View File

@ -1,6 +1,8 @@
import React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
import EStyleSheet from 'react-native-extended-stylesheet';
import styles from './tagStyles';
import { Icon } from '../../../icon';
const Tag = ({
onPress,
@ -14,6 +16,7 @@ const Tag = ({
disabled,
prefix,
suffix,
removeEnabled
}) => (
<TouchableOpacity
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
@ -39,6 +42,15 @@ const Tag = ({
>
{`${prefix ? prefix : ''} ${label}${suffix ? suffix : ''}`}
</Text>
{removeEnabled && (
<Icon name="close"
iconType="MaterialCommunityIcons"
color={EStyleSheet.value('$primaryDarkText')}
size={12}
style={{paddingLeft:6}}
/>
)}
</View>
</TouchableOpacity>
);

View File

@ -12,11 +12,12 @@ export default EStyleSheet.create({
borderBottomColor: '$primaryDarkGray',
},
tagContainer:{
borderWidth:EStyleSheet.hairlineWidth,
borderColor: '$primaryDarkGray',
marginLeft:0,
marginRight:12,
backgroundColor: '$primaryLightBackground'
} as ViewStyle,
tagText:{
marginBottom:2,
color: '$primaryDarkText',
} as TextStyle,
textInput: {
@ -24,6 +25,7 @@ export default EStyleSheet.create({
fontSize: 15,
fontFamily: '$editorFont',
height: isAndroidOreo() ? 36 : 40,
minWidth: 250
} as TextStyle,
warning: {
color: '$primaryRed',