react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Can't change the flatlist backgroundColor of Agenda with calendarBackground in theme

Open Jinho1011 opened this issue 2 years ago • 4 comments

Description

  • renderCalendarList in agenda does not pass theme to CalendarList, because extractCalendarListProps does not extract theme from props. Due to this problem, even though calendarBackground is set, the backgroundColor of CalendarList inside Agenda cannot be changed.

Expected Behavior

  • extractCalendarListProps should extract theme from props.

Jinho1011 avatar Aug 24 '22 10:08 Jinho1011

I'm seeing this same behavior after upgrading to RN 0.68.2 (was previously on 0.61.5).

kyleder avatar Aug 24 '22 22:08 kyleder

downgrade to 1.1286.0 fixed this

Jinho1011 avatar Aug 25 '22 02:08 Jinho1011

I'm using RN 0.64.3, and downgrading to version 1.1286.0 of react-native-calendars didn't fix the issue for me. The latest version of RNC also broke other theme attributes. With this setup, just the background colour isn't working.

Screen Shot 2022-08-25 at 7 32 42 pm

JSimai avatar Aug 25 '22 09:08 JSimai

Same issue here after updating to RN 0.68. Also the CalendarList theme isn't honored.

tsalama avatar Aug 25 '22 22:08 tsalama

Looking at https://github.com/wix/react-native-calendars/blob/master/src/agenda/style.ts#L56 adding the below worked for me (the

<Agenda
    theme={{
      'stylesheet.agenda.main': {
        reservations: {
          backgroundColor: 'red',
        },
      }}
     ...
 />

dpdenton avatar Oct 21 '22 17:10 dpdenton

<Agenda
        showClosingKnob
        renderItem={RenderItem}
        items={{
          '2022-11-28': [
            {
              name: 'Renan',
              day: new Date().toISOString().split('T')[0],
              height: 50,
            },
          ],
        }}
        theme={{
          reservationsBackgroundColor: '#fff',
        }}
      />

reservationsBackgroundColor is not typed, use this.

need to fix, Theme interface doesn't export this key

wallacerenan avatar Nov 28 '22 11:11 wallacerenan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 11 '23 12:03 stale[bot]

I have posted a PR for this , PR here

pridemusvaire avatar Feb 16 '24 00:02 pridemusvaire