|
@@ -23,6 +23,7 @@ import { NAVIGATION_PAGES } from 'src/types';
|
|
|
import { API_HOST, APP_VERSION } from 'src/constants';
|
|
|
import { StoreType, storage } from 'src/storage';
|
|
|
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
|
+import * as Progress from 'react-native-progress';
|
|
|
|
|
|
import ChevronLeft from 'assets/icons/chevron-left.svg';
|
|
|
import MapSvg from 'assets/icons/travels-screens/map-location.svg';
|
|
@@ -109,6 +110,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
const [myTempFiles, setMyTempFiles] = useState<TempFile[]>([]);
|
|
|
const [myFiles, setMyFiles] = useState<EventAttachments[]>([]);
|
|
|
const [photos, setPhotos] = useState<(EventPhotos & { isSending?: boolean })[]>([]);
|
|
|
+ const [isUploading, setIsUploading] = useState(false);
|
|
|
|
|
|
const [modalInfo, setModalInfo] = useState({
|
|
|
visible: false,
|
|
@@ -213,6 +215,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
allowMultiSelection: true
|
|
|
});
|
|
|
|
|
|
+ setIsUploading(true);
|
|
|
for (const res of response) {
|
|
|
let file: any = {
|
|
|
uri: res.uri,
|
|
@@ -246,6 +249,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
{ ...result, type: 1, description: '', isSending: false },
|
|
|
...prev
|
|
|
]);
|
|
|
+ setIsUploading(false);
|
|
|
},
|
|
|
onError: (error) => {
|
|
|
console.error('Upload error:', error);
|
|
@@ -253,7 +257,11 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
- } catch {}
|
|
|
+ } catch {
|
|
|
+ setIsUploading(false);
|
|
|
+ } finally {
|
|
|
+ setIsUploading(false);
|
|
|
+ }
|
|
|
}, [token]);
|
|
|
|
|
|
const handleUploadPhoto = useCallback(async () => {
|
|
@@ -600,7 +608,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
>
|
|
|
<Image source={{ uri: photoUrl }} style={{ width: '100%', height: 220 }} />
|
|
|
|
|
|
- <TouchableOpacity
|
|
|
+ {/* <TouchableOpacity
|
|
|
onPress={() => {
|
|
|
// navigation.dispatch(
|
|
|
// CommonActions.reset({
|
|
@@ -626,7 +634,7 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
<View style={styles.chevronWrapper}>
|
|
|
<MapSvg fill={Colors.WHITE} />
|
|
|
</View>
|
|
|
- </TouchableOpacity>
|
|
|
+ </TouchableOpacity> */}
|
|
|
|
|
|
{registrationInfo && (
|
|
|
<View
|
|
@@ -1051,6 +1059,21 @@ const EventScreen = ({ route }: { route: any }) => {
|
|
|
) : null}
|
|
|
</View>
|
|
|
|
|
|
+ {isUploading && (
|
|
|
+ <View
|
|
|
+ style={{
|
|
|
+ alignItems: 'center',
|
|
|
+ justifyContent: 'center'
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Progress.CircleSnail
|
|
|
+ borderWidth={0}
|
|
|
+ color={Colors.DARK_BLUE}
|
|
|
+ unfilledColor="rgba(0, 0, 0, 0.1)"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ )}
|
|
|
+
|
|
|
{myTempFiles && myTempFiles.length
|
|
|
? myTempFiles.map((file) => {
|
|
|
return (
|