Skip to content
Merged
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
12 changes: 7 additions & 5 deletions src/components/drawer/drawer.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
{"name": "fullSwipeLeft", "type": "boolean", "description": "Whether to allow a full left swipe"},
{"name": "fullLeftThreshold", "type": "number", "description": "Threshold for a left full swipe (0-1)"},
{"name": "onFullSwipeLeft", "type": "() => void", "description": "Callback for left item full swipe"},
{"name": "onWillFullSwipeLeft", "type": "() => void", "description": "Callback for just before left item full swipe"},
{"name": "onToggleSwipeLeft", "type": "() => {rowWidth, leftWidth, dragX, resetItemPosition}", "description": "Callback for left item toggle swipe"},
{
"name": "leftToggleHapticTrigger",
"name": "onWillFullSwipeLeft",
"type": "() => void",
"description": "Haptic trigger callback to use onToggleSwipeLeft",
"deprecated": true
"description": "Callback for just before left item full swipe"
},
{
"name": "onToggleSwipeLeft",
"type": "() => {rowWidth, leftWidth, dragX, resetItemPosition}",
"description": "Callback for left item toggle swipe"
},
{"name": "fullSwipeRight", "type": "boolean", "description": "Whether to allow a full right swipe"},
{"name": "fullRightThreshold", "type": "number", "description": "Threshold for a right full swipe (0-1)"},
Expand Down
8 changes: 1 addition & 7 deletions src/components/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {extractAccessibilityProps} from '../../commons/modifiers';
import {Colors} from '../../style';
import View from '../view';
import Swipeable, {SwipeableProps} from './Swipeable';
import {LogService} from '../../services';

const DEFAULT_BG = Colors.$backgroundPrimaryHeavy;
const DEFAULT_BOUNCINESS = 0;
Expand Down Expand Up @@ -98,10 +97,6 @@ interface DrawerProps {
* Callback for just before right item full swipe
*/
onWillFullSwipeRight?: Function;
/**
* Haptic trigger function to use onToggleSwipeLeft
*/
leftToggleHapticTrigger?: Function;
/**
* Whether to disable the haptic
*/
Expand Down Expand Up @@ -384,8 +379,7 @@ class Drawer extends PureComponent<DrawerProps> {
};

render() {
const {children, style, leftItem, rightItems, onToggleSwipeLeft, leftToggleHapticTrigger, ...others} = this.props;
leftToggleHapticTrigger && LogService.deprecationWarn({component: 'Drawer', oldProp: 'leftToggleHapticTrigger'});
const {children, style, leftItem, rightItems, onToggleSwipeLeft, ...others} = this.props;

return (
<Swipeable
Expand Down