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

Add `onPress` handler to `more` labels on MONTH mode.

Open TechSaq opened this issue 2 years ago • 16 comments

On click of more label, a modal should open to make additional/all events visible.

TechSaq avatar Feb 26 '22 14:02 TechSaq

Hi @TechSaq

I was Facing same issue on my calendar but i resolve this issue by this.

There is one props onPressCell , by this props ypu will get cell date and after you can filter all events by this date and then you can show all those events by modal.

const handleOnPressCell = (date) => {
   let selectedDate = getConvertedDate(date);

   let filterEvent = events.filter((item) => {
     return selectedDate === item?.date;
   });

   setTodaysEvents(filterEvent);
   if (filterEvent.length > 1) {
     setShowEventModal(true);
   }
 };

Subhash-Dhandhukiya avatar Mar 01 '22 08:03 Subhash-Dhandhukiya

Hi @Subhash-Dhandhukiya

I am using onPressCell to open Modal to add some events.

It will be better to have an onPress event for more text to display additional events in modal with some default implementation within the package and support to override the modal.

TechSaq avatar Mar 01 '22 09:03 TechSaq

Sorry for the delay.

This should be implemented. It would be glad if you create a pull request for this. Thanks

acro5piano avatar Mar 04 '22 02:03 acro5piano

Hi @acro5piano,

I will create a PR for this. I will show a default Modal to list additional events. I will also add support to override this default modal to make it more flexible.

Thanks

TechSaq avatar Mar 07 '22 03:03 TechSaq

Thanks!

acro5piano avatar Mar 07 '22 06:03 acro5piano

Hi, @acro5piano

I am working on this PR and implementation is done almost. I have added a callback function named onPressMoreLabel with onPress of moreLabel.

I need suggestions from you, onPress of moreLabel, the library itself should show a popover with additional events or leave the implementation to the end user however they want to use it.

If the library itself should show a popover itself I might have to use some popover library.

Please suggest how you want me to proceed.

Thanks

TechSaq avatar Mar 12 '22 07:03 TechSaq

@acro5piano, I also want to test the changes in my real device. Can you please help how can I test on a real device?

Thanks

TechSaq avatar Mar 12 '22 08:03 TechSaq

@TechSaq Thank you very much!

I need suggestions from you, onPress of moreLabel, the library itself should show a popover with additional events or leave the implementation to the end user however they want to use it.

Can you proceed with the library itself should show a popover with additional events for now?

If the library itself should show a popover itself I might have to use some popover library.

I prefer not to add dependency, especially for UI library. However, if it provides better quality and save implementation cost, go for it. Thanks!

acro5piano avatar Mar 14 '22 03:03 acro5piano

I also want to test the changes in my real device. Can you please help how can I test on a real device?

I'll create a document for it.

acro5piano avatar Mar 14 '22 03:03 acro5piano

@TechSaq Thank you very much!

I need suggestions from you, onPress of moreLabel, the library itself should show a popover with additional events or leave the implementation to the end user however they want to use it.

Can you proceed with the library itself should show a popover with additional events for now?

If the library itself should show a popover itself I might have to use some popover library.

I prefer not to add dependency, especially for UI library. However, if it provides better quality and save implementation cost, go for it. Thanks!

I implemented a solution without adding any dependency but in storybook looks it is not rendering properly due to deviceWidth so I wanted to test the changes on a real device.

TechSaq avatar Mar 14 '22 04:03 TechSaq

I also want to test the changes in my real device. Can you please help how can I test on a real device?

I'll create a document for it.

I found a solution for this by using the install-local library. This adds local package as localDependencies in package.json and add the package to node_modules but while importing I am getting error.

While writing a document for this please consider the Window system.

TechSaq avatar Mar 14 '22 04:03 TechSaq

getConvertedDate

is it a predefined method to get the date list?

chinmay4github1987 avatar Aug 23 '22 10:08 chinmay4github1987

Hi @Subhash-Dhandhukiya

I am using onPressCell to open Modal to add some events.

It will be better to have an onPress event for more text to display additional events in modal with some default implementation within the package and support to override the modal.

Hi, I need some help in this

ashishsinghnative avatar Apr 13 '23 08:04 ashishsinghnative

Hi there,

I've been busy now for my own business. If you create a pull request for this, I'm happy to merge it. Thanks

acro5piano avatar Apr 13 '23 10:04 acro5piano

Please send your full source code. I am unable to open modal on onPress

It's open source, so you can find them on your own.

acro5piano avatar Apr 13 '23 10:04 acro5piano

any updates on this?

dionart avatar Jun 29 '23 21:06 dionart