You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
935 B
33 lines
935 B
// components/MoveListItem.test.ts
|
|
|
|
import { Move } from "../entities/Move";
|
|
import React from "react";
|
|
import { StyleSheet, Text, TouchableOpacity, ViewStyle } from "react-native";
|
|
|
|
type MoveListItemProps = {
|
|
move: Move;
|
|
onPress: () => void;
|
|
style?: ViewStyle;
|
|
};
|
|
|
|
const MoveListItem: React.FC<MoveListItemProps> = ({ move, onPress, style }) => (
|
|
<TouchableOpacity style={[styles.listItem, style]} onPress={onPress}>
|
|
<Text style={styles.listItemText} numberOfLines={1}
|
|
ellipsizeMode="tail">{move.name}, {move.type.name}: {move.power}</Text>
|
|
</TouchableOpacity>
|
|
);
|
|
|
|
const styles = StyleSheet.create({
|
|
listItem: {
|
|
backgroundColor: '#DDD',
|
|
padding: 8,
|
|
borderRadius: 8,
|
|
},
|
|
listItemText: {
|
|
color: '#333',
|
|
fontSize: 18,
|
|
},
|
|
});
|
|
|
|
export default MoveListItem;
|