Commit 3c9b1e99 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

reward detail for html

parent 9d01a62b
import React from 'react';
import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity, Image,Button } from 'react-native';
import { Card } from 'react-native-shadow-cards'
import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity, Image, Button } from 'react-native';
import { CheckBox, Separator, Grid, Row, Card, Icon, CardItem, Body } from 'native-base';
import { Collapse, CollapseHeader, CollapseBody, AccordionList } from 'accordion-collapse-react-native'
import { connect } from 'react-redux';
import Axios from 'axios';
import session from '../function/session';
import HTML from 'react-native-render-html';
import { WebView } from 'react-native-webview';
class RewardDetail extends React.Component {
constructor(props) {
......@@ -14,8 +15,8 @@ class RewardDetail extends React.Component {
image: '',
title: '',
subtitle: '',
deskripsi: '',
expire : ''
deskripsi: "",
expire: ''
}
}
......@@ -27,7 +28,7 @@ class RewardDetail extends React.Component {
let params = {
session_id: this.props.session_id,
reward_id: "72770d93-ee13-451e-818b-60d55e9ea79e"
reward_id: this.props.route.params.rewardId
}
console.log(params);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_detail', params).then(res => {
......@@ -46,11 +47,10 @@ class RewardDetail extends React.Component {
console.log("INI IMAGE : " + JSON.stringify())
// console.log("INI DESKRIPSI : " + JSON.stringify(res.data.reward.reward.subtitle))
})
}
render() {
const deskripsi = this.state.deskripsi
return (
<View style={styles.container}>
<ScrollView style={styles.body}>
......@@ -58,14 +58,12 @@ class RewardDetail extends React.Component {
{/* <View style={styles.images}> */}
<Image style={{ height: 250, width: '100%' }} source={this.state.image ? { uri: this.state.image } : null} />
{/* </View> */}
<View style={styles.content}>
<Text style={{margin:10 , textAlign:'center', fontWeight:'bold'}}>{this.state.title}</Text>
<Text style={{marginRight:10,marginLeft:10}}>{this.state.deskripsi}</Text>
<Text style={{top:1 , textAlign:'center'}}>EXPIRE : {this.state.expire}</Text>
<View style={{margin:20}}>
<HTML html={this.state.deskripsi} />
</View>
<View style={{ margin: 10 }}>
<Button title="Validate" />
</View>
<View style={{margin:10}}>
<Button title="Validate" />
</View>
</View>
</ScrollView>
</View>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment