|
@@ -49,7 +49,8 @@ const EventSchema = yup.object({
|
|
end_date: yup.date().nullable().required(),
|
|
end_date: yup.date().nullable().required(),
|
|
tentative: yup.number().optional(),
|
|
tentative: yup.number().optional(),
|
|
photo: yup.number().nullable().required(),
|
|
photo: yup.number().nullable().required(),
|
|
- details: yup.string().required()
|
|
|
|
|
|
+ details: yup.string().required(),
|
|
|
|
+ checkboxAgreed: yup.bool().isTrue()
|
|
});
|
|
});
|
|
|
|
|
|
const CreateSharedTripScreen = ({ route }: { route: any }) => {
|
|
const CreateSharedTripScreen = ({ route }: { route: any }) => {
|
|
@@ -128,8 +129,9 @@ const CreateSharedTripScreen = ({ route }: { route: any }) => {
|
|
start_date: eventData?.date_from ?? '',
|
|
start_date: eventData?.date_from ?? '',
|
|
end_date: eventData?.date_to ?? '',
|
|
end_date: eventData?.date_to ?? '',
|
|
tentative: eventData?.date_tentative ?? 0,
|
|
tentative: eventData?.date_tentative ?? 0,
|
|
- photo: null,
|
|
|
|
- details: eventData?.details ?? ''
|
|
|
|
|
|
+ photo: eventData?.photo_id ?? null,
|
|
|
|
+ details: eventData?.details ?? '',
|
|
|
|
+ checkboxAgreed: false
|
|
};
|
|
};
|
|
|
|
|
|
const [modalInfo, setModalInfo] = useState({
|
|
const [modalInfo, setModalInfo] = useState({
|
|
@@ -212,7 +214,8 @@ const CreateSharedTripScreen = ({ route }: { route: any }) => {
|
|
end_date: values.end_date,
|
|
end_date: values.end_date,
|
|
tentative: values.tentative,
|
|
tentative: values.tentative,
|
|
regions: regionsToSave,
|
|
regions: regionsToSave,
|
|
- details: values.details
|
|
|
|
|
|
+ details: values.details,
|
|
|
|
+ disclaimer: values.checkboxAgreed ? 1 : 0
|
|
};
|
|
};
|
|
|
|
|
|
if (values.photo) {
|
|
if (values.photo) {
|
|
@@ -551,6 +554,33 @@ const CreateSharedTripScreen = ({ route }: { route: any }) => {
|
|
) : null}
|
|
) : null}
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
+ <View>
|
|
|
|
+ <TouchableOpacity
|
|
|
|
+ onPress={() =>
|
|
|
|
+ props.setFieldValue('checkboxAgreed', !props.values.checkboxAgreed)
|
|
|
|
+ }
|
|
|
|
+ style={styles.checkbox}
|
|
|
|
+ >
|
|
|
|
+ <CheckBox
|
|
|
|
+ onChange={(value) => props.setFieldValue('checkboxAgreed', value)}
|
|
|
|
+ value={props.values.checkboxAgreed}
|
|
|
|
+ color={Colors.DARK_BLUE}
|
|
|
|
+ />
|
|
|
|
+ <Text style={styles.text}>
|
|
|
|
+ I confirm that this trip is a private, non-commercial travel plan intended
|
|
|
|
+ for fellow travelers to join and share costs. I understand that advertising
|
|
|
|
+ professional, commercial, or tour agency services through this feature is
|
|
|
|
+ not allowed. I acknowledge that NomadMania is not the organizer and takes no
|
|
|
|
+ responsibility for this trip.
|
|
|
|
+ </Text>
|
|
|
|
+ </TouchableOpacity>
|
|
|
|
+ <Text style={styles.textError}>
|
|
|
|
+ {props.touched.checkboxAgreed && props.errors.checkboxAgreed
|
|
|
|
+ ? 'to use our service you need to agree'
|
|
|
|
+ : null}
|
|
|
|
+ </Text>
|
|
|
|
+ </View>
|
|
|
|
+
|
|
{eventId ? (
|
|
{eventId ? (
|
|
<View style={{ marginTop: 15, marginBottom: 15, gap: 8 }}>
|
|
<View style={{ marginTop: 15, marginBottom: 15, gap: 8 }}>
|
|
<Button
|
|
<Button
|