Skip to content

Commit

Permalink
Use mapper util for SubscriptionDetail screen also
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeNg93 committed Feb 24, 2019
1 parent 84015b7 commit 68e2396
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ import { connect } from 'react-redux';
import Colors from '../../../../constants/Colors';
import commonStyles from '../../../../constants/commonStyles';
import Layout from '../../../../constants/Layout';

const boxNameToImageMapper = {
'vegan box': require('../../../../assets/images/vegan.png'),
'mixed box': require('../../../../assets/images/mixed.png'),
'meat box': require('../../../../assets/images/meat.png'),
};
import { boxNameToImageMapper } from '../../../../utils/mapper';

const width = Layout.window.width,
CONTENT_SEPARATOR = ',';
Expand Down Expand Up @@ -69,9 +64,7 @@ class SubscriptionDetailScreen extends React.Component {
<View style={styles.topContainer}>
<Image
style={styles.image}
source={
boxNameToImageMapper[selectedSubscription.title.toLowerCase()]
}
source={boxNameToImageMapper[selectedSubscription.title]}
/>
<View style={styles.priceTag}>
<Text style={styles.priceText}>
Expand Down

0 comments on commit 68e2396

Please sign in to comment.