Skip to content

Commit

Permalink
Merge pull request #19753 from Skalakid/17027-migrate-CollapsibleSection
Browse files Browse the repository at this point in the history
17027 - migrated CollapsibleSection to PressableWithFeedback
  • Loading branch information
stitesExpensify authored Jun 2, 2023
2 parents 465b788 + 49608e3 commit fc30ddc
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/CollapsibleSection/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import {View, TouchableOpacity} from 'react-native';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import Collapsible from './Collapsible';
import Text from '../Text';
import styles from '../../styles/styles';
import Icon from '../Icon';
import * as Expensicons from '../Icon/Expensicons';
import PressableWithFeedback from '../Pressable/PressableWithFeedback';

const propTypes = {
/** Title of the Collapsible section */
Expand Down Expand Up @@ -38,13 +39,22 @@ class CollapsibleSection extends React.Component {

return (
<View style={styles.mt4}>
<TouchableOpacity
<PressableWithFeedback
onPress={this.toggleSection}
style={[styles.pb4, styles.flexRow]}
accessibilityRole="button"
accessibilityLabel={this.props.title}
hoverDimmingValue={1}
pressDimmingValue={0.2}
>
<Text style={[styles.flex1, styles.textStrong]}>{this.props.title}</Text>
<Text
selectable={false}
style={[styles.flex1, styles.textStrong]}
>
{this.props.title}
</Text>
<Icon src={src} />
</TouchableOpacity>
</PressableWithFeedback>
<View style={styles.collapsibleSectionBorder} />

<Collapsible isOpened={this.state.isExpanded}>
Expand Down

0 comments on commit fc30ddc

Please sign in to comment.