Skip to content

Commit

Permalink
feat: add multi-dot support for Day component
Browse files Browse the repository at this point in the history
  • Loading branch information
maggialejandro committed Jun 15, 2021
1 parent 03fe54b commit dd545d8
Show file tree
Hide file tree
Showing 12 changed files with 1,314 additions and 24 deletions.
18 changes: 17 additions & 1 deletion example/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { View, StatusBar, SafeAreaView } from 'react-native';
import { Month, ThemeType } from 'react-native-month';
import { Month, ThemeType, MarkedDays } from 'react-native-month';

const BLUE = '#6d95da';

Expand Down Expand Up @@ -45,6 +45,21 @@ const DISABLED_DAYS = {
'2020-03-10': truthyValue,
};

const markedDays: MarkedDays = {
'2020-03-12': {
dots: [
{
color: 'red',
selectedColor: 'green',
},
{
color: 'blue',
selectedColor: 'yellow',
},
],
},
};

type Props = {};

type State = {
Expand Down Expand Up @@ -117,6 +132,7 @@ export default class App extends React.PureComponent<Props, State> {
firstDayMonday
minDate={this.state.minDate}
maxDate={this.state.maxDate}
markedDays={markedDays}
disableRange={this.state.disableRange}
startDate={this.state.startDate}
endDate={this.state.endDate}
Expand Down
19 changes: 19 additions & 0 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"jsx": "react-native",
"target": "esnext",
"lib": [
"esnext"
],
"paths": {
"react-native-month": ["../src/index"]
},
"allowJs": true,
"skipLibCheck": true,
"noEmit": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"moduleResolution": "node"
}
}
1 change: 1 addition & 0 deletions src/__tests__/Day.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Day from '../components/Day';

const defaultDay = {
id: '1',
key: '1-1',
date: new Date(),
isToday: false,
isActive: false,
Expand Down
Loading

0 comments on commit dd545d8

Please sign in to comment.