|
|
@ -219,10 +219,10 @@ function ListDataOptions( |
|
|
|
height: 36, |
|
|
|
justifyContent: "center", |
|
|
|
borderRadius: 6, |
|
|
|
backgroundColor: item ? colors.activated : colors.notActivated, |
|
|
|
backgroundColor: !item ? colors.activated : colors.notActivated, |
|
|
|
}} |
|
|
|
> |
|
|
|
<Text style={styles.text}>{item ? "ADICIONAR" : "REMOVER"}</Text> |
|
|
|
<Text style={styles.text}>{!item ? "ADICIONAR" : "REMOVER"}</Text> |
|
|
|
</View> |
|
|
|
</TouchableOpacity> |
|
|
|
</View> |
|
|
@ -243,10 +243,7 @@ function DataOriginOptions({ |
|
|
|
flexDirection: "column", |
|
|
|
}} |
|
|
|
> |
|
|
|
<ScrollView |
|
|
|
height={270} |
|
|
|
automaticallyAdjustContentInsets={true} |
|
|
|
> |
|
|
|
<ScrollView height={270} automaticallyAdjustContentInsets={true}> |
|
|
|
<View> |
|
|
|
{dataOptions[dataOriginToShow].map((option) => |
|
|
|
ListDataOptions( |
|
|
@ -262,26 +259,15 @@ function DataOriginOptions({ |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
function DataMenuBody({ setShowModal }) { |
|
|
|
function DataMenuBody({ |
|
|
|
setShowModal, |
|
|
|
dataOptionsToShow, |
|
|
|
setDataOptionsToShow, |
|
|
|
}) { |
|
|
|
const [dataOriginToShow, setDataOriginToShow] = useState("oficial"); |
|
|
|
const [dataOptionsToShow, setDataOptionsToShow] = useState({ |
|
|
|
oficial: { |
|
|
|
automaticPluviometer: false, |
|
|
|
susceptibilityAreas: false, |
|
|
|
}, |
|
|
|
citzen: { |
|
|
|
floodRisk: false, |
|
|
|
pluviometer: true, |
|
|
|
rain: false, |
|
|
|
floodZones: true, |
|
|
|
riverFlood: true, |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
return ( |
|
|
|
<View |
|
|
|
backgroundColor={colors.grayBG} |
|
|
|
> |
|
|
|
<View backgroundColor={colors.grayBG}> |
|
|
|
<DataMenuHeader setShowModal={setShowModal} /> |
|
|
|
<DataOriginSelector |
|
|
|
dataOriginToShow={dataOriginToShow} |
|
|
@ -289,8 +275,8 @@ function DataMenuBody({ setShowModal }) { |
|
|
|
/> |
|
|
|
<DataOriginOptions |
|
|
|
dataOptionsToShow={dataOptionsToShow} |
|
|
|
dataOriginToShow={dataOriginToShow} |
|
|
|
setDataOptionsToShow={setDataOptionsToShow} |
|
|
|
dataOriginToShow={dataOriginToShow} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
); |
|
|
@ -298,31 +284,30 @@ function DataMenuBody({ setShowModal }) { |
|
|
|
|
|
|
|
function ModalOpenBtn({ setShowModal }) { |
|
|
|
return ( |
|
|
|
<TouchableOpacity |
|
|
|
onPress={() => setShowModal()} |
|
|
|
> |
|
|
|
<TouchableOpacity onPress={() => setShowModal()}> |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
width: "100%", |
|
|
|
height: 48, |
|
|
|
backgroundColor: colors.primary, |
|
|
|
justifyContent: "center", |
|
|
|
alignItems: "center" |
|
|
|
}}> |
|
|
|
alignItems: "center", |
|
|
|
}} |
|
|
|
> |
|
|
|
<Text style={styles.text}>VISUALIZAR DADOS NO MAPA</Text> |
|
|
|
</View> |
|
|
|
</TouchableOpacity> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
export default function MapDataMenu(props) { |
|
|
|
export default function MapDataMenu({ |
|
|
|
dataOptionsToShow, |
|
|
|
setDataOptionsToShow, |
|
|
|
}) { |
|
|
|
const [showModal, setShowModal] = useState(null); |
|
|
|
return ( |
|
|
|
<View |
|
|
|
> |
|
|
|
|
|
|
|
<ModalOpenBtn |
|
|
|
setShowModal={() => setShowModal(true)}/> |
|
|
|
<View> |
|
|
|
<ModalOpenBtn setShowModal={() => setShowModal(true)} /> |
|
|
|
|
|
|
|
<SelfClosingModal |
|
|
|
style={{ position: "absolute" }} |
|
|
@ -331,7 +316,11 @@ export default function MapDataMenu(props) { |
|
|
|
showModal={showModal} |
|
|
|
setShowModal={setShowModal} |
|
|
|
> |
|
|
|
<DataMenuBody setShowModal={setShowModal} /> |
|
|
|
<DataMenuBody |
|
|
|
setShowModal={setShowModal} |
|
|
|
dataOptionsToShow={dataOptionsToShow} |
|
|
|
setDataOptionsToShow={setDataOptionsToShow} |
|
|
|
/> |
|
|
|
</SelfClosingModal> |
|
|
|
</View> |
|
|
|
); |
|
|
|