|
@ -1,6 +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 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"; |
|
@ -95,7 +96,7 @@ function iconTextRow(props) { |
|
|
<View alignSelf="flex-start" marginRight={10}> |
|
|
<View alignSelf="flex-start" marginRight={10}> |
|
|
<MaterialCommunityIcons |
|
|
<MaterialCommunityIcons |
|
|
name={props.name} |
|
|
name={props.name} |
|
|
size={18} |
|
|
|
|
|
|
|
|
size={25} |
|
|
color={colors.primary} |
|
|
color={colors.primary} |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
</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) { |
|
|
function iconImageRow(props) { |
|
|
return ( |
|
|
return ( |
|
|
<View flexDirection="row" alignSelf="flex-start" marginVertical={3}> |
|
|
<View flexDirection="row" alignSelf="flex-start" marginVertical={3}> |
|
@ -213,17 +226,19 @@ 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" |
|
|
|
|
|
|
|
|
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})} |
|
|
{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 })} |
|
|
{iconTextRow({ name: "account", description: user })} |
|
|
|
|
|
{props.name != "automaticPluviometer" && |
|
|
|
|
|
|
|
|
{!isOfficialPluviometer(props.name) && |
|
|
iconImageRow({ name: "camera", pic: pictures })} |
|
|
iconImageRow({ name: "camera", pic: pictures })} |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
@ -249,6 +264,10 @@ function isPluviometer(name) { |
|
|
return name === "pluviometer" || name === "automaticPluviometer"; |
|
|
return name === "pluviometer" || name === "automaticPluviometer"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isOfficialPluviometer(name) { |
|
|
|
|
|
return name === "automaticPluviometer"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function MapModal({ showModal, setShowModal, markers }) { |
|
|
function MapModal({ showModal, setShowModal, markers }) { |
|
|
const [currentMarker, setCurrentMarker] = useState(undefined); |
|
|
const [currentMarker, setCurrentMarker] = useState(undefined); |
|
|
var timeFilter = null; |
|
|
var timeFilter = null; |
|
|