2020-03-07 11:49:32 +01:00
|
|
|
import * as React from 'react';
|
|
|
|
import {withTheme} from 'react-native-paper';
|
|
|
|
import {Agenda} from "react-native-calendars";
|
|
|
|
|
2020-03-29 14:46:44 +02:00
|
|
|
/**
|
|
|
|
* Abstraction layer for Agenda component, using custom configuration
|
|
|
|
*
|
|
|
|
* @param props Props to pass to the element. Must specify an onRef prop to get an Agenda ref.
|
|
|
|
* @return {*}
|
|
|
|
*/
|
2020-03-07 11:49:32 +01:00
|
|
|
function CustomAgenda(props) {
|
2020-03-29 14:46:44 +02:00
|
|
|
const {colors} = props.theme;
|
2020-03-07 11:49:32 +01:00
|
|
|
return (
|
|
|
|
<Agenda
|
|
|
|
{...props}
|
|
|
|
ref={props.onRef}
|
|
|
|
theme={{
|
|
|
|
backgroundColor: colors.agendaBackgroundColor,
|
|
|
|
calendarBackground: colors.background,
|
|
|
|
textSectionTitleColor: colors.agendaDayTextColor,
|
|
|
|
selectedDayBackgroundColor: colors.primary,
|
|
|
|
selectedDayTextColor: '#ffffff',
|
|
|
|
todayTextColor: colors.primary,
|
|
|
|
dayTextColor: colors.text,
|
|
|
|
textDisabledColor: colors.agendaDayTextColor,
|
|
|
|
dotColor: colors.primary,
|
|
|
|
selectedDotColor: '#ffffff',
|
|
|
|
arrowColor: 'orange',
|
|
|
|
monthTextColor: colors.primary,
|
|
|
|
indicatorColor: colors.primary,
|
|
|
|
textDayFontWeight: '300',
|
|
|
|
textMonthFontWeight: 'bold',
|
|
|
|
textDayHeaderFontWeight: '300',
|
|
|
|
textDayFontSize: 16,
|
|
|
|
textMonthFontSize: 16,
|
|
|
|
textDayHeaderFontSize: 16,
|
|
|
|
agendaDayTextColor: colors.agendaDayTextColor,
|
|
|
|
agendaDayNumColor: colors.agendaDayTextColor,
|
|
|
|
agendaTodayColor: colors.primary,
|
|
|
|
agendaKnobColor: colors.primary,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default withTheme(CustomAgenda);
|