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

reward detail for html

parent 9d01a62b
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity, Image,Button } from 'react-native'; import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity, Image, Button } from 'react-native';
import { Card } from 'react-native-shadow-cards' 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 { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import session from '../function/session'; import session from '../function/session';
import HTML from 'react-native-render-html'; import HTML from 'react-native-render-html';
import { WebView } from 'react-native-webview';
class RewardDetail extends React.Component { class RewardDetail extends React.Component {
constructor(props) { constructor(props) {
...@@ -14,8 +15,8 @@ class RewardDetail extends React.Component { ...@@ -14,8 +15,8 @@ class RewardDetail extends React.Component {
image: '', image: '',
title: '', title: '',
subtitle: '', subtitle: '',
deskripsi: '', deskripsi: "",
expire : '' expire: ''
} }
} }
...@@ -27,7 +28,7 @@ class RewardDetail extends React.Component { ...@@ -27,7 +28,7 @@ class RewardDetail extends React.Component {
let params = { let params = {
session_id: this.props.session_id, session_id: this.props.session_id,
reward_id: "72770d93-ee13-451e-818b-60d55e9ea79e" reward_id: this.props.route.params.rewardId
} }
console.log(params); console.log(params);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_detail', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_detail', params).then(res => {
...@@ -46,11 +47,10 @@ class RewardDetail extends React.Component { ...@@ -46,11 +47,10 @@ class RewardDetail extends React.Component {
console.log("INI IMAGE : " + JSON.stringify()) console.log("INI IMAGE : " + JSON.stringify())
// console.log("INI DESKRIPSI : " + JSON.stringify(res.data.reward.reward.subtitle)) // console.log("INI DESKRIPSI : " + JSON.stringify(res.data.reward.reward.subtitle))
}) })
} }
render() { render() {
const deskripsi = this.state.deskripsi
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
...@@ -58,14 +58,12 @@ class RewardDetail extends React.Component { ...@@ -58,14 +58,12 @@ class RewardDetail extends React.Component {
{/* <View style={styles.images}> */} {/* <View style={styles.images}> */}
<Image style={{ height: 250, width: '100%' }} source={this.state.image ? { uri: this.state.image } : null} /> <Image style={{ height: 250, width: '100%' }} source={this.state.image ? { uri: this.state.image } : null} />
{/* </View> */} {/* </View> */}
<View style={styles.content}> <View style={{margin:20}}>
<Text style={{margin:10 , textAlign:'center', fontWeight:'bold'}}>{this.state.title}</Text> <HTML html={this.state.deskripsi} />
<Text style={{marginRight:10,marginLeft:10}}>{this.state.deskripsi}</Text> </View>
<Text style={{top:1 , textAlign:'center'}}>EXPIRE : {this.state.expire}</Text> <View style={{ margin: 10 }}>
<Button title="Validate" />
</View> </View>
<View style={{margin:10}}>
<Button title="Validate" />
</View>
</View> </View>
</ScrollView> </ScrollView>
</View> </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