Compare commits
No commits in common. "ca3a2c8fcce2aaa613817bde047f143915ef8fe0" and "3e70ff23c9361a5d331e15160adbb44a8bf773ac" have entirely different histories.
ca3a2c8fcc
...
3e70ff23c9
3 changed files with 3 additions and 44 deletions
|
@ -22,7 +22,6 @@ export default function FieldNotifySelector() {
|
||||||
const callEmergency = watch("callEmergency");
|
const callEmergency = watch("callEmergency");
|
||||||
const notifyAround = watch("notifyAround");
|
const notifyAround = watch("notifyAround");
|
||||||
const notifyRelatives = watch("notifyRelatives");
|
const notifyRelatives = watch("notifyRelatives");
|
||||||
const followLocation = watch("followLocation");
|
|
||||||
const level = watch("level");
|
const level = watch("level");
|
||||||
|
|
||||||
const checkedColor = colors.primary;
|
const checkedColor = colors.primary;
|
||||||
|
@ -107,29 +106,6 @@ export default function FieldNotifySelector() {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.followLocationContainer}>
|
|
||||||
<CheckboxItem
|
|
||||||
status={followLocation ? "checked" : "unchecked"}
|
|
||||||
style={styles.checkboxItem}
|
|
||||||
labelStyle={styles.checkboxLabel}
|
|
||||||
size={styleOptions.checkboxItem.size}
|
|
||||||
icon={() => (
|
|
||||||
<MaterialCommunityIcons
|
|
||||||
name="crosshairs-gps"
|
|
||||||
style={styles.checkboxIcon}
|
|
||||||
onPress={() => {
|
|
||||||
setValue("followLocation", !followLocation);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
color={checkedColor}
|
|
||||||
uncheckedColor={uncheckedColor}
|
|
||||||
label="Suivre ma localisation"
|
|
||||||
onPress={() => {
|
|
||||||
setValue("followLocation", !followLocation);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -146,7 +122,6 @@ const useStyles = createStyles(
|
||||||
({ wp, hp, scaleText, fontSize, theme: { colors, textShadowForWhite } }) => ({
|
({ wp, hp, scaleText, fontSize, theme: { colors, textShadowForWhite } }) => ({
|
||||||
container: {
|
container: {
|
||||||
marginTop: hp(2),
|
marginTop: hp(2),
|
||||||
marginBottom: hp(3),
|
|
||||||
},
|
},
|
||||||
checkboxItemContainer: {
|
checkboxItemContainer: {
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
|
@ -155,13 +130,6 @@ const useStyles = createStyles(
|
||||||
marginVertical: hp(0.2),
|
marginVertical: hp(0.2),
|
||||||
backgroundColor: colors.surface,
|
backgroundColor: colors.surface,
|
||||||
},
|
},
|
||||||
followLocationContainer: {
|
|
||||||
borderRadius: 4,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: colors.outline,
|
|
||||||
marginVertical: hp(4),
|
|
||||||
backgroundColor: colors.surface,
|
|
||||||
},
|
|
||||||
checkboxItem: {
|
checkboxItem: {
|
||||||
paddingHorizontal: 6,
|
paddingHorizontal: 6,
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,8 +9,7 @@ export default function SendAlertConfirm({ route }) {
|
||||||
|
|
||||||
const { alert } = params;
|
const { alert } = params;
|
||||||
const level = alert?.level || params.level;
|
const level = alert?.level || params.level;
|
||||||
const callEmergency =
|
const callEmergency = params.forceCallEmergency || level === "red";
|
||||||
params.forceCallEmergency || level === "red" || level === "yellow";
|
|
||||||
|
|
||||||
const methods = useForm({
|
const methods = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
@ -19,7 +18,6 @@ export default function SendAlertConfirm({ route }) {
|
||||||
callEmergency,
|
callEmergency,
|
||||||
notifyAround: true,
|
notifyAround: true,
|
||||||
notifyRelatives: true,
|
notifyRelatives: true,
|
||||||
followLocation: true,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -33,14 +33,8 @@ async function onSubmit(args, context) {
|
||||||
const [alertInput] = args;
|
const [alertInput] = args;
|
||||||
const { navigation } = context;
|
const { navigation } = context;
|
||||||
|
|
||||||
const {
|
const { subject, level, callEmergency, notifyAround, notifyRelatives } =
|
||||||
subject,
|
alertInput;
|
||||||
level,
|
|
||||||
callEmergency,
|
|
||||||
notifyAround,
|
|
||||||
notifyRelatives,
|
|
||||||
followLocation,
|
|
||||||
} = alertInput;
|
|
||||||
|
|
||||||
const coords = await getCurrentLocation();
|
const coords = await getCurrentLocation();
|
||||||
|
|
||||||
|
@ -68,7 +62,6 @@ async function onSubmit(args, context) {
|
||||||
callEmergency,
|
callEmergency,
|
||||||
notifyAround,
|
notifyAround,
|
||||||
notifyRelatives,
|
notifyRelatives,
|
||||||
followLocation: !!followLocation,
|
|
||||||
location,
|
location,
|
||||||
accuracy,
|
accuracy,
|
||||||
altitude,
|
altitude,
|
||||||
|
|
Loading…
Add table
Reference in a new issue