Skip to content

Commit

Permalink
removed unnecessary HOC and unused prop
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemorawski committed Nov 15, 2023
1 parent 96f76c5 commit 6080787
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 91 deletions.
72 changes: 0 additions & 72 deletions src/components/withTabAnimation.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,11 @@ import useTabNavigatorFocus from '@hooks/useTabNavigatorFocus';
const propTypes = {
/* The index of the tab that contains this camera */
cameraTabIndex: PropTypes.number.isRequired,

/** Name of the selected receipt tab */
selectedTab: PropTypes.string.isRequired,

/** The tab animation from hook */
tabAnimation: PropTypes.shape({
addListener: PropTypes.func,
removeListener: PropTypes.func,
}),
};

const defaultProps = {
tabAnimation: undefined,
};

// Wraps a camera that will only be active when the tab is focused or as soon as it starts to become focused.
const NavigationAwareCamera = React.forwardRef(({cameraTabIndex, selectedTab, ...props}, ref) => {
const isCameraActive = useTabNavigatorFocus({tabIndex: cameraTabIndex, selectedTab});
const NavigationAwareCamera = React.forwardRef(({cameraTabIndex, ...props}, ref) => {
const isCameraActive = useTabNavigatorFocus({tabIndex: cameraTabIndex});

return (
<Camera
Expand All @@ -36,7 +23,6 @@ const NavigationAwareCamera = React.forwardRef(({cameraTabIndex, selectedTab, ..
});

NavigationAwareCamera.propTypes = propTypes;
NavigationAwareCamera.defaultProps = defaultProps;
NavigationAwareCamera.displayName = 'NavigationAwareCamera';

export default withTabAnimation(NavigationAwareCamera);
export default NavigationAwareCamera;
3 changes: 1 addition & 2 deletions src/pages/iou/ReceiptSelector/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const defaultProps = {
selectedTab: '',
};

function ReceiptSelector({route, report, iou, transactionID, selectedTab}) {
function ReceiptSelector({route, report, iou, transactionID}) {
const devices = useCameraDevices('wide-angle-camera');
const device = devices.back;

Expand Down Expand Up @@ -214,7 +214,6 @@ function ReceiptSelector({route, report, iou, transactionID, selectedTab}) {
zoom={device.neutralZoom}
photo
cameraTabIndex={pageIndex}
selectedTab={selectedTab}
/>
)}
<View style={[styles.flexRow, styles.justifyContentAround, styles.alignItemsCenter, styles.pv3]}>
Expand Down

0 comments on commit 6080787

Please sign in to comment.