refactor: single emoji fix

This commit is contained in:
Jakub Grzywacz 2021-07-08 22:44:05 +02:00
parent 0ebdb18b0e
commit 935fe7009f
No known key found for this signature in database
GPG Key ID: 5BBB685871FF63C4

View File

@ -16,7 +16,7 @@ export class SingleEmoji extends React.Component<{
onPress={() => this.props.onPress(this.props.item)} onPress={() => this.props.onPress(this.props.item)}
style={styles.container} style={styles.container}
> >
<View style={{ justifyContent: 'center', alignItems: 'center' }}> <View style={styles.iconContainer}>
<Text style={{ fontSize: this.props.emojiSize }}> <Text style={{ fontSize: this.props.emojiSize }}>
{this.props.item.emoji} {this.props.item.emoji}
</Text> </Text>
@ -26,26 +26,7 @@ export class SingleEmoji extends React.Component<{
} }
} }
// export const SingleEmoji = ({
// item,
// onPress,
// emojiSize,
// }: {
// item: EmojiType;
// onPress: (emojiObject: EmojiType) => void;
// emojiSize: number;
// }) => {
// if (item.slug !== 'blank_emoji')
// return (
// <TouchableOpacity onPress={() => onPress(item)} style={styles.container}>
// <View>
// <Text style={{ fontSize: emojiSize }}>{item.emoji}</Text>
// </View>
// </TouchableOpacity>
// );
// else return <View style={styles.container} />;
// };
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { flex: 1, padding: 8 }, container: { flex: 1, padding: 8 },
iconContainer: { justifyContent: 'center', alignItems: 'center' },
}); });