Browse Source

Changin river flood "INUNDAR" situation to "TRANSBORDADO"

master
GabrielTrettel 3 years ago
parent
commit
ac5ed7c261
  1. 11
      src/app/components/AssembleModalObject.js
  2. 2
      src/app/hooks/useSocketMarkers.js
  3. 4
      src/app/screens/RiverFloodSharingDataScreen.js

11
src/app/components/AssembleModalObject.js

@ -1,9 +1,7 @@
import moment from "moment"; import moment from "moment";
import React from "react";
import { View, Text } from "react-native";
import getFieldsAnswers from "../api/RequestFieldsAnswers/getFieldsAnswers"; import getFieldsAnswers from "../api/RequestFieldsAnswers/getFieldsAnswers";
import assets from "../config/assets"; import assets from "../config/assets";
//----- 1/3: melhorar código (URGENTE)
//----- 1/3: melhorar código (URGENTE) +1 up-vote
const custom_assets = { const custom_assets = {
pluviometer: assets.PluviometerIcon, pluviometer: assets.PluviometerIcon,
officialPluviometer: assets.OfficialPluviometer, officialPluviometer: assets.OfficialPluviometer,
@ -46,7 +44,7 @@ function getLogo(name, situation) {
return custom_assets.riverLevel[1]; return custom_assets.riverLevel[1];
} else if (situation == "ALTO") { } else if (situation == "ALTO") {
return custom_assets.riverLevel[2]; return custom_assets.riverLevel[2];
} else if (situation == "INUNDAR") {
} else if (situation == "INUNDAR" || situation == "TRANSBORDADO") {
return custom_assets.riverLevel[3]; return custom_assets.riverLevel[3];
} }
return custom_assets.riverLevel[0]; return custom_assets.riverLevel[0];
@ -278,9 +276,12 @@ const AssembleModalObject = async (response, name, userId, formId) => {
} }
} }
// GATO 2: Now INUNDAR is replaced to TRANSBORDADO, so checking from
// response and changing to new value
const _title = situation == "INUNDAR" ? "TRANSBORDADO" : situation;
return { return {
name: name, name: name,
title: situation,
title: _title,
user: null, user: null,
institution: institution, institution: institution,
address: address, address: address,

2
src/app/hooks/useSocketMarkers.js

@ -69,7 +69,7 @@ function getImage(name, situation) {
return custom_assets_pin.riverLevel[1]; return custom_assets_pin.riverLevel[1];
} else if (situation == "ALTO") { } else if (situation == "ALTO") {
return custom_assets_pin.riverLevel[2]; return custom_assets_pin.riverLevel[2];
} else if (situation == "INUNDAR") {
} else if (situation == "INUNDAR" || situation == "TRANSBORDADO") {
return custom_assets_pin.riverLevel[3]; return custom_assets_pin.riverLevel[3];
} }
return custom_assets_pin.riverLevel[0]; return custom_assets_pin.riverLevel[0];

4
src/app/screens/RiverFloodSharingDataScreen.js

@ -169,10 +169,10 @@ function RiverFloodSharingDataScreen(props) {
<SvgLabeledButton <SvgLabeledButton
onPress={() => { onPress={() => {
setRiverScale(3); setRiverScale(3);
setRiverSituation("INUNDAR");
setRiverSituation("TRANSBORDADO");
}} }}
SvgImage={assets.riverLevel.Flooding} SvgImage={assets.riverLevel.Flooding}
label={"INUNDAR"}
label={"TRANSBORDADO"}
isToggle={riverScale == 3} isToggle={riverScale == 3}
/> />
</View> </View>

Loading…
Cancel
Save