|
@ -98,8 +98,9 @@ function iconTextRow(props) { |
|
|
color={colors.primary} |
|
|
color={colors.primary} |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
<Text style={styles.text}>{props.description}</Text> |
|
|
|
|
|
|
|
|
<View style={{ flexDirection: "row", flexGrow: 1}}> |
|
|
|
|
|
<Text style={{...styles.text, flexShrink: 1}}>{props.description}</Text> |
|
|
|
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
@ -114,8 +115,11 @@ function iconInstitutionTextRow(props) { |
|
|
color={colors.primary} |
|
|
color={colors.primary} |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
<Text style={styles.text}>{props.description}</Text> |
|
|
|
|
|
|
|
|
<View style={{ flexDirection: "row", flexGrow: 1, flex: 1 }}> |
|
|
|
|
|
<Text style={{ ...styles.text, flexShrink: 1 }}> |
|
|
|
|
|
{props.description} |
|
|
|
|
|
</Text> |
|
|
|
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
@ -205,13 +209,29 @@ function moreInfo(props) { |
|
|
<View |
|
|
<View |
|
|
style={{ |
|
|
style={{ |
|
|
height: hasData ? chartHeight * 1.4 : 70, |
|
|
height: hasData ? chartHeight * 1.4 : 70, |
|
|
paddingVertical: 20, |
|
|
|
|
|
|
|
|
paddingVertical: hasData ? 20 : 10, |
|
|
|
|
|
alignContent: "center", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
{!hasData ? ( |
|
|
{!hasData ? ( |
|
|
<Text style={{ ...styles.text, alignSelf: "center" }}> |
|
|
|
|
|
Não há dados para este pluviômetro |
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
|
<View> |
|
|
|
|
|
<Text |
|
|
|
|
|
style={{ |
|
|
|
|
|
...styles.text_pluv, |
|
|
|
|
|
alignSelf: "center", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Não há dados para este pluviômetro |
|
|
|
|
|
</Text> |
|
|
|
|
|
<Text |
|
|
|
|
|
style={{ |
|
|
|
|
|
...styles.text_pluv, |
|
|
|
|
|
alignSelf: "center", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
nos últimos 5 dias |
|
|
|
|
|
</Text> |
|
|
|
|
|
</View> |
|
|
) : ( |
|
|
) : ( |
|
|
<PluviometerGraphics chartHeight={chartHeight} data={props.data} /> |
|
|
<PluviometerGraphics chartHeight={chartHeight} data={props.data} /> |
|
|
)} |
|
|
)} |
|
@ -224,11 +244,13 @@ function componentBody(props) { |
|
|
// NOTE: This code is refered to our local SQLite solution. Revise this when implement rest API.
|
|
|
// NOTE: This code is refered to our local SQLite solution. Revise this when implement rest API.
|
|
|
const pictures = JSON.parse(props.pictures); |
|
|
const pictures = JSON.parse(props.pictures); |
|
|
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 |
|
|
|
|
|
: "Não foi possível carregar o endereço "; |
|
|
const user = props.user ? props.user : "Usuário ativo"; |
|
|
const user = props.user ? props.user : "Usuário ativo"; |
|
|
const institution = props.institution |
|
|
const institution = props.institution |
|
|
? props.institution |
|
|
? props.institution |
|
|
: "Erro ao carregar instituição"; |
|
|
|
|
|
|
|
|
: "Não foi possível obter o nome da instituição"; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<View style={styles.bodyRow}> |
|
|
<View style={styles.bodyRow}> |
|
@ -252,18 +274,20 @@ function componentBody(props) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function userMessage(marker) { |
|
|
function userMessage(marker) { |
|
|
if (marker.description == "") return <></>; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
<View> |
|
|
|
|
|
<Text |
|
|
|
|
|
style={[styles.text, { color: colors.primary, fontWeight: "bold" }]} |
|
|
|
|
|
> |
|
|
|
|
|
Comentário: |
|
|
|
|
|
</Text> |
|
|
|
|
|
<Text style={styles.text}>{marker.description}</Text> |
|
|
|
|
|
</View> |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
if (marker.description && marker.description != "") { |
|
|
|
|
|
return ( |
|
|
|
|
|
<View> |
|
|
|
|
|
<Text |
|
|
|
|
|
style={[styles.text, { color: colors.primary, fontWeight: "bold" }]} |
|
|
|
|
|
> |
|
|
|
|
|
Comentário: |
|
|
|
|
|
</Text> |
|
|
|
|
|
<Text style={styles.text}>{marker.description}</Text> |
|
|
|
|
|
</View> |
|
|
|
|
|
); |
|
|
|
|
|
} else { |
|
|
|
|
|
return <></>; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function isPluviometer(name) { |
|
|
function isPluviometer(name) { |
|
@ -285,7 +309,7 @@ function MapModal({ showModal, setShowModal, markers }) { |
|
|
const finalDate = moment().subtract(5, "days").format("YYYY-MM-DD"); |
|
|
const finalDate = moment().subtract(5, "days").format("YYYY-MM-DD"); |
|
|
|
|
|
|
|
|
timeFilter = finalDate + "/" + initialDate; |
|
|
timeFilter = finalDate + "/" + initialDate; |
|
|
// console.log(timeFilter);
|
|
|
|
|
|
|
|
|
// console.log(timeFilter);
|
|
|
} |
|
|
} |
|
|
if (currentMarker == undefined) { |
|
|
if (currentMarker == undefined) { |
|
|
if (name == "pluviometer") { |
|
|
if (name == "pluviometer") { |
|
@ -422,6 +446,11 @@ const styles = StyleSheet.create({ |
|
|
fontWeight: "500", |
|
|
fontWeight: "500", |
|
|
fontSize: dimensions.text.default, |
|
|
fontSize: dimensions.text.default, |
|
|
}, |
|
|
}, |
|
|
|
|
|
text_pluv: { |
|
|
|
|
|
fontWeight: "bold", |
|
|
|
|
|
fontSize: dimensions.text.default, |
|
|
|
|
|
color: colors.primary, |
|
|
|
|
|
}, |
|
|
link: { |
|
|
link: { |
|
|
alignSelf: "center", |
|
|
alignSelf: "center", |
|
|
color: colors.lightBlue, |
|
|
color: colors.lightBlue, |
|
|