react-native-calendar-timetable icon indicating copy to clipboard operation
react-native-calendar-timetable copied to clipboard

How can we access specific item by clicking on it

Open ZakaMohyudDin opened this issue 11 months ago • 1 comments

I want to show detail of specific item in modal when I click on specific item but onPress event of item is not working

ZakaMohyudDin avatar Mar 14 '24 07:03 ZakaMohyudDin

If you want your cards to be pressable, you should create them as such. A modified example component from readme file would look like this:

export default function YourComponent({style, item, dayIndex, daysTotal}) {
    const onPress = () => {
        // do something with `item` given from props
    };

    return (
        <TouchableOpacity 
            style={{
                ...style, // apply calculated styles, be careful not to override these accidentally (unless you know what you are doing)
                backgroundColor: 'red',
                borderRadius: 10,
                elevation: 5,
            }}
            onPress={onPress}
        >
            <Text>{item.title}</Text>
            <Text>{dayIndex} of {daysTotal}</Text>
        </View>
    );
}

dorkyboi avatar Jun 20 '24 12:06 dorkyboi