|
@@ -4,7 +4,6 @@
|
|
|
*/
|
|
*/
|
|
|
import React, { Component } from 'react';
|
|
import React, { Component } from 'react';
|
|
|
import { View, StyleSheet, Text, TouchableOpacity } from 'react-native';
|
|
import { View, StyleSheet, Text, TouchableOpacity } from 'react-native';
|
|
|
-import ToolbarUgly from '../../components/ToolbarUgly';
|
|
|
|
|
import TextView from '../../components/TextView';
|
|
import TextView from '../../components/TextView';
|
|
|
import app from '../../../app.json';
|
|
import app from '../../../app.json';
|
|
|
import apiVoucher from '../../api/apiVoucher';
|
|
import apiVoucher from '../../api/apiVoucher';
|
|
@@ -71,94 +70,88 @@ export default class VoucherDetails extends Component {
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
return (
|
|
return (
|
|
|
- <View style={ui.flex1}>
|
|
|
|
|
- { !app.isWhitelabel &&
|
|
|
|
|
- <ToolbarUgly
|
|
|
|
|
- title={$t("route.voucherDetails")}/>
|
|
|
|
|
- }
|
|
|
|
|
- <View style={styles.container}>
|
|
|
|
|
- <TextView style={styles.voucherName}>{this.state.voucherInfo.voucherName}</TextView>
|
|
|
|
|
- <EndView half/>
|
|
|
|
|
- <TextView style={styles.labelText}>{$t("voucher.voucherType")}</TextView>
|
|
|
|
|
- <TextView style={styles.valueText}>{this.state.voucherInfo.voucherType}</TextView>
|
|
|
|
|
|
|
+ <View style={styles.container}>
|
|
|
|
|
+ <TextView style={styles.voucherName}>{this.state.voucherInfo.voucherName}</TextView>
|
|
|
|
|
+ <EndView half/>
|
|
|
|
|
+ <TextView style={styles.labelText}>{$t("voucher.voucherType")}</TextView>
|
|
|
|
|
+ <TextView style={styles.valueText}>{this.state.voucherInfo.voucherType}</TextView>
|
|
|
|
|
|
|
|
- <TextView style={styles.labelText}>{$t("voucher.description")}</TextView>
|
|
|
|
|
- <TextView style={styles.valueText}>{this.state.voucherInfo.voucherDesc}</TextView>
|
|
|
|
|
|
|
+ <TextView style={styles.labelText}>{$t("voucher.description")}</TextView>
|
|
|
|
|
+ <TextView style={styles.valueText}>{this.state.voucherInfo.voucherDesc}</TextView>
|
|
|
|
|
|
|
|
- <TextView style={styles.labelText}>{$t("voucher.validityPeriod")}</TextView>
|
|
|
|
|
- <TextView style={styles.valueText}>{this.state.voucherInfo.validityPeriod}</TextView>
|
|
|
|
|
|
|
+ <TextView style={styles.labelText}>{$t("voucher.validityPeriod")}</TextView>
|
|
|
|
|
+ <TextView style={styles.valueText}>{this.state.voucherInfo.validityPeriod}</TextView>
|
|
|
|
|
|
|
|
- <TextView style={styles.labelText}>{$t("voucher.voucherCondition")}</TextView>
|
|
|
|
|
- <View style={styles.olView}>
|
|
|
|
|
- <View style={ui.flexc}>
|
|
|
|
|
- <MaterialIcons
|
|
|
|
|
- style={styles.circleIcon}
|
|
|
|
|
- name="circle"
|
|
|
|
|
- color={textPrimary}
|
|
|
|
|
- size={6}/>
|
|
|
|
|
- <TextView style={styles.valueText}>
|
|
|
|
|
- {$t("voucher.conditionDays")} <Text style={ui.bold}>{this.getDaysText()}</Text>
|
|
|
|
|
- </TextView>
|
|
|
|
|
- </View>
|
|
|
|
|
- <View style={ui.flexc}>
|
|
|
|
|
- <MaterialIcons
|
|
|
|
|
- style={styles.circleIcon}
|
|
|
|
|
- name="circle"
|
|
|
|
|
- color={textPrimary}
|
|
|
|
|
- size={6}/>
|
|
|
|
|
- <TextView style={styles.valueText}>
|
|
|
|
|
- {$t("voucher.conditionTime")} <Text style={ui.bold}>{this.state.voucherInfo.eligibleForUsageDuring}</Text>
|
|
|
|
|
- </TextView>
|
|
|
|
|
- </View>
|
|
|
|
|
- <View style={ui.flexc}>
|
|
|
|
|
- <MaterialIcons
|
|
|
|
|
- style={styles.circleIcon}
|
|
|
|
|
- name="circle"
|
|
|
|
|
- color={textPrimary}
|
|
|
|
|
- size={6}/>
|
|
|
|
|
- <TextView style={styles.valueText}>
|
|
|
|
|
- <Text style={ui.bold}>{this.getTypeText()}</Text> {$t("voucher.conditionTypeOnly")}
|
|
|
|
|
- </TextView>
|
|
|
|
|
- </View>
|
|
|
|
|
- <View style={ui.flexc}>
|
|
|
|
|
- <MaterialIcons
|
|
|
|
|
- style={styles.circleIcon}
|
|
|
|
|
- name="circle"
|
|
|
|
|
- color={textPrimary}
|
|
|
|
|
- size={6}/>
|
|
|
|
|
- <TextView style={styles.valueText}>
|
|
|
|
|
- {$t("voucher.conditionCountry")} <Text style={ui.bold}>{this.state.voucherInfo.country}</Text>
|
|
|
|
|
- </TextView>
|
|
|
|
|
- </View>
|
|
|
|
|
- <View style={ui.flexc}>
|
|
|
|
|
|
|
+ <TextView style={styles.labelText}>{$t("voucher.voucherCondition")}</TextView>
|
|
|
|
|
+ <View style={styles.olView}>
|
|
|
|
|
+ <View style={ui.flexc}>
|
|
|
|
|
+ <MaterialIcons
|
|
|
|
|
+ style={styles.circleIcon}
|
|
|
|
|
+ name="circle"
|
|
|
|
|
+ color={textPrimary}
|
|
|
|
|
+ size={6}/>
|
|
|
|
|
+ <TextView style={styles.valueText}>
|
|
|
|
|
+ {$t("voucher.conditionDays")} <Text style={ui.bold}>{this.getDaysText()}</Text>
|
|
|
|
|
+ </TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View style={ui.flexc}>
|
|
|
|
|
+ <MaterialIcons
|
|
|
|
|
+ style={styles.circleIcon}
|
|
|
|
|
+ name="circle"
|
|
|
|
|
+ color={textPrimary}
|
|
|
|
|
+ size={6}/>
|
|
|
|
|
+ <TextView style={styles.valueText}>
|
|
|
|
|
+ {$t("voucher.conditionTime")} <Text style={ui.bold}>{this.state.voucherInfo.eligibleForUsageDuring}</Text>
|
|
|
|
|
+ </TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View style={ui.flexc}>
|
|
|
|
|
+ <MaterialIcons
|
|
|
|
|
+ style={styles.circleIcon}
|
|
|
|
|
+ name="circle"
|
|
|
|
|
+ color={textPrimary}
|
|
|
|
|
+ size={6}/>
|
|
|
|
|
+ <TextView style={styles.valueText}>
|
|
|
|
|
+ <Text style={ui.bold}>{this.getTypeText()}</Text> {$t("voucher.conditionTypeOnly")}
|
|
|
|
|
+ </TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View style={ui.flexc}>
|
|
|
|
|
+ <MaterialIcons
|
|
|
|
|
+ style={styles.circleIcon}
|
|
|
|
|
+ name="circle"
|
|
|
|
|
+ color={textPrimary}
|
|
|
|
|
+ size={6}/>
|
|
|
|
|
+ <TextView style={styles.valueText}>
|
|
|
|
|
+ {$t("voucher.conditionCountry")} <Text style={ui.bold}>{this.state.voucherInfo.country}</Text>
|
|
|
|
|
+ </TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <View style={ui.flexc}>
|
|
|
|
|
+ <MaterialIcons
|
|
|
|
|
+ style={styles.circleIcon}
|
|
|
|
|
+ name="circle"
|
|
|
|
|
+ color={textPrimary}
|
|
|
|
|
+ size={6}/>
|
|
|
|
|
+ <TextView style={styles.valueText}>
|
|
|
|
|
+ {$t("voucher.conditionMinSpend")} <Text style={ui.bold}>{this.state.voucherInfo.minimumSpend}</Text>
|
|
|
|
|
+ </TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </View>
|
|
|
|
|
+
|
|
|
|
|
+ <TextView style={styles.labelText}>{$t("voucher.siteEligibility")}</TextView>
|
|
|
|
|
+ <View style={styles.olView}>
|
|
|
|
|
+ { this.state.voucherInfo.siteNames?.map((item, index) => (
|
|
|
|
|
+ <TouchableOpacity
|
|
|
|
|
+ style={styles.siteRow}
|
|
|
|
|
+ onPress={() => this.toSiteDetail(item.sitePk)}
|
|
|
|
|
+ key={index}>
|
|
|
<MaterialIcons
|
|
<MaterialIcons
|
|
|
style={styles.circleIcon}
|
|
style={styles.circleIcon}
|
|
|
name="circle"
|
|
name="circle"
|
|
|
color={textPrimary}
|
|
color={textPrimary}
|
|
|
size={6}/>
|
|
size={6}/>
|
|
|
- <TextView style={styles.valueText}>
|
|
|
|
|
- {$t("voucher.conditionMinSpend")} <Text style={ui.bold}>{this.state.voucherInfo.minimumSpend}</Text>
|
|
|
|
|
- </TextView>
|
|
|
|
|
- </View>
|
|
|
|
|
- </View>
|
|
|
|
|
-
|
|
|
|
|
- <TextView style={styles.labelText}>{$t("voucher.siteEligibility")}</TextView>
|
|
|
|
|
- <View style={styles.olView}>
|
|
|
|
|
- { this.state.voucherInfo.siteNames?.map((item, index) => (
|
|
|
|
|
- <TouchableOpacity
|
|
|
|
|
- style={styles.siteRow}
|
|
|
|
|
- onPress={() => this.toSiteDetail(item.sitePk)}
|
|
|
|
|
- key={index}>
|
|
|
|
|
- <MaterialIcons
|
|
|
|
|
- style={styles.circleIcon}
|
|
|
|
|
- name="circle"
|
|
|
|
|
- color={textPrimary}
|
|
|
|
|
- size={6}/>
|
|
|
|
|
- <TextView style={ui.link}>{item?.siteName}</TextView>
|
|
|
|
|
- </TouchableOpacity>
|
|
|
|
|
- ))
|
|
|
|
|
- }
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ <TextView style={ui.link}>{item?.siteName}</TextView>
|
|
|
|
|
+ </TouchableOpacity>
|
|
|
|
|
+ ))
|
|
|
|
|
+ }
|
|
|
</View>
|
|
</View>
|
|
|
</View>
|
|
</View>
|
|
|
);
|
|
);
|