Application Android et IOS pour l'amicale des élèves https://play.google.com/store/apps/details?id=fr.amicaleinsat.application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CustomAgenda.js 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import * as React from 'react';
  2. import {View} from "react-native";
  3. import {withTheme} from 'react-native-paper';
  4. import {Agenda} from "react-native-calendars";
  5. type Props = {
  6. theme: Object,
  7. }
  8. /**
  9. * Abstraction layer for Agenda component, using custom configuration
  10. */
  11. class CustomAgenda extends React.Component<Props> {
  12. getAgenda() {
  13. return <Agenda
  14. {...this.props}
  15. ref={this.props.onRef}
  16. theme={{
  17. backgroundColor: this.props.theme.colors.agendaBackgroundColor,
  18. calendarBackground: this.props.theme.colors.background,
  19. textSectionTitleColor: this.props.theme.colors.agendaDayTextColor,
  20. selectedDayBackgroundColor: this.props.theme.colors.primary,
  21. selectedDayTextColor: '#ffffff',
  22. todayTextColor: this.props.theme.colors.primary,
  23. dayTextColor: this.props.theme.colors.text,
  24. textDisabledColor: this.props.theme.colors.agendaDayTextColor,
  25. dotColor: this.props.theme.colors.primary,
  26. selectedDotColor: '#ffffff',
  27. arrowColor: 'orange',
  28. monthTextColor: this.props.theme.colors.primary,
  29. indicatorColor: this.props.theme.colors.primary,
  30. textDayFontWeight: '300',
  31. textMonthFontWeight: 'bold',
  32. textDayHeaderFontWeight: '300',
  33. textDayFontSize: 16,
  34. textMonthFontSize: 16,
  35. textDayHeaderFontSize: 16,
  36. agendaDayTextColor: this.props.theme.colors.agendaDayTextColor,
  37. agendaDayNumColor: this.props.theme.colors.agendaDayTextColor,
  38. agendaTodayColor: this.props.theme.colors.primary,
  39. agendaKnobColor: this.props.theme.colors.primary,
  40. }}
  41. />;
  42. }
  43. render() {
  44. // Completely recreate the component on theme change to force theme reload
  45. if (this.props.theme.dark)
  46. return (
  47. <View style={{flex: 1}}>
  48. {this.getAgenda()}
  49. </View>
  50. );
  51. else
  52. return this.getAgenda();
  53. }
  54. }
  55. export default withTheme(CustomAgenda);