forked from demayj10/d3smartshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoupons
84 lines (78 loc) · 2.61 KB
/
Coupons
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import React, { Component } from 'react';
import { Container, Header, Button, Image, Content, Right, Left, Text, Body, Card, CardItem, List} from 'native-base';
import styles from './styles';
import couponsKrogers from './couponsKroger.json';
import couponsWals from './couponsWal.json';
import couponsMeijers from './couponsMeijer.json';
const screenHeight = Dimensions.get('window').height;
const screenWidth = Dimensions.get('window').width;
displayImages(couponsToDisplay) {
if (couponsToDisplay === 0) {
return(
couponsKrogers.map((arrItem) =>
<View>
<Text>Kroger</Text>
<Image source={require(couponsKroger.image)} />
<Button>Add to Coupon Book</Button>
</View>
)
)
} else if (couponsToDisplay === 1) {
return(
couponsWals.map((arrItem) =>
<View>
<Text>WalMart</Text>
<Image source={require(couponsWal.image)} />
<Button>Add to Coupon Book</Button>
</View>
)
)
} else {
return(
couponsMeijers.map((arrItem) =>
<View>
<Text>Meijer</Text>
<Image source={require(couponsMeijer.image)} />
<Button>Add to Coupon Book</Button>
</View>
)
)
}
};
export default class CouponCardImg extends Component {
render() {
return (
<Container style={styles.containerStyle}>
<Header hasTabs style={styles.headerStyle}>
<Left>
<Button
transparent
onPress={() => this.props.navigation.goBack()}
>
<Icon style={styles.iconStyle}name='arrow-back' />
</Button>
</Left>
<Body style={{ position: 'absolute' }}>
<Text style={styles.headerText}>
{this.props.navigation.state.params.item}
Coupons</Text>
</Body>
<Right>
<Button transparent>
<Icon style={styles.iconStyle}name='more' />
</Button>
</Right>
</Header>
<Content padder contentContainerStyle=
{{ justifyContent: 'space-evenly'}}
>
<ScrollView>
{displayImages(0)}
{displayImages(1)}
{displayImages(2)}
</ScrollView>
</Content>
</Container>
);
}
}