Commit 9e803539 authored by santhosh's avatar santhosh
Browse files

added

Showing with 29 additions and 3 deletions
+29 -3
......@@ -31,6 +31,7 @@ import NetInfo from '@react-native-community/netinfo';
import { API, CHATAPI } from "../WebServices/RestClient";
import log from '../LogFile/Log';
import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
import Modal from "react-native-simple-modal";
const options = {
title: 'Select Image',
......@@ -65,6 +66,7 @@ export default class AdminChatUser extends Component {
commentDetails: {},
SendImg: false,
cls: '1',
open: false
};
// alert("Msgcount"+this.props.navigation.state.params.sno)
......@@ -78,6 +80,15 @@ export default class AdminChatUser extends Component {
}
openModal = (item) => {
// alert(JSON.stringify(item))
this.setState({
open: true,
image: item
})
}
//getting task related messages
getMessages() {
log("Info", " getMessages(role, userToken, cropcode) is used getting task related messages");
......@@ -507,7 +518,8 @@ export default class AdminChatUser extends Component {
<View style={[styles.itemReply, itemStyleReply]}>
<View style={{ padding: 5, }}>
{itemStyle === styles.itemOut ? <View style={{ flexDirection: 'row' }}><Text style={{ fontSize: 12, color: 'orange' }}>{item.reply_username}</Text></View> : <View style={{ flexDirection: 'row' }}><Text style={{ fontSize: 12, color: 'blue' }}>{item.username}</Text></View>}
{item.reply_path !== null ? <Image source={{ uri: item.reply_path }} style={{ width: 210, height: 50 }} /> : null}
{item.reply_path !== null ? <TouchableOpacity onPress={this.openModal(item)}><Image source={{ uri: item.reply_path }} style={{ width: 210, height: 50 }} /></TouchableOpacity> : null}
<Text style={{ width: 210 }} selectable={true} key={Math.random()}>{item.reply_message}</Text>
{!inMessage && this.renderDate(moment(item.messagedTime).format('MM.DD.YYYY hh:mm:ss'))}
......@@ -517,7 +529,7 @@ export default class AdminChatUser extends Component {
<View style={[styles.itemown, itemStyle]}>
<View style={{ padding: 5, }}>
{itemStyle === styles.itemOut ? <View style={{ flexDirection: 'row' }}><Text style={{ fontSize: 12, color: 'orange' }}>{item.username}</Text><TouchableOpacity onPress={() => this.handlecom(item)} ><Icon color={'#C0C0C0'} size={25} style={{ marginLeft: 10 }} name="reply" /></TouchableOpacity></View> : <View style={{ flexDirection: 'row' }}><Text style={{ fontSize: 12, color: 'blue' }}>{item.username}</Text><TouchableOpacity onPress={() => this.handlecom(item)} ><Icon color={'#C0C0C0'} size={25} style={{ marginLeft: 10 }} name="reply" /></TouchableOpacity></View>}
{item.path !== null ? <Image source={{ uri: item.path }} style={styles.imageview} /> : null}
{item.path !== null ? <TouchableOpacity onPress={this.openModal(item)}><Image source={{ uri: item.path }} style={styles.imageview} /></TouchableOpacity> : null}
<Text style={{ width: 210 }} selectable={true} key={Math.random()}>{item.message}</Text>
{!inMessage && this.renderDate(moment(item.messagedTime).format('MM.DD.YYYY hh:mm:ss'))}
{inMessage && this.renderDate(moment(item.messagedTime).format('MM.DD.YYYY hh:mm:ss'))}
......@@ -528,7 +540,7 @@ export default class AdminChatUser extends Component {
<View style={[styles.itemSingle, itemStyleSingle]}>
<View style={{ padding: 5, }}>
{itemStyle === styles.itemOut ? <View style={{ flexDirection: 'row' }}><Text style={{ fontSize: 12, color: 'orange' }}>{item.username}</Text><TouchableOpacity onPress={() => this.handlecom(item)} ><Icon color={'#C0C0C0'} size={25} style={{ marginLeft: 10 }} name="reply" /></TouchableOpacity></View> : <View style={{ flexDirection: 'row' }}><Text style={{ fontSize: 12, color: 'blue' }}>{item.username}</Text><TouchableOpacity onPress={() => this.handlecom(item)} ><Icon color={'#C0C0C0'} size={25} style={{ marginLeft: 10 }} name="reply" /></TouchableOpacity></View>}
{item.path !== null ? <Image source={{ uri: item.path }} style={styles.imageview} /> : null}
{item.path !== null ? <TouchableOpacity onPress={this.openModal(item)}><Image source={{ uri: item.path }} style={styles.imageview} /></TouchableOpacity> : null}
<Text style={{ width: 210 }} selectable={true} key={Math.random()}>{item.message}</Text>
{!inMessage && this.renderDate(moment(item.messagedTime).format('MM.DD.YYYY hh:mm:ss'))}
{inMessage && this.renderDate(moment(item.messagedTime).format('MM.DD.YYYY hh:mm:ss'))}
......@@ -624,6 +636,20 @@ export default class AdminChatUser extends Component {
</View>
</View>
<Modal
// offset={this.state.offset}
open={this.state.open}
closeOnTouchOutside={false}
modalDidOpen={this.modalDidOpen}
modalDidClose={this.modalDidClose}
style={{ alignItems: "center" }}
// disableOnBackPress={false}
>
<View style={{ alignItems: "center", }}>
<Image source={{ uri:this.state.path }} style={styles.imageview} />
</View>
</Modal>
{/* </KeyboardAvoidingView> */}
</Container>
......
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