removed tags alignment

This commit is contained in:
ue 2019-08-28 20:33:01 +03:00
parent b36ba8d5d7
commit 0f512be069
3 changed files with 17 additions and 11 deletions

View File

@ -1,17 +1,15 @@
import React, { Fragment } from 'react';
import React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
import styles from './tagStyles';
const Tag = ({ onPress, isPin, value, isPostCardTag }) => (
<Fragment>
<TouchableOpacity onPress={() => onPress && onPress(value)}>
<View
style={[styles.textWrapper, isPin && styles.isPin, isPostCardTag && styles.isPostCardTag]}
>
<Text style={[styles.text]}>{value}</Text>
</View>
</TouchableOpacity>
</Fragment>
<TouchableOpacity onPress={() => onPress && onPress(value)}>
<View
style={[styles.textWrapper, isPin && styles.isPin, isPostCardTag && styles.isPostCardTag]}
>
<Text style={[styles.text]}>{value}</Text>
</View>
</TouchableOpacity>
);
export default Tag;

View File

@ -3,5 +3,11 @@ import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
container: {
flexDirection: 'row',
marginLeft: -20,
marginRight: -20,
height: 30,
},
firstTag: {
marginLeft: 10,
},
});

View File

@ -27,7 +27,9 @@ class TagsView extends PureComponent {
data={tags}
horizontal
renderItem={({ item, index }) => (
<Tag key={index} value={item} isPin={index === 0} onPress={handleOnTagPress} />
<View style={index === 0 && styles.firstTag}>
<Tag key={index} value={item} isPin={index === 0} onPress={handleOnTagPress} />
</View>
)}
keyExtractor={item => item}
/>