|
|
@ -1,6 +1,7 @@ |
|
|
|
import React, { useState } from "react"; |
|
|
|
import { Text, TouchableOpacity, View, StyleSheet, Image } from "react-native"; |
|
|
|
import { MaterialCommunityIcons } from "@expo/vector-icons"; |
|
|
|
import { FontAwesome5 } from '@expo/vector-icons'; |
|
|
|
import SelfClosingModal from "../components/SelfClosingModal"; |
|
|
|
import colors from "../config/colors"; |
|
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
@ -95,7 +96,7 @@ function iconTextRow(props) { |
|
|
|
<View alignSelf="flex-start" marginRight={10}> |
|
|
|
<MaterialCommunityIcons |
|
|
|
name={props.name} |
|
|
|
size={18} |
|
|
|
size={25} |
|
|
|
color={colors.primary} |
|
|
|
/> |
|
|
|
</View> |
|
|
@ -105,6 +106,18 @@ function iconTextRow(props) { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
function iconInstitutionTextRow(props) { |
|
|
|
return ( |
|
|
|
<View flexDirection="row" alignSelf="flex-start" marginVertical={3}> |
|
|
|
<View alignSelf="flex-start" marginRight={10}> |
|
|
|
<FontAwesome5 name={props.name} size={25} color={colors.primary} /> |
|
|
|
</View> |
|
|
|
|
|
|
|
<Text style={styles.text}>{props.description}</Text> |
|
|
|
</View> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
function iconImageRow(props) { |
|
|
|
return ( |
|
|
|
<View flexDirection="row" alignSelf="flex-start" marginVertical={3}> |
|
|
@ -213,17 +226,19 @@ function componentBody(props) { |
|
|
|
const date = props.date ? props.date : "implementando..."; |
|
|
|
const address = props.address ? props.address : "Erro ao carregar endereço"; |
|
|
|
const user = props.user ? props.user : "Usuário ativo"; |
|
|
|
const institution = props.institution ? props.institution : "Erro ao carregar instituição" |
|
|
|
|
|
|
|
return ( |
|
|
|
<View style={styles.bodyRow}> |
|
|
|
<Image style={styles.bodyIcon} resizeMode="stretch" source={props.logo} /> |
|
|
|
|
|
|
|
<View style={styles.bodyInfo}> |
|
|
|
{!isOfficialPluviometer(props.name) && iconTextRow({ name: "account", description: user })} |
|
|
|
{iconInstitutionTextRow({name: "university", description: institution})} |
|
|
|
{iconTextRow({ name: "map-marker", description: address })} |
|
|
|
{!isPluviometer(props.name) && |
|
|
|
iconTextRow({ name: "calendar", description: date })} |
|
|
|
{iconTextRow({ name: "account", description: user })} |
|
|
|
{props.name != "automaticPluviometer" && |
|
|
|
{!isOfficialPluviometer(props.name) && |
|
|
|
iconImageRow({ name: "camera", pic: pictures })} |
|
|
|
</View> |
|
|
|
</View> |
|
|
@ -249,6 +264,10 @@ function isPluviometer(name) { |
|
|
|
return name === "pluviometer" || name === "automaticPluviometer"; |
|
|
|
} |
|
|
|
|
|
|
|
function isOfficialPluviometer(name) { |
|
|
|
return name === "automaticPluviometer"; |
|
|
|
} |
|
|
|
|
|
|
|
function MapModal({ showModal, setShowModal, markers }) { |
|
|
|
const [currentMarker, setCurrentMarker] = useState(undefined); |
|
|
|
var timeFilter = null; |
|
|
|