|
@ -1,7 +1,7 @@ |
|
|
import React, { useState } from "react"; |
|
|
import React, { useState } from "react"; |
|
|
import { Text, TouchableOpacity, View, StyleSheet, Image } from "react-native"; |
|
|
import { Text, TouchableOpacity, View, StyleSheet, Image } from "react-native"; |
|
|
import { MaterialCommunityIcons } from "@expo/vector-icons"; |
|
|
import { MaterialCommunityIcons } from "@expo/vector-icons"; |
|
|
import { FontAwesome5 } from '@expo/vector-icons'; |
|
|
|
|
|
|
|
|
import { FontAwesome5 } from "@expo/vector-icons"; |
|
|
import SelfClosingModal from "../components/SelfClosingModal"; |
|
|
import SelfClosingModal from "../components/SelfClosingModal"; |
|
|
import colors from "../config/colors"; |
|
|
import colors from "../config/colors"; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
@ -226,15 +226,21 @@ function componentBody(props) { |
|
|
const date = props.date ? props.date : "implementando..."; |
|
|
const date = props.date ? props.date : "implementando..."; |
|
|
const address = props.address ? props.address : "Erro ao carregar endereço"; |
|
|
const address = props.address ? props.address : "Erro ao carregar endereço"; |
|
|
const user = props.user ? props.user : "Usuário ativo"; |
|
|
const user = props.user ? props.user : "Usuário ativo"; |
|
|
const institution = props.institution ? props.institution : "Erro ao carregar instituição" |
|
|
|
|
|
|
|
|
const institution = props.institution |
|
|
|
|
|
? props.institution |
|
|
|
|
|
: "Erro ao carregar instituição"; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<View style={styles.bodyRow}> |
|
|
<View style={styles.bodyRow}> |
|
|
<Image style={styles.bodyIcon} resizeMode="stretch" source={props.logo} /> |
|
|
<Image style={styles.bodyIcon} resizeMode="stretch" source={props.logo} /> |
|
|
|
|
|
|
|
|
<View style={styles.bodyInfo}> |
|
|
<View style={styles.bodyInfo}> |
|
|
{!isOfficialPluviometer(props.name) && iconTextRow({ name: "account", description: user })} |
|
|
|
|
|
{iconInstitutionTextRow({name: "university", description: institution})} |
|
|
|
|
|
|
|
|
{!isOfficialPluviometer(props.name) && |
|
|
|
|
|
iconTextRow({ name: "account", description: user })} |
|
|
|
|
|
{props.institution && iconInstitutionTextRow({ |
|
|
|
|
|
name: "university", |
|
|
|
|
|
description: institution, |
|
|
|
|
|
})} |
|
|
{iconTextRow({ name: "map-marker", description: address })} |
|
|
{iconTextRow({ name: "map-marker", description: address })} |
|
|
{!isPluviometer(props.name) && |
|
|
{!isPluviometer(props.name) && |
|
|
iconTextRow({ name: "calendar", description: date })} |
|
|
iconTextRow({ name: "calendar", description: date })} |
|
@ -284,7 +290,7 @@ function MapModal({ showModal, setShowModal, markers }) { |
|
|
if (result.data && showModal && currentMarker == undefined) { |
|
|
if (result.data && showModal && currentMarker == undefined) { |
|
|
setCurrentMarker( |
|
|
setCurrentMarker( |
|
|
AssembleModalObject( |
|
|
AssembleModalObject( |
|
|
JSON.stringify(result.data.responseData.array_to_json), |
|
|
|
|
|
|
|
|
JSON.stringify(result.data.responseData), |
|
|
name |
|
|
name |
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
@ -308,16 +314,12 @@ function MapModal({ showModal, setShowModal, markers }) { |
|
|
{topBar(currentMarker, setShowModal, setCurrentMarker)} |
|
|
{topBar(currentMarker, setShowModal, setCurrentMarker)} |
|
|
|
|
|
|
|
|
{currentMarker != undefined && ( |
|
|
{currentMarker != undefined && ( |
|
|
<View> |
|
|
|
|
|
<View style={{ padding: 16 }}> |
|
|
<View style={{ padding: 16 }}> |
|
|
{componentBody(currentMarker)} |
|
|
{componentBody(currentMarker)} |
|
|
{isPluviometer(currentMarker.name) |
|
|
|
|
|
? moreInfo(currentMarker) |
|
|
|
|
|
: null} |
|
|
|
|
|
|
|
|
{isPluviometer(currentMarker.name) ? moreInfo(currentMarker) : null} |
|
|
{/* {!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} */} |
|
|
{/* {!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} */} |
|
|
{userMessage(currentMarker)} |
|
|
{userMessage(currentMarker)} |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
)} |
|
|
)} |
|
|
{currentMarker == undefined && ( |
|
|
{currentMarker == undefined && ( |
|
|
<View style={styles.bodyInfo}> |
|
|
<View style={styles.bodyInfo}> |
|
|