Skip to content

Commit

Permalink
display temp button to unblock removeTransaction functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Julesssss committed Apr 26, 2021
1 parent d5bec43 commit b063b9c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
42 changes: 35 additions & 7 deletions src/components/TransactionItem.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import { View, Text, Pressable } from 'react-native-web';
import ReportActionPropTypes from '../pages/home/report/ReportActionPropTypes';
import ReportActionItemIOUPreview from '../components/ReportActionItemIOUPreview';
import styles from '../styles/styles';

const propTypes = {
action: PropTypes.shape(ReportActionPropTypes).isRequired,
Expand All @@ -17,6 +19,9 @@ const propTypes = {

// The transaction amount
amount: PropTypes.number,

// Was this transaction created by the current user
createdByUser: PropTypes.bool,
}).isRequired,
};

Expand All @@ -26,13 +31,36 @@ const defaultProps = {
},
};

const TransactionItem = props => (
<ReportActionItemIOUPreview
action={props.action}
isMostRecentIOUReport={false}// shouldDIsplayPreviewBox
/>
class TransactionItem extends Component {
constructor(props) {
super(props);

this.removeTransaction = this.removeTransaction.bind(this);
}

);
removeTransaction() {
console.debug('removeTransaction');
}

render() {
return (
<View styles={[styles.mb5]}>
<ReportActionItemIOUPreview
action={this.props.action}
isMostRecentIOUReport={false}// shouldDIsplayPreviewBox
/>
<Pressable
style={[styles.button, styles.alignItemsStart, styles.mb3]}
onPress={() => this.removeTransaction()}
>
<Text style={[styles.buttonSmallText]}>
{this.props.transaction.createdByUser ? 'Cancel' : 'Decline'}
</Text>
</Pressable>
</View>
);
}
};

TransactionItem.displayName = 'TransactionItem';
TransactionItem.propTypes = propTypes;
Expand Down
4 changes: 4 additions & 0 deletions src/styles/utilities/flex.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export default {
alignItems: 'flex-end',
},

alignItemsStart: {
alignItems: 'start',
},

flexWrap: {
flexWrap: 'wrap',
},
Expand Down

0 comments on commit b063b9c

Please sign in to comment.