|
@@ -142,6 +142,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
const { data: photosData } = useGetPhotosForRegionQuery(nmId ?? 0, nmId !== null);
|
|
const { data: photosData } = useGetPhotosForRegionQuery(nmId ?? 0, nmId !== null);
|
|
|
const { mutateAsync: getPhotosForRegion } = usePostGetPhotosForRegionMutation();
|
|
const { mutateAsync: getPhotosForRegion } = usePostGetPhotosForRegionMutation();
|
|
|
const [regions, setRegions] = useState<any[]>([]);
|
|
const [regions, setRegions] = useState<any[]>([]);
|
|
|
|
|
+ const [isSubmitting, setIsSubmitting] = useState(false);
|
|
|
|
|
|
|
|
const [modalInfo, setModalInfo] = useState({
|
|
const [modalInfo, setModalInfo] = useState({
|
|
|
visible: false,
|
|
visible: false,
|
|
@@ -488,6 +489,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
action: () => {}
|
|
action: () => {}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ setIsSubmitting(true);
|
|
|
|
|
|
|
|
await joinEvent(
|
|
await joinEvent(
|
|
|
{ token, id: event.id },
|
|
{ token, id: event.id },
|
|
@@ -495,6 +497,10 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
onSuccess: () => {
|
|
onSuccess: () => {
|
|
|
setJoined(1);
|
|
setJoined(1);
|
|
|
refetch();
|
|
refetch();
|
|
|
|
|
+ setIsSubmitting(false);
|
|
|
|
|
+ },
|
|
|
|
|
+ onError: () => {
|
|
|
|
|
+ setIsSubmitting(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
@@ -1723,11 +1729,15 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
backgroundColor: Colors.ORANGE,
|
|
backgroundColor: Colors.ORANGE,
|
|
|
gap: 6,
|
|
gap: 6,
|
|
|
borderWidth: 1,
|
|
borderWidth: 1,
|
|
|
- borderColor: Colors.ORANGE
|
|
|
|
|
|
|
+ borderColor: Colors.ORANGE,
|
|
|
|
|
+ minHeight: 36
|
|
|
}}
|
|
}}
|
|
|
onPress={handleJoinEvent}
|
|
onPress={handleJoinEvent}
|
|
|
|
|
+ disabled={isSubmitting}
|
|
|
>
|
|
>
|
|
|
- {event.settings.type === 1 ? (
|
|
|
|
|
|
|
+ {isSubmitting ? (
|
|
|
|
|
+ <ActivityIndicator animating={true} color={'#fff'} size={16} />
|
|
|
|
|
+ ) : event.settings.type === 1 ? (
|
|
|
<>
|
|
<>
|
|
|
<GigtIcon fill={Colors.WHITE} width={16} height={16} />
|
|
<GigtIcon fill={Colors.WHITE} width={16} height={16} />
|
|
|
<Text
|
|
<Text
|