Browse Source

adding instution field on MatModal and updating icons size

master
analuizaff 3 years ago
parent
commit
596eb043bd
  1. 2
      src/App.js
  2. 4
      src/app/components/AssembleModalObject.js
  3. 25
      src/app/components/MapModal.js
  4. 2
      src/app/hooks/useSocketMarkers.js
  5. 4
      src/app/screens/MapFeedScreen.js

2
src/App.js

@ -33,7 +33,7 @@ export default function App() {
const storageUser = await authStorage.getUser();
if (storageUser) setUser(storageUser);
global.location = { lat: -23.623, long: -46.5637 }; // await getLocation();
global.location = { lat: -9.969802, long: -67.816956 }; // await getLocation();
};
if (!isReady && netInfo.isInternetReachable) {

4
src/app/components/AssembleModalObject.js

@ -64,6 +64,7 @@ function verifyMeasureDates(labels, measureDate) {
const AssembleModalObject = (response, name) => {
var situation = null;
var user = null;
var institution = null;
var address = null;
var date = null;
var time = null;
@ -90,7 +91,7 @@ const AssembleModalObject = (response, name) => {
);
}
if (f.fieldname == "siglarede") {
user = f.fieldsanswersvalue;
institution = f.fieldsanswersvalue;
}
if (f.fieldname == "nome") {
address = f.fieldsanswersvalue;
@ -123,6 +124,7 @@ const AssembleModalObject = (response, name) => {
name: name,
title: situation,
user: user,
institution: institution,
address: address,
date: date + " | " + time,
description: comments,

25
src/app/components/MapModal.js

@ -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;

2
src/app/hooks/useSocketMarkers.js

@ -5,7 +5,7 @@ import PinTransitavel from "../assets/floodZonesAssets/PinTransitavel";
const custom_assets = {
pluviometer: assets.pluviometer,
officialPluviometer: assets.officialPluviometer,
officialPluviometer: assets.pluviometer,
floodZones: assets.floodZones,
riverLevel: ["low", "normal", "high", "flooding"].map((key) => {
return assets.riverLevel[key];

4
src/app/screens/MapFeedScreen.js

@ -13,13 +13,13 @@ export default function MapFeedScreen(props) {
const [dataOptionsToShow, setDataOptionsToShow] = useState({
oficial: {
automaticPluviometer: false,
automaticPluviometer: true,
susceptibilityAreas: false,
},
citzen: {
floodRisk: false,
pluviometer: false,
rain: true,
rain: false,
floodZones: false,
riverFlood: false,
},

Loading…
Cancel
Save