wix / react-native-calendars

React Native Calendar Components 🗓️ 📆
MIT License
9.44k stars 2.93k forks source link

Allow customization of CalendarList loading placeholder #2459

Open jeferson-sb opened 4 months ago

jeferson-sb commented 4 months ago

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:

https://github.com/wix/react-native-calendars/blob/da9b1bd702e1221002d6e30aaf888e350b627b6a/src/calendar-list/item.tsx#L84-L88

And the styles:

https://github.com/wix/react-native-calendars/blob/da9b1bd702e1221002d6e30aaf888e350b627b6a/src/calendar-list/style.ts#L14-L23

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

https://github.com/wix/react-native-calendars/assets/30840709/f1139327-3a0a-4221-8f14-60ddc892b5c7

Code:

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

export const MyCalendar = () => {
  return (
    <CalendarList
      showScrollIndicator
      pastScrollRange={5}
      futureScrollRange={5}
    />
  );
};
sifthedog commented 3 months ago

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

jeferson-sb commented 3 months ago

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;
vagnereix commented 2 months ago

Consegui contornar isso por enquanto mudando o tema com:

You change the text as well or just the styles? @jeferson-sb

jeferson-sb commented 2 months ago

@vagnereix Only styles

lestercorderomurillo commented 2 months ago

yes, i hate this, how this lib cannot have something as basic as a loader component customizable? terrible

sifthedog commented 2 months ago

@lestercorderomurillo you are always welcome to submit a PR for this or fork the library and implement it yourself.

Kindly remember that you are not paying for this library and people developing it are not getting any money from it.

I would recommend you being more respectful towards who helps building open source software. As, without them, you wouldn't even have a place to call another's person work terrible 😄

Community input is always welcome, but being kind is a must