app-expo-cli 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/package.json +1 -1
- package/src/copy-template.js +19 -1
- package/src/install-deps.js +6 -0
- package/template/assets/fonts/Inter_18pt-Black.ttf +0 -0
- package/template/assets/fonts/Inter_18pt-BlackItalic.ttf +0 -0
- package/template/assets/icon/index.ts +146 -0
- package/template/assets/images/about_us.png +0 -0
- package/template/assets/images/index.ts +6 -0
- package/template/assets/images/logo.png +0 -0
- package/template/assets/images/privacy_policy.png +0 -0
- package/template/assets/images/terms_and_conditions.png +0 -0
- package/template/src/app/_layout.tsx +3 -3
- package/template/src/app/auth/change_pass.tsx +18 -15
- package/template/src/app/auth/change_pass_modal.tsx +32 -51
- package/template/src/app/auth/forgot.tsx +74 -88
- package/template/src/app/auth/index.tsx +161 -192
- package/template/src/app/auth/opt_verify.tsx +93 -103
- package/template/src/app/auth/register.tsx +198 -260
- package/template/src/app/auth/reset_pass.tsx +102 -105
- package/template/src/app/index.tsx +70 -7
- package/template/src/app/modals/confirmation_logout_modal.tsx +0 -5
- package/template/src/app/modals/success_modal.tsx +28 -48
- package/template/src/app/settings/about_us.tsx +1 -1
- package/template/src/app/settings/privacy_policy.tsx +1 -1
- package/template/src/app/settings/terms_and_conditions.tsx +1 -1
- package/template/src/lib/DateTimePicker/DateTimePicker.tsx +63 -0
- package/template/src/lib/Empty/EmptyCard.tsx +67 -0
- package/template/src/lib/Error/GlobalErrorBoundary.tsx +111 -0
- package/template/src/lib/animate/AniImage.tsx +32 -0
- package/template/src/lib/backHeader/BackButton.tsx +62 -0
- package/template/src/lib/backHeader/BackWithCoponent.tsx +112 -0
- package/template/src/lib/backHeader/BackWithHeader.tsx +46 -0
- package/template/src/lib/backHeader/BackWithTitle.tsx +53 -0
- package/template/src/lib/buttons/IButton.tsx +69 -0
- package/template/src/lib/buttons/IwtButton.tsx +199 -0
- package/template/src/lib/buttons/Or.tsx +27 -0
- package/template/src/lib/buttons/SimpleButton.tsx +45 -0
- package/template/src/lib/buttons/TButton.tsx +70 -0
- package/template/src/lib/cards/Card.tsx +175 -0
- package/template/src/lib/cards/OptionSelect.tsx +44 -0
- package/template/src/lib/cards/SearchCard.tsx +35 -0
- package/template/src/lib/editor/TextEditor.tsx +81 -0
- package/template/src/lib/expend/ExpendComponent.tsx +36 -0
- package/template/src/lib/imageViewer/ImageViwer.tsx +332 -0
- package/template/src/lib/imageZoomer/ImageZoomer.tsx +104 -0
- package/template/src/lib/inputs/CheckBox.tsx +86 -0
- package/template/src/lib/inputs/InputText.tsx +232 -0
- package/template/src/lib/loader/GLoading.tsx +26 -0
- package/template/src/lib/loading/MLoading.tsx +14 -0
- package/template/src/lib/loading/SLoading.tsx +14 -0
- package/template/src/lib/modals/ActionModal.tsx +97 -0
- package/template/src/lib/modals/BottomModal.tsx +224 -0
- package/template/src/lib/modals/ConfrimationModal.tsx +116 -0
- package/template/src/lib/modals/DateModal.tsx +152 -0
- package/template/src/lib/modals/NormalModal.tsx +73 -0
- package/template/src/lib/modals/SideModal.tsx +57 -0
- package/template/src/lib/modals/Toaster.tsx +256 -0
- package/template/src/lib/payment/PaymentCardForD.tsx +47 -0
- package/template/src/lib/progressBar/ProgressBar.tsx +64 -0
- package/template/src/lib/tailwind.js +9 -0
- package/template/src/lib/ui/Avatar.tsx +55 -0
- package/template/src/redux/api-config/baseApi.ts +0 -22
- package/template/src/redux/interface/interface.ts +11 -193
- package/template/src/redux/store.ts +2 -2
- package/template/src/app/home/_layout.tsx +0 -29
- package/template/src/app/home/drawer/_layout.tsx +0 -27
- package/template/src/app/home/tabs/_layout.tsx +0 -75
- package/template/src/app/home/tabs/index.tsx +0 -11
- package/template/src/app/modals/payment_modal.tsx +0 -105
- package/template/src/hooks/useCheckLocation.ts +0 -36
- package/template/src/hooks/useDocPicker.ts +0 -83
- package/template/src/hooks/useSuggestionLocation.ts +0 -36
- package/template/src/hooks/useUploadProgress.ts +0 -127
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import * as DocumentPicker from "expo-document-picker";
|
|
2
|
-
|
|
3
|
-
import { createAudioPlayer } from "expo-audio";
|
|
4
|
-
|
|
5
|
-
interface UseDocPickerReturn {
|
|
6
|
-
pickDocument: ({
|
|
7
|
-
multiple,
|
|
8
|
-
}: UseDocPickerProps) => Promise<
|
|
9
|
-
| DocumentPicker.DocumentPickerAsset
|
|
10
|
-
| DocumentPicker.DocumentPickerAsset[]
|
|
11
|
-
| null
|
|
12
|
-
>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const DocPickerType = {
|
|
16
|
-
audio: "audio/*",
|
|
17
|
-
pdf: "application/pdf",
|
|
18
|
-
images: "image/*",
|
|
19
|
-
videos: "video/*",
|
|
20
|
-
allFiles: "*/*",
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
interface UseDocPickerProps {
|
|
24
|
-
// You can add props here if needed in the future
|
|
25
|
-
multiple?: boolean;
|
|
26
|
-
type?: (typeof DocPickerType)[keyof typeof DocPickerType];
|
|
27
|
-
allowDuration: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const useDocPicker = (): UseDocPickerReturn => {
|
|
31
|
-
const pickDocument = async ({
|
|
32
|
-
multiple,
|
|
33
|
-
type = DocPickerType.audio,
|
|
34
|
-
allowDuration,
|
|
35
|
-
}: UseDocPickerProps): Promise<
|
|
36
|
-
| DocumentPicker.DocumentPickerAsset
|
|
37
|
-
| DocumentPicker.DocumentPickerAsset[]
|
|
38
|
-
| null
|
|
39
|
-
> => {
|
|
40
|
-
// No permissions request is necessary for launching the document picker
|
|
41
|
-
const result = await DocumentPicker.getDocumentAsync({
|
|
42
|
-
multiple: !!multiple,
|
|
43
|
-
type: type,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// console.log(result);
|
|
47
|
-
|
|
48
|
-
if (result.canceled) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (!result.canceled && allowDuration) {
|
|
53
|
-
return new Promise((resolve) => {
|
|
54
|
-
let enter = true;
|
|
55
|
-
const player = createAudioPlayer(result?.assets![0]?.uri);
|
|
56
|
-
|
|
57
|
-
player.addListener("playbackStatusUpdate", (status) => {
|
|
58
|
-
if (status.isLoaded && status.duration > 0.1) {
|
|
59
|
-
if (player?.duration > allowDuration && enter) {
|
|
60
|
-
enter = false;
|
|
61
|
-
alert("Please select a file with a duration less than 3 minutes");
|
|
62
|
-
resolve(null);
|
|
63
|
-
} else if (enter) {
|
|
64
|
-
enter = false;
|
|
65
|
-
resolve(result.assets);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (!result.canceled && !allowDuration) {
|
|
73
|
-
return result.assets;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Ensure we never return undefined
|
|
77
|
-
return null;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
pickDocument,
|
|
82
|
-
};
|
|
83
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
const GOOGLE_MAPS_API_KEY = "AIzaSyCZWDL-UblMpEOnoFf2UphrUbjUb6nLhxM";
|
|
4
|
-
export const useSuggestionLocation = () => {
|
|
5
|
-
const [locationSuggestions, setLocationSuggestions] = useState<any[]>([]);
|
|
6
|
-
const [suggestionLoading, setSuggestionLoading] = useState(false);
|
|
7
|
-
|
|
8
|
-
const handleSearchLocation = async (query: string) => {
|
|
9
|
-
try {
|
|
10
|
-
setSuggestionLoading(true);
|
|
11
|
-
const response = await axios.get(
|
|
12
|
-
`https://maps.googleapis.com/maps/api/place/textsearch/json?query=${query}&key=${GOOGLE_MAPS_API_KEY}`
|
|
13
|
-
);
|
|
14
|
-
// console.log(response);
|
|
15
|
-
setLocationSuggestions(response?.data?.results);
|
|
16
|
-
setSuggestionLoading(false);
|
|
17
|
-
} catch (error) {
|
|
18
|
-
// console.log()
|
|
19
|
-
console.log(error);
|
|
20
|
-
setSuggestionLoading(false);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const clearSuggestions = () => {
|
|
25
|
-
setLocationSuggestions([]);
|
|
26
|
-
setSuggestionLoading(false);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
locationSuggestions,
|
|
31
|
-
handleSearchLocation,
|
|
32
|
-
clearSuggestions,
|
|
33
|
-
setLocationSuggestions,
|
|
34
|
-
suggestionLoading,
|
|
35
|
-
};
|
|
36
|
-
};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useUploadNewfileMutation } from "@/src/redux/apiSlices/mediaSlices";
|
|
3
|
-
|
|
4
|
-
interface FileUploadProgress {
|
|
5
|
-
fileName: string;
|
|
6
|
-
progress: number;
|
|
7
|
-
status: "existing" | "uploading" | "completed" | "failed";
|
|
8
|
-
error?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const useUploadProgress = () => {
|
|
12
|
-
const [uploadFile] = useUploadNewfileMutation();
|
|
13
|
-
const [uploadProgress, setUploadProgress] = React.useState<
|
|
14
|
-
FileUploadProgress[]
|
|
15
|
-
>([]);
|
|
16
|
-
const [isUploading, setIsUploading] = React.useState(false);
|
|
17
|
-
|
|
18
|
-
const uploadFilesWithProgress = async (files: any[]) => {
|
|
19
|
-
setIsUploading(true);
|
|
20
|
-
|
|
21
|
-
const existingIds: string[] = [];
|
|
22
|
-
const localFiles: any[] = [];
|
|
23
|
-
|
|
24
|
-
// ✅ Separate backend + local files
|
|
25
|
-
files.forEach((file) => {
|
|
26
|
-
if (file?._id && !file.mimeType) {
|
|
27
|
-
existingIds.push(file._id);
|
|
28
|
-
} else if (file?.mimeType) {
|
|
29
|
-
localFiles.push(file);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// ✅ Initialize state only once
|
|
34
|
-
setUploadProgress(
|
|
35
|
-
files.map((file) => ({
|
|
36
|
-
fileName: file.name || file.url?.split("/")?.pop() || "backend_file",
|
|
37
|
-
progress: file._id ? 100 : 0,
|
|
38
|
-
status: file._id ? "existing" : "uploading",
|
|
39
|
-
}))
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const uploadedLocalIds: string[] = [];
|
|
43
|
-
const errors: string[] = [];
|
|
44
|
-
|
|
45
|
-
// ✅ Upload local files sequentially with stable updates
|
|
46
|
-
for (let i = 0; i < localFiles.length; i++) {
|
|
47
|
-
const file = localFiles[i];
|
|
48
|
-
|
|
49
|
-
const matchIndex = files.findIndex(
|
|
50
|
-
(f) => f.uri === file.uri || f.url === file.url
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
// ✅ Reliable progress update
|
|
55
|
-
setUploadProgress((prev) => {
|
|
56
|
-
const updated = [...prev];
|
|
57
|
-
updated[matchIndex] = {
|
|
58
|
-
...updated[matchIndex],
|
|
59
|
-
progress: 30,
|
|
60
|
-
status: "uploading",
|
|
61
|
-
};
|
|
62
|
-
return updated;
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const formData = new FormData();
|
|
66
|
-
formData.append("audio", {
|
|
67
|
-
uri: file.uri,
|
|
68
|
-
name: file.name,
|
|
69
|
-
type: file.mimeType,
|
|
70
|
-
} as any);
|
|
71
|
-
|
|
72
|
-
const uploadedMedia = await uploadFile(formData).unwrap();
|
|
73
|
-
|
|
74
|
-
setUploadProgress((prev) => {
|
|
75
|
-
const updated = [...prev];
|
|
76
|
-
updated[matchIndex] = {
|
|
77
|
-
...updated[matchIndex],
|
|
78
|
-
progress: 100,
|
|
79
|
-
status: "completed",
|
|
80
|
-
};
|
|
81
|
-
return updated;
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
if (uploadedMedia?.data) {
|
|
85
|
-
const ids = uploadedMedia.data.map((item: any) => item._id);
|
|
86
|
-
uploadedLocalIds.push(...ids);
|
|
87
|
-
}
|
|
88
|
-
} catch (err: any) {
|
|
89
|
-
setUploadProgress((prev) => {
|
|
90
|
-
const updated = [...prev];
|
|
91
|
-
updated[matchIndex] = {
|
|
92
|
-
...updated[matchIndex],
|
|
93
|
-
progress: 0,
|
|
94
|
-
status: "failed",
|
|
95
|
-
error: err?.data?.message || "Upload failed",
|
|
96
|
-
};
|
|
97
|
-
return updated;
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
errors.push(err?.data?.message || "Upload failed");
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
setIsUploading(false);
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
success: errors.length === 0,
|
|
108
|
-
audioIds: [...existingIds, ...uploadedLocalIds],
|
|
109
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const totalProgress =
|
|
114
|
-
uploadProgress.length > 0
|
|
115
|
-
? Math.round(
|
|
116
|
-
uploadProgress.reduce((sum, f) => sum + f.progress, 0) /
|
|
117
|
-
uploadProgress.length
|
|
118
|
-
)
|
|
119
|
-
: 0;
|
|
120
|
-
|
|
121
|
-
return {
|
|
122
|
-
uploadFilesWithProgress,
|
|
123
|
-
uploadProgress,
|
|
124
|
-
totalProgress,
|
|
125
|
-
isUploading,
|
|
126
|
-
};
|
|
127
|
-
};
|