Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of CalendarList loading placeholder #2459

Open
jeferson-sb opened this issue May 1, 2024 · 2 comments
Open

Allow customization of CalendarList loading placeholder #2459

jeferson-sb opened this issue May 1, 2024 · 2 comments

Comments

@jeferson-sb
Copy link

jeferson-sb commented May 1, 2024

Description

Whenever you have CalendarList loading there is a quick flash of a <Text> showing for each of the months (calendars) being rendered. But looking into the props there were no options to either replace the text or change its string.

I found out to be this guy:

if (!visible) {
return (
<Text style={textStyle}>{dateString}</Text>
);
}

And the styles:

placeholder: {
backgroundColor: appStyle.calendarBackground,
alignItems: 'center',
justifyContent: 'center'
},
placeholderText: {
fontSize: 20,
fontWeight: '200',
color: appStyle.dayTextColor
},

Expected Behavior

I expect to be able to at least change the style of the placeholder text.

Observed Behavior

See example below:

Pay attention to the 2024-05-01 text showing in the place of the calendar

Screen.Recording.2024-05-01.at.17.54.00.mov

Code:

import React from 'react';
import {CalendarList} from 'react-native-calendars';

export const MyCalendar = () => {
  return (
    <CalendarList
      showScrollIndicator
      pastScrollRange={5}
      futureScrollRange={5}
    />
  );
};
@sifthedog
Copy link

I would also like this to be implemented. I can submit a PR

@jeferson-sb
Copy link
Author

I was able to circumvent this for now changing the theme with:

const calendarTheme = {
  'stylesheet.calendar-list.main': {
    placeholder: {
       // wrapper styles
    },
    placeholderText: {
      // text styles
    },
  },
};

export default calendarTheme;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants