Skip to content

Commit

Permalink
setting up show arrows with ios
Browse files Browse the repository at this point in the history
  • Loading branch information
JediWattson committed Jul 20, 2022
1 parent 656d0da commit b741616
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/components/AttachmentCarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as Expensicons from './Icon/Expensicons';
import styles from '../styles/styles';
import themeColors from '../styles/themes/default';
import reportActionPropTypes from '../pages/home/report/reportActionPropTypes';
import canUseTouchScreen from '../libs/canUseTouchscreen';
import CONFIG from '../CONFIG';
import CONST from '../CONST';
import ONYXKEYS from '../ONYXKEYS';
Expand Down Expand Up @@ -70,10 +71,16 @@ class AttachmentCarousel extends React.Component {
}

componentDidMount() {
if(canUseTouchScreen) {
return
}
document.addEventListener('keydown', this.handleArrowPress);
}

componentWillUnmount() {
if(canUseTouchScreen()) {
return
}
document.removeEventListener('keydown', this.handleArrowPress);
}

Expand Down
7 changes: 4 additions & 3 deletions src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import {Pressable, View} from 'react-native';
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import _ from 'lodash';
Expand Down Expand Up @@ -220,8 +220,9 @@ class AttachmentModal extends PureComponent {
/>
) : ''}
/>
<View
<Pressable
style={attachmentViewStyles}
onPress={() => this.onShowArrow(!this.state.showArrows)}
onMouseEnter={() => this.onShowArrow(true)}
onMouseLeave={() => this.onShowArrow(false)}
>
Expand All @@ -236,7 +237,7 @@ class AttachmentModal extends PureComponent {
/>
)}
</>
</View>
</Pressable>

{/* If we have an onConfirm method show a confirmation button */}
{this.props.onConfirm && (
Expand Down

0 comments on commit b741616

Please sign in to comment.