acro5piano / react-native-big-calendar

gcal/outlook like calendar component for React Native
https://react-native-big-calendar.vercel.app
MIT License
439 stars 144 forks source link

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

Open TechSaq opened 2 years ago

TechSaq commented 2 years ago

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

Subhash-Dhandhukiya commented 2 years ago

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);
    }
  };
TechSaq commented 2 years ago

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.

acro5piano commented 2 years ago

Sorry for the delay.

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

TechSaq commented 2 years ago

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

acro5piano commented 2 years ago

Thanks!

TechSaq commented 2 years ago

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 commented 2 years ago

@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

acro5piano commented 2 years ago

@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 commented 2 years ago

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.

TechSaq commented 2 years ago

@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 commented 2 years ago

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.

chinmay4github1987 commented 2 years ago

getConvertedDate

is it a predefined method to get the date list?

ashishsinghnative commented 1 year ago

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

acro5piano commented 1 year ago

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 commented 1 year ago

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.

dionart commented 1 year ago

any updates on this?