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.
Files changed (74) hide show
  1. package/README.md +11 -5
  2. package/package.json +1 -1
  3. package/src/copy-template.js +19 -1
  4. package/src/install-deps.js +6 -0
  5. package/template/assets/fonts/Inter_18pt-Black.ttf +0 -0
  6. package/template/assets/fonts/Inter_18pt-BlackItalic.ttf +0 -0
  7. package/template/assets/icon/index.ts +146 -0
  8. package/template/assets/images/about_us.png +0 -0
  9. package/template/assets/images/index.ts +6 -0
  10. package/template/assets/images/logo.png +0 -0
  11. package/template/assets/images/privacy_policy.png +0 -0
  12. package/template/assets/images/terms_and_conditions.png +0 -0
  13. package/template/src/app/_layout.tsx +3 -3
  14. package/template/src/app/auth/change_pass.tsx +18 -15
  15. package/template/src/app/auth/change_pass_modal.tsx +32 -51
  16. package/template/src/app/auth/forgot.tsx +74 -88
  17. package/template/src/app/auth/index.tsx +161 -192
  18. package/template/src/app/auth/opt_verify.tsx +93 -103
  19. package/template/src/app/auth/register.tsx +198 -260
  20. package/template/src/app/auth/reset_pass.tsx +102 -105
  21. package/template/src/app/index.tsx +70 -7
  22. package/template/src/app/modals/confirmation_logout_modal.tsx +0 -5
  23. package/template/src/app/modals/success_modal.tsx +28 -48
  24. package/template/src/app/settings/about_us.tsx +1 -1
  25. package/template/src/app/settings/privacy_policy.tsx +1 -1
  26. package/template/src/app/settings/terms_and_conditions.tsx +1 -1
  27. package/template/src/lib/DateTimePicker/DateTimePicker.tsx +63 -0
  28. package/template/src/lib/Empty/EmptyCard.tsx +67 -0
  29. package/template/src/lib/Error/GlobalErrorBoundary.tsx +111 -0
  30. package/template/src/lib/animate/AniImage.tsx +32 -0
  31. package/template/src/lib/backHeader/BackButton.tsx +62 -0
  32. package/template/src/lib/backHeader/BackWithCoponent.tsx +112 -0
  33. package/template/src/lib/backHeader/BackWithHeader.tsx +46 -0
  34. package/template/src/lib/backHeader/BackWithTitle.tsx +53 -0
  35. package/template/src/lib/buttons/IButton.tsx +69 -0
  36. package/template/src/lib/buttons/IwtButton.tsx +199 -0
  37. package/template/src/lib/buttons/Or.tsx +27 -0
  38. package/template/src/lib/buttons/SimpleButton.tsx +45 -0
  39. package/template/src/lib/buttons/TButton.tsx +70 -0
  40. package/template/src/lib/cards/Card.tsx +175 -0
  41. package/template/src/lib/cards/OptionSelect.tsx +44 -0
  42. package/template/src/lib/cards/SearchCard.tsx +35 -0
  43. package/template/src/lib/editor/TextEditor.tsx +81 -0
  44. package/template/src/lib/expend/ExpendComponent.tsx +36 -0
  45. package/template/src/lib/imageViewer/ImageViwer.tsx +332 -0
  46. package/template/src/lib/imageZoomer/ImageZoomer.tsx +104 -0
  47. package/template/src/lib/inputs/CheckBox.tsx +86 -0
  48. package/template/src/lib/inputs/InputText.tsx +232 -0
  49. package/template/src/lib/loader/GLoading.tsx +26 -0
  50. package/template/src/lib/loading/MLoading.tsx +14 -0
  51. package/template/src/lib/loading/SLoading.tsx +14 -0
  52. package/template/src/lib/modals/ActionModal.tsx +97 -0
  53. package/template/src/lib/modals/BottomModal.tsx +224 -0
  54. package/template/src/lib/modals/ConfrimationModal.tsx +116 -0
  55. package/template/src/lib/modals/DateModal.tsx +152 -0
  56. package/template/src/lib/modals/NormalModal.tsx +73 -0
  57. package/template/src/lib/modals/SideModal.tsx +57 -0
  58. package/template/src/lib/modals/Toaster.tsx +256 -0
  59. package/template/src/lib/payment/PaymentCardForD.tsx +47 -0
  60. package/template/src/lib/progressBar/ProgressBar.tsx +64 -0
  61. package/template/src/lib/tailwind.js +9 -0
  62. package/template/src/lib/ui/Avatar.tsx +55 -0
  63. package/template/src/redux/api-config/baseApi.ts +0 -22
  64. package/template/src/redux/interface/interface.ts +11 -193
  65. package/template/src/redux/store.ts +2 -2
  66. package/template/src/app/home/_layout.tsx +0 -29
  67. package/template/src/app/home/drawer/_layout.tsx +0 -27
  68. package/template/src/app/home/tabs/_layout.tsx +0 -75
  69. package/template/src/app/home/tabs/index.tsx +0 -11
  70. package/template/src/app/modals/payment_modal.tsx +0 -105
  71. package/template/src/hooks/useCheckLocation.ts +0 -36
  72. package/template/src/hooks/useDocPicker.ts +0 -83
  73. package/template/src/hooks/useSuggestionLocation.ts +0 -36
  74. 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
- };