Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-calendars",
"version": "1.22.1",
"name": "react-native-calendars-ts",
"version": "1.23.1",
"main": "src/index.js",
"description": "React Native Calendar Components",
"scripts": {
Expand All @@ -14,7 +14,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/wix/react-native-calendars"
"url": "git+https://github.com/trunk-studio/react-native-calendars-ts"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down
22 changes: 10 additions & 12 deletions src/calendar/header/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {Component} from 'react';
import {ActivityIndicator} from 'react-native';
import { TouchableOpacity as TouchableOpacityAndroid } from 'react-native-gesture-handler'
import {View, Text, Image, TouchableOpacity, Platform} from 'react-native';
import {TouchableOpacity as TouchableOpacityAndroid} from 'react-native-gesture-handler';
import {View, Text, Image, TouchableOpacity, Platform} from 'react-native';
import XDate from 'xdate';
import PropTypes from 'prop-types';
import styleConstructor from './style';
Expand Down Expand Up @@ -42,12 +42,16 @@ const withPreventDoublePress = (WrappedComponent) => {

render() {
const disabled = this.state.onPressDisabled || this.props.disabled;

return (
<WrappedComponent
{...this.props}
disabled={disabled}
style={[this.props.style, disabled && {opacity: 0.2}]}
onPress={this.onPress}
style={{
...this.props.style,
opacity: disabled ? 0.2 : 1,
}}
/>
);
}
Expand All @@ -59,7 +63,7 @@ const withPreventDoublePress = (WrappedComponent) => {
return PreventDoublePress;
};

const Button = withPreventDoublePress(Platform.OS==='ios' ? TouchableOpacity :TouchableOpacityAndroid);
const Button = withPreventDoublePress(TouchableOpacity);

class CalendarHeader extends Component {
static displayName = 'IGNORE';
Expand Down Expand Up @@ -158,10 +162,7 @@ class CalendarHeader extends Component {
leftArrow = (
<Button
onPress={this.onPressLeft}
style={[
this.style.arrow,
this.props.disableLeftArrow && {opacity: 0.2},
]}
style={this.style.arrow}
hitSlop={{left: 20, right: 20, top: 20, bottom: 20}}
testID={
testID
Expand All @@ -182,10 +183,7 @@ class CalendarHeader extends Component {
rightArrow = (
<Button
onPress={this.onPressRight}
style={[
this.style.arrow,
this.props.disableRightArrow && {opacity: 0.2},
]}
style={this.style.arrow}
hitSlop={{left: 20, right: 20, top: 20, bottom: 20}}
testID={
testID
Expand Down
2 changes: 1 addition & 1 deletion src/expandableCalendar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ class ExpandableCalendar extends Component {
disableRightArrow={disableRightArrow}
staticHeader
/>
{horizontal && this.renderWeekCalendar()}
{horizontal && !isOpen && this.renderWeekCalendar()}
{!hideKnob && this.renderKnob()}
{!horizontal && this.renderHeader()}
</Animated.View>
Expand Down