new-react-native-boilerplate 0.0.0-stage → 1.0.1
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/LICENSE +21 -0
- package/README.md +329 -2
- package/package.json +49 -4
- package/run.sh +36 -0
- package/setup.js +141 -0
- package/template/.bundle/config +2 -0
- package/template/.editorconfig +14 -0
- package/template/.eslintrc.js +49 -0
- package/template/.husky/commit-msg +4 -0
- package/template/.husky/pre-commit +1 -0
- package/template/.prettierrc.js +6 -0
- package/template/.watchmanconfig +1 -0
- package/template/Gemfile +17 -0
- package/template/Gemfile.lock +114 -0
- package/template/README.md +101 -0
- package/template/__tests__/App.test.tsx +13 -0
- package/template/__tests__/CustomTextInput.test.jsx +29 -0
- package/template/android/app/build.gradle +119 -0
- package/template/android/app/debug.keystore +0 -0
- package/template/android/app/proguard-rules.pro +10 -0
- package/template/android/app/src/main/AndroidManifest.xml +27 -0
- package/template/android/app/src/main/assets/fonts/Poppins-Bold.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/Poppins-Medium.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/Poppins-Regular.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/futura_book.otf +0 -0
- package/template/android/app/src/main/assets/fonts/futura_medium.otf +0 -0
- package/template/android/app/src/main/java/com/boilerplatereactnative/MainActivity.kt +22 -0
- package/template/android/app/src/main/java/com/boilerplatereactnative/MainApplication.kt +27 -0
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/values/strings.xml +3 -0
- package/template/android/app/src/main/res/values/styles.xml +9 -0
- package/template/android/build.gradle +21 -0
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/android/gradle.properties +49 -0
- package/template/android/gradlew +248 -0
- package/template/android/gradlew.bat +98 -0
- package/template/android/link-assets-manifest.json +29 -0
- package/template/android/settings.gradle +6 -0
- package/template/app.json +4 -0
- package/template/babel.config.js +43 -0
- package/template/eslint.config.mjs +175 -0
- package/template/index.d.ts +1 -0
- package/template/index.js +10 -0
- package/template/ios/.xcode.env +11 -0
- package/template/ios/BoilerPlateReactNative/AppDelegate.swift +11 -0
- package/template/ios/BoilerPlateReactNative/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/template/ios/BoilerPlateReactNative/Images.xcassets/Contents.json +6 -0
- package/template/ios/BoilerPlateReactNative/Info.plist +102 -0
- package/template/ios/BoilerPlateReactNative/LaunchScreen.storyboard +47 -0
- package/template/ios/BoilerPlateReactNative/PrivacyInfo.xcprivacy +37 -0
- package/template/ios/BoilerPlateReactNative/SceneDelegate.swift +54 -0
- package/template/ios/BoilerPlateReactNative.xcodeproj/project.pbxproj +531 -0
- package/template/ios/BoilerPlateReactNative.xcodeproj/xcshareddata/xcschemes/BoilerPlateReactNative.xcscheme +88 -0
- package/template/ios/BoilerPlateReactNative.xcworkspace/contents.xcworkspacedata +10 -0
- package/template/ios/BoilerPlateReactNative.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/template/ios/Podfile +34 -0
- package/template/ios/Podfile.lock +2552 -0
- package/template/ios/link-assets-manifest.json +29 -0
- package/template/jest.config.js +13 -0
- package/template/jest.setup.js +30 -0
- package/template/metro.config.js +15 -0
- package/template/package.json +88 -0
- package/template/plugins/compile-js/_prompts.js +6 -0
- package/template/plugins/compile-js/index.js +9 -0
- package/template/plugins/compile-js/plugin.js +103 -0
- package/template/plugins/compile-js/tsconfig.build.json +20 -0
- package/template/plugins/index.js +46 -0
- package/template/plugins/printSuccess/_prompts.js +1 -0
- package/template/plugins/printSuccess/index.js +9 -0
- package/template/plugins/printSuccess/plugin.js +40 -0
- package/template/react-native.config.js +7 -0
- package/template/src/App.tsx +27 -0
- package/template/src/assets/fonts/Poppins-Bold.ttf +0 -0
- package/template/src/assets/fonts/Poppins-Medium.ttf +0 -0
- package/template/src/assets/fonts/Poppins-Regular.ttf +0 -0
- package/template/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/template/src/assets/fonts/futura_book.otf +0 -0
- package/template/src/assets/fonts/futura_medium.otf +0 -0
- package/template/src/assets/images/check.png +0 -0
- package/template/src/assets/images/check@2x.png +0 -0
- package/template/src/assets/images/check@3x.png +0 -0
- package/template/src/assets/images/email.png +0 -0
- package/template/src/assets/images/email@2x.png +0 -0
- package/template/src/assets/images/email@3x.png +0 -0
- package/template/src/assets/images/icBack.png +0 -0
- package/template/src/assets/images/icBack@2x.png +0 -0
- package/template/src/assets/images/icBack@3x.png +0 -0
- package/template/src/assets/images/icClose.png +0 -0
- package/template/src/assets/images/icClose@2x.png +0 -0
- package/template/src/assets/images/icClose@3x.png +0 -0
- package/template/src/assets/images/icComment.png +0 -0
- package/template/src/assets/images/icComment@2x.png +0 -0
- package/template/src/assets/images/icComment@3x.png +0 -0
- package/template/src/assets/images/icLike.png +0 -0
- package/template/src/assets/images/icLike@2x.png +0 -0
- package/template/src/assets/images/icLike@3x.png +0 -0
- package/template/src/assets/images/icSearch.png +0 -0
- package/template/src/assets/images/icSearch@2x.png +0 -0
- package/template/src/assets/images/icSearch@3x.png +0 -0
- package/template/src/assets/images/icSetting.png +0 -0
- package/template/src/assets/images/icSetting@2x.png +0 -0
- package/template/src/assets/images/icSetting@3x.png +0 -0
- package/template/src/assets/images/icShare.png +0 -0
- package/template/src/assets/images/icShare@2x.png +0 -0
- package/template/src/assets/images/icShare@3x.png +0 -0
- package/template/src/assets/images/line.png +0 -0
- package/template/src/assets/images/line@2x.png +0 -0
- package/template/src/assets/images/line@3x.png +0 -0
- package/template/src/assets/images/lock.png +0 -0
- package/template/src/assets/images/lock@2x.png +0 -0
- package/template/src/assets/images/lock@3x.png +0 -0
- package/template/src/assets/images/notification.png +0 -0
- package/template/src/assets/images/notification@2x.png +0 -0
- package/template/src/assets/images/notification@3x.png +0 -0
- package/template/src/assets/images/oct_dark.png +0 -0
- package/template/src/assets/images/oct_light.png +0 -0
- package/template/src/assets/images/onboard.png +0 -0
- package/template/src/assets/images/password_hide.png +0 -0
- package/template/src/assets/images/password_hide@2x.png +0 -0
- package/template/src/assets/images/password_hide@3x.png +0 -0
- package/template/src/assets/images/password_show.png +0 -0
- package/template/src/assets/images/password_show@2x.png +0 -0
- package/template/src/assets/images/password_show@3x.png +0 -0
- package/template/src/assets/images/right_arrow.png +0 -0
- package/template/src/assets/images/right_arrow@2x.png +0 -0
- package/template/src/assets/images/right_arrow@3x.png +0 -0
- package/template/src/assets/images/star.png +0 -0
- package/template/src/assets/images/star@2x.png +0 -0
- package/template/src/assets/images/star@3x.png +0 -0
- package/template/src/assets/images/uncheck.png +0 -0
- package/template/src/assets/images/uncheck@2x.png +0 -0
- package/template/src/assets/images/uncheck@3x.png +0 -0
- package/template/src/assets/images/user.png +0 -0
- package/template/src/assets/images/user@2x.png +0 -0
- package/template/src/assets/images/user@3x.png +0 -0
- package/template/src/components/atoms/ButtonContainer.tsx +52 -0
- package/template/src/components/atoms/ImageContainer.tsx +10 -0
- package/template/src/components/atoms/RemoteImage.tsx +8 -0
- package/template/src/components/atoms/RoundImageBorder.tsx +35 -0
- package/template/src/components/atoms/TextContainer.tsx +38 -0
- package/template/src/components/atoms/WrapperContainer.tsx +43 -0
- package/template/src/components/atoms/index.ts +6 -0
- package/template/src/components/molecules/AuthHeader.tsx +55 -0
- package/template/src/components/molecules/CustomTextInput.tsx +102 -0
- package/template/src/components/molecules/EmptyComp.tsx +16 -0
- package/template/src/components/molecules/ErrorComp.tsx +25 -0
- package/template/src/components/molecules/FooterView.tsx +41 -0
- package/template/src/components/molecules/HeaderComp.tsx +51 -0
- package/template/src/components/molecules/HomeHeader.tsx +63 -0
- package/template/src/components/molecules/HomeListHeader.tsx +48 -0
- package/template/src/components/molecules/HomeListItems.tsx +86 -0
- package/template/src/components/molecules/Loader.tsx +25 -0
- package/template/src/components/molecules/ModalSheet.tsx +146 -0
- package/template/src/components/molecules/RememberMe.tsx +58 -0
- package/template/src/components/molecules/SearchBar.tsx +46 -0
- package/template/src/components/molecules/index.ts +12 -0
- package/template/src/constants/apiConstant.ts +12 -0
- package/template/src/constants/fontFamily.ts +8 -0
- package/template/src/constants/imagePath.ts +25 -0
- package/template/src/constants/index.ts +3 -0
- package/template/src/constants/storageKeys.ts +5 -0
- package/template/src/models/ApiErrorResponse.ts +19 -0
- package/template/src/models/HomeData.ts +17 -0
- package/template/src/models/User.ts +11 -0
- package/template/src/navigations/AuthStack.tsx +20 -0
- package/template/src/navigations/MainStack.tsx +19 -0
- package/template/src/navigations/Routes.tsx +22 -0
- package/template/src/navigations/navigationProps.ts +8 -0
- package/template/src/redux/hooks.ts +10 -0
- package/template/src/redux/reducers/auth.ts +43 -0
- package/template/src/redux/reducers/common.ts +24 -0
- package/template/src/redux/reducers/index.ts +31 -0
- package/template/src/redux/reducers/product.ts +37 -0
- package/template/src/redux/reducers/settings.ts +55 -0
- package/template/src/redux/store.ts +19 -0
- package/template/src/redux/types.ts +6 -0
- package/template/src/screens/Home/Home.tsx +65 -0
- package/template/src/screens/Login/Login.tsx +35 -0
- package/template/src/screens/Login/components/LoginForm.tsx +88 -0
- package/template/src/screens/Login/hooks/useLogin.ts +38 -0
- package/template/src/screens/Login/styles.ts +17 -0
- package/template/src/screens/Login/types.ts +10 -0
- package/template/src/screens/Onboarding/Onboarding.tsx +87 -0
- package/template/src/screens/Onboarding/styles.ts +25 -0
- package/template/src/screens/PostDetails/PostDetails.tsx +168 -0
- package/template/src/screens/PostDetails/styles.ts +82 -0
- package/template/src/screens/Signup/Signup.tsx +32 -0
- package/template/src/screens/Signup/components/SignupForm.tsx +113 -0
- package/template/src/screens/Signup/hooks/useSignup.ts +38 -0
- package/template/src/screens/Signup/styles.ts +18 -0
- package/template/src/screens/Signup/type.ts +12 -0
- package/template/src/screens/index.ts +5 -0
- package/template/src/services/apiService.ts +144 -0
- package/template/src/services/authService.ts +79 -0
- package/template/src/services/productService.ts +45 -0
- package/template/src/services/statusHandler.ts +17 -0
- package/template/src/styles/breakpoints.ts +11 -0
- package/template/src/styles/themes.ts +45 -0
- package/template/src/styles/unistyles.ts +25 -0
- package/template/src/translations/ar.json +47 -0
- package/template/src/translations/en.json +47 -0
- package/template/src/translations/fr.json +47 -0
- package/template/src/translations/index.ts +32 -0
- package/template/src/typings/env.d.ts +5 -0
- package/template/src/typings/global.d.ts +3 -0
- package/template/src/utils/handleLocalStorage.ts +31 -0
- package/template/src/utils/i18nHelpers.ts +20 -0
- package/template/src/utils/index.ts +66 -0
- package/template/src/utils/scaling.ts +13 -0
- package/template/src/utils/themeHelpers.ts +10 -0
- package/template/src/utils/validationForm.ts +23 -0
- package/template/src/utils/validations.ts +69 -0
- package/template/tsconfig.json +22 -0
- package/template/yarn.lock +7728 -0
- package/template.config.js +6 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"LOG_IN_TO_YOUR_ACCOUNT": "تسجيل الدخول إلى حسابك",
|
|
3
|
+
"WELCOME_BACK_PLEASE_ENTER_YOUR_DETAILS": "مرحبًا بعودتك! ",
|
|
4
|
+
"EMAIL": "بريد إلكتروني",
|
|
5
|
+
"ENTER_YOUR_EMAIL": "أدخل بريدك الإلكتروني",
|
|
6
|
+
"PASSWORD": "كلمة المرور",
|
|
7
|
+
"ENTER_YOUR_PASSWORD": "ادخل رقمك السري",
|
|
8
|
+
"REMEBER_ME": "تذكرنى",
|
|
9
|
+
"FORGOT_PASSWORD": "هل نسيت كلمة السر؟",
|
|
10
|
+
"LOG_IN": "تسجيل الدخول",
|
|
11
|
+
"CREATE_AN_ACCOUNT": "إنشاء حساب",
|
|
12
|
+
"WELCOME_PLEASE_ENTER_YOUR_DETAILS": "مرحباً ! ",
|
|
13
|
+
"NAME": "اسم",
|
|
14
|
+
"ENTER_YOUR_NAME": "أدخل أسمك",
|
|
15
|
+
"DONT_HAVE_ACCOUNT": "ليس لديك حساب؟",
|
|
16
|
+
"ALREADY_HAVE_ACCOUNT": "هل لديك حساب بالفعل؟",
|
|
17
|
+
"LOGIN": "تسجيل الدخول",
|
|
18
|
+
"SIGNUP": "اشتراك",
|
|
19
|
+
"ALREADY_HAVE_AN_ACCOUNT": "هل لديك حساب؟",
|
|
20
|
+
"CHECK_YOUR_EMAIL": "تحقق من بريدك الالكتروني",
|
|
21
|
+
"WE_CAN_A_VERIFICATION_LIKE_TO": "يمكننا التحقق مثل ذلك",
|
|
22
|
+
"VERIFY_EMAIL": "التحقق من البريد الإلكتروني",
|
|
23
|
+
"DIDNT_RECEIVE_EMAIL": "لم تتلق البريد الإلكتروني؟",
|
|
24
|
+
"RESEND_NOW": "إعادة إرسال الآن",
|
|
25
|
+
"CHANGE_THEME": "غير الخلفية",
|
|
26
|
+
"CHANGE_LANGUAGE": "تغيير اللغة",
|
|
27
|
+
"LOGOUT": "تسجيل خروج",
|
|
28
|
+
"SKIP": "يتخطى",
|
|
29
|
+
"SOMETHING_WENT_WRONG": "أُووبس...!!! ",
|
|
30
|
+
"NAME_EMPTY": "لا يمكن أن يكون الاسم فارغًا",
|
|
31
|
+
"EMAIL_EMPTY": "لا يمكن أن يكون البريد الإلكتروني فارغاً",
|
|
32
|
+
"VALID_EMAIL": "أدخل بريدًا إلكترونيًا صالحًا",
|
|
33
|
+
"PASSWORD_EMPTY": "لا يمكن أن تكون كلمة المرور فارغة",
|
|
34
|
+
"SEE_MORE": "شاهد المزيد",
|
|
35
|
+
"RECOMMEND": "يوصي",
|
|
36
|
+
"BLOGS_POT": "مدونة",
|
|
37
|
+
"FIND_INTERESTING_BLOG": "ابحث عن مدونة مثيرة للاهتمام",
|
|
38
|
+
"FOLLOW_US": "تابعنا",
|
|
39
|
+
"FOLLOW": "يتبع",
|
|
40
|
+
"ADD_COMMENTS": "أضف تعليقات",
|
|
41
|
+
"COMMENTS": "تعليقات",
|
|
42
|
+
"USERNAME": "اسم المستخدم",
|
|
43
|
+
"USERNAME_EMPTY": "لا يمكن أن يكون اسم المستخدم فارغًا",
|
|
44
|
+
"ENTER_YOUR_USERNAME":"أدخل اسم المستخدم الخاص بك",
|
|
45
|
+
"INVALID_USERNAME": "اسم المستخدم غير صالح",
|
|
46
|
+
"INVALID_PASSWORD": "يجب أن تحتوي كلمة المرور على رقم واحد على الأقل، وحرف واحد على الأقل، و6 أحرف على الأقل"
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"LOG_IN_TO_YOUR_ACCOUNT":"Log in to your account",
|
|
3
|
+
"WELCOME_BACK_PLEASE_ENTER_YOUR_DETAILS":"Welcome back! Please enter your details",
|
|
4
|
+
"EMAIL":"Email",
|
|
5
|
+
"ENTER_YOUR_EMAIL":"Enter your email",
|
|
6
|
+
"PASSWORD":"Password",
|
|
7
|
+
"ENTER_YOUR_PASSWORD":"Enter your password",
|
|
8
|
+
"REMEBER_ME":"Remember me",
|
|
9
|
+
"FORGOT_PASSWORD":"Forgot password?",
|
|
10
|
+
"LOG_IN":"Log In",
|
|
11
|
+
"CREATE_AN_ACCOUNT":"Create an account",
|
|
12
|
+
"WELCOME_PLEASE_ENTER_YOUR_DETAILS":"Welcome ! Please enter your details",
|
|
13
|
+
"NAME":"Name",
|
|
14
|
+
"ENTER_YOUR_NAME":"Enter your name",
|
|
15
|
+
"DONT_HAVE_ACCOUNT":"Don't have an account?",
|
|
16
|
+
"ALREADY_HAVE_ACCOUNT": "Already have an account?",
|
|
17
|
+
"LOGIN": "Login",
|
|
18
|
+
"SIGNUP":"Sign up",
|
|
19
|
+
"ALREADY_HAVE_AN_ACCOUNT":"Already have an account?",
|
|
20
|
+
"CHECK_YOUR_EMAIL":"Check your email",
|
|
21
|
+
"WE_CAN_A_VERIFICATION_LIKE_TO":"We can a verification like to",
|
|
22
|
+
"VERIFY_EMAIL":"Verify email",
|
|
23
|
+
"DIDNT_RECEIVE_EMAIL":"Didn't receive email?",
|
|
24
|
+
"RESEND_NOW":"Resend now",
|
|
25
|
+
"CHANGE_THEME":"Change Theme",
|
|
26
|
+
"CHANGE_LANGUAGE":"Change Language",
|
|
27
|
+
"LOGOUT": "Logout",
|
|
28
|
+
"SKIP":"Skip",
|
|
29
|
+
"SOMETHING_WENT_WRONG":"Oops...!!! Something Wen't Wrong",
|
|
30
|
+
"NAME_EMPTY": "Name can not be empty",
|
|
31
|
+
"EMAIL_EMPTY": "Email can not be empty",
|
|
32
|
+
"VALID_EMAIL": "Enter valid email",
|
|
33
|
+
"PASSWORD_EMPTY": "Password can not be empty",
|
|
34
|
+
"SEE_MORE": "See more",
|
|
35
|
+
"RECOMMEND": "Recommend",
|
|
36
|
+
"BLOGS_POT": "Blogs pot",
|
|
37
|
+
"FIND_INTERESTING_BLOG": "Find an interesting blog",
|
|
38
|
+
"FOLLOW_US": "Follow us",
|
|
39
|
+
"FOLLOW": "Follow",
|
|
40
|
+
"ADD_COMMENTS": "Add comments",
|
|
41
|
+
"COMMENTS": "Comments",
|
|
42
|
+
"USERNAME": "Username",
|
|
43
|
+
"USERNAME_EMPTY": "Username can not be empty",
|
|
44
|
+
"ENTER_YOUR_USERNAME":"Enter your username",
|
|
45
|
+
"INVALID_USERNAME":"Invalid username",
|
|
46
|
+
"INVALID_PASSWORD":"Password must contain at least one number, at least one letter, minimum 6 character"
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"LOG_IN_TO_YOUR_ACCOUNT": "Connectez-vous à votre compte",
|
|
3
|
+
"WELCOME_BACK_PLEASE_ENTER_YOUR_DETAILS": "Content de te revoir! ",
|
|
4
|
+
"EMAIL": "E-mail",
|
|
5
|
+
"ENTER_YOUR_EMAIL": "Entrer votre Email",
|
|
6
|
+
"PASSWORD": "Mot de passe",
|
|
7
|
+
"ENTER_YOUR_PASSWORD": "Tapez votre mot de passe",
|
|
8
|
+
"REMEBER_ME": "Souviens-toi de moi",
|
|
9
|
+
"FORGOT_PASSWORD": "Mot de passe oublié?",
|
|
10
|
+
"LOG_IN": "Se connecter",
|
|
11
|
+
"CREATE_AN_ACCOUNT": "Créer un compte",
|
|
12
|
+
"WELCOME_PLEASE_ENTER_YOUR_DETAILS": "Accueillir ! ",
|
|
13
|
+
"NAME": "Nom",
|
|
14
|
+
"ENTER_YOUR_NAME": "Entrez votre nom",
|
|
15
|
+
"DONT_HAVE_ACCOUNT": "Vous n'avez pas de compte ?",
|
|
16
|
+
"ALREADY_HAVE_ACCOUNT": "Vous avez déjà un compte ?",
|
|
17
|
+
"LOGIN": "Se connecter",
|
|
18
|
+
"SIGNUP": "S'inscrire",
|
|
19
|
+
"ALREADY_HAVE_AN_ACCOUNT": "Vous avez déjà un compte?",
|
|
20
|
+
"CHECK_YOUR_EMAIL": "Vérifiez votre courrier électronique",
|
|
21
|
+
"WE_CAN_A_VERIFICATION_LIKE_TO": "Nous pouvons effectuer une vérification comme",
|
|
22
|
+
"VERIFY_EMAIL": "Vérifier les courriels",
|
|
23
|
+
"DIDNT_RECEIVE_EMAIL": "Vous n'avez pas reçu d'e-mail ?",
|
|
24
|
+
"RESEND_NOW": "Renvoyer maintenant",
|
|
25
|
+
"CHANGE_THEME": "Change le thème",
|
|
26
|
+
"CHANGE_LANGUAGE": "Changer de langue",
|
|
27
|
+
"LOGOUT": "Se déconnecter",
|
|
28
|
+
"SKIP": "Sauter",
|
|
29
|
+
"SOMETHING_WENT_WRONG":"Oops...!!! Quelque chose n'allait pas mal",
|
|
30
|
+
"NAME_EMPTY": "Le nom ne peut pas être vide",
|
|
31
|
+
"EMAIL_EMPTY": "L'e-mail ne peut pas être vide",
|
|
32
|
+
"VALID_EMAIL": "Entrez une adresse e-mail valide",
|
|
33
|
+
"PASSWORD_EMPTY": "Le mot de passe ne peut pas être vide",
|
|
34
|
+
"SEE_MORE": "Voir plus",
|
|
35
|
+
"RECOMMEND": "Recommander",
|
|
36
|
+
"BLOGS_POT": "Blog",
|
|
37
|
+
"FIND_INTERESTING_BLOG": "Trouver un blog intéressant",
|
|
38
|
+
"FOLLOW_US": "Suivez-nous",
|
|
39
|
+
"FOLLOW": "Suivre",
|
|
40
|
+
"ADD_COMMENTS": "Ajouter des commentaires",
|
|
41
|
+
"COMMENTS": "Commentaires",
|
|
42
|
+
"USERNAME": "nom d'utilisateur",
|
|
43
|
+
"USERNAME_EMPTY": "Le nom d'utilisateur ne peut pas être vide",
|
|
44
|
+
"ENTER_YOUR_USERNAME":"Entrez votre nom d'utilisateur",
|
|
45
|
+
"INVALID_USERNAME":"Nom d'utilisateur invalide",
|
|
46
|
+
"INVALID_PASSWORD":"Le mot de passe doit contenir au moins un chiffre, au moins une lettre, minimum 6 caractères"
|
|
47
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import i18n from "i18next";
|
|
2
|
+
import { initReactI18next } from "react-i18next";
|
|
3
|
+
import RNLanguageDetector from "@os-team/i18next-react-native-language-detector";
|
|
4
|
+
|
|
5
|
+
import enTranslation from "./en.json";
|
|
6
|
+
import arTranslation from "./ar.json";
|
|
7
|
+
import frTranslation from "./fr.json";
|
|
8
|
+
import { I18nManager } from "react-native";
|
|
9
|
+
|
|
10
|
+
i18n
|
|
11
|
+
.use(RNLanguageDetector)
|
|
12
|
+
.use(initReactI18next)
|
|
13
|
+
.init({
|
|
14
|
+
debug: true,
|
|
15
|
+
fallbackLng: "en",
|
|
16
|
+
interpolation: {
|
|
17
|
+
escapeValue: false, // react already safes from xss
|
|
18
|
+
},
|
|
19
|
+
lng: I18nManager.isRTL ? 'ar' : 'en', // Set language based on RTL
|
|
20
|
+
resources: {
|
|
21
|
+
ar: {
|
|
22
|
+
translation: arTranslation,
|
|
23
|
+
},
|
|
24
|
+
en: {
|
|
25
|
+
translation: enTranslation,
|
|
26
|
+
},
|
|
27
|
+
fr: {
|
|
28
|
+
translation: frTranslation,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
supportedLngs: ["en", "fr", "ar"],
|
|
32
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import storageKeys from "@constants/storageKeys";
|
|
2
|
+
import { saveUserData } from "@redux/reducers/auth";
|
|
3
|
+
import { saveDefaultLanguage, saveDefaultTheme } from "@redux/reducers/settings";
|
|
4
|
+
import type { LanguageInterface, ThemeInterface } from "@redux/reducers/settings";
|
|
5
|
+
import store from "@redux/store";
|
|
6
|
+
import i18n from "i18next";
|
|
7
|
+
import { UnistylesRuntime } from "react-native-unistyles";
|
|
8
|
+
import { getItem } from "src/services/apiService";
|
|
9
|
+
|
|
10
|
+
const { dispatch } = store;
|
|
11
|
+
const checkLocalStorage = () => {
|
|
12
|
+
// get user Data
|
|
13
|
+
const userData = getItem(storageKeys.USER_DATA);
|
|
14
|
+
if (userData) {
|
|
15
|
+
dispatch(saveUserData(userData));
|
|
16
|
+
}
|
|
17
|
+
// get default theme
|
|
18
|
+
const defaultTheme = getItem<ThemeInterface>(storageKeys.DEFAULT_THEME);
|
|
19
|
+
if (defaultTheme) {
|
|
20
|
+
UnistylesRuntime.setTheme(defaultTheme.myTheme);
|
|
21
|
+
dispatch(saveDefaultTheme(defaultTheme));
|
|
22
|
+
}
|
|
23
|
+
// get default language
|
|
24
|
+
const defaultLanguage = getItem<LanguageInterface>(storageKeys.DEFAULT_LANGUAGE);
|
|
25
|
+
if (defaultLanguage) {
|
|
26
|
+
i18n.changeLanguage(defaultLanguage.sortName);
|
|
27
|
+
dispatch(saveDefaultLanguage(defaultLanguage));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default checkLocalStorage;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import storageKeys from "@constants/storageKeys";
|
|
2
|
+
import type { LanguageInterface } from "@redux/reducers/settings";
|
|
3
|
+
import i18n from "i18next";
|
|
4
|
+
import { I18nManager } from "react-native";
|
|
5
|
+
import RNRestart from "react-native-restart";
|
|
6
|
+
import { setItem } from "src/services/apiService";
|
|
7
|
+
|
|
8
|
+
const changeLanguage = (lng: LanguageInterface) => {
|
|
9
|
+
if (i18n.language === lng.sortName) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
setItem(storageKeys.DEFAULT_LANGUAGE, lng);
|
|
13
|
+
i18n.changeLanguage(lng.sortName);
|
|
14
|
+
const isArabic = lng.sortName === "ar";
|
|
15
|
+
I18nManager.allowRTL(isArabic);
|
|
16
|
+
I18nManager.forceRTL(isArabic);
|
|
17
|
+
RNRestart.restart();
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default changeLanguage;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Alert } from "react-native";
|
|
2
|
+
|
|
3
|
+
export const alertFunction = (title: string, message: string, showCancel: boolean = false, onOkPress: () => void = () => {}, onCancelPress: () => void = () => {}) => {
|
|
4
|
+
const alertOptions: { onPress: () => void; style?: 'cancel' | 'default' | 'destructive'; text: string; }[] = [{onPress: onOkPress, text: 'OK'}];
|
|
5
|
+
if(showCancel){
|
|
6
|
+
alertOptions.unshift({
|
|
7
|
+
onPress: onCancelPress,
|
|
8
|
+
style: 'cancel',
|
|
9
|
+
text: 'Cancel',
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
Alert.alert(
|
|
13
|
+
title,
|
|
14
|
+
message,
|
|
15
|
+
alertOptions,
|
|
16
|
+
{cancelable: !showCancel},
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const customAtob = (base64: string) => {
|
|
22
|
+
const base64Chars =
|
|
23
|
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
24
|
+
let result = "";
|
|
25
|
+
let bits = 0,
|
|
26
|
+
buffer = 0,
|
|
27
|
+
pad = 0;
|
|
28
|
+
|
|
29
|
+
for (let i = 0; i < base64.length; i++) {
|
|
30
|
+
const char = base64[i];
|
|
31
|
+
|
|
32
|
+
if (char === "=") {
|
|
33
|
+
pad++;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const index = base64Chars.indexOf(char);
|
|
38
|
+
|
|
39
|
+
if (index === -1) {
|
|
40
|
+
throw new Error("Invalid base64 character");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
buffer = (buffer << 6) | index;
|
|
44
|
+
bits += 6;
|
|
45
|
+
|
|
46
|
+
if (bits >= 8) {
|
|
47
|
+
bits -= 8;
|
|
48
|
+
const byte = (buffer >> bits) & 0xff;
|
|
49
|
+
result += String.fromCharCode(byte);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (pad > 2) {
|
|
54
|
+
throw new Error("Invalid padding in base64 string");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const isTokenExpired = (token: null | string) => {
|
|
61
|
+
if (!token) {
|
|
62
|
+
throw new Error("Token is null or undefined");
|
|
63
|
+
}
|
|
64
|
+
const expiry = JSON.parse(customAtob(token.split(".")[1])).exp;
|
|
65
|
+
return Math.floor(new Date().getTime() / 1000) >= expiry;
|
|
66
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UnistylesRuntime } from "react-native-unistyles";
|
|
2
|
+
|
|
3
|
+
export const { height, width } = UnistylesRuntime.screen;
|
|
4
|
+
|
|
5
|
+
// Guideline sizes are based on standard ~5" screen mobile device
|
|
6
|
+
const guidelineBaseWidth = 350;
|
|
7
|
+
const guidelineBaseHeight = 680;
|
|
8
|
+
|
|
9
|
+
const scale = (size: number) => (width / guidelineBaseWidth) * size;
|
|
10
|
+
const verticalScale = (size: number) => (height / guidelineBaseHeight) * size;
|
|
11
|
+
const moderateScale = (size: number, factor = 0.5) => size + (scale(size) - size) * factor;
|
|
12
|
+
|
|
13
|
+
export { moderateScale, scale, verticalScale };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import storageKeys from "@constants/storageKeys";
|
|
2
|
+
import type { UnistylesThemes } from "react-native-unistyles";
|
|
3
|
+
import { UnistylesRuntime } from "react-native-unistyles";
|
|
4
|
+
import { setItem } from "src/services/apiService";
|
|
5
|
+
|
|
6
|
+
const changeTheme = (mode: keyof UnistylesThemes) => {
|
|
7
|
+
setItem(storageKeys.DEFAULT_THEME, { myTheme: mode });
|
|
8
|
+
UnistylesRuntime.setTheme(mode);
|
|
9
|
+
};
|
|
10
|
+
export default changeTheme;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Yup from 'yup';
|
|
2
|
+
|
|
3
|
+
const usernameRegEx : RegExp = /^[\dA-Za-z]{6,16}$/
|
|
4
|
+
const passwordRegEx : RegExp = /^(?=.*?\d)(?=.*?[A-Za-z]).{6,32}$/
|
|
5
|
+
|
|
6
|
+
const validationForm = {
|
|
7
|
+
login: Yup.object({
|
|
8
|
+
password: Yup.string().required('PASSWORD_EMPTY').trim(),
|
|
9
|
+
username: Yup.string()
|
|
10
|
+
.required('USERNAME_EMPTY').matches(usernameRegEx, 'INVALID_USERNAME')
|
|
11
|
+
.trim(),
|
|
12
|
+
}),
|
|
13
|
+
signup: Yup.object({
|
|
14
|
+
email: Yup.string()
|
|
15
|
+
.required('EMAIL_EMPTY')
|
|
16
|
+
.email('VALID_EMAIL')
|
|
17
|
+
.trim(),
|
|
18
|
+
name: Yup.string().required('NAME_EMPTY'),
|
|
19
|
+
password: Yup.string().required('PASSWORD_EMPTY').matches(passwordRegEx, 'INVALID_PASSWORD').trim(),
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default validationForm;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
const emptyRegex: RegExp = /^$/;
|
|
4
|
+
const emailRegex: RegExp = /^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/;
|
|
5
|
+
|
|
6
|
+
const validator = {
|
|
7
|
+
email: (val: string): boolean => {
|
|
8
|
+
return emailRegex.test(val.trim());
|
|
9
|
+
},
|
|
10
|
+
empty: (val: string): boolean => {
|
|
11
|
+
return emptyRegex.test(val.trim());
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const checkEmpty = (val: string, key: string): string => {
|
|
16
|
+
if (validator.empty(val)) {
|
|
17
|
+
return `Please enter ${key}`;
|
|
18
|
+
}
|
|
19
|
+
return '';
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const checkMinLength = (val: string, minLength: number, key: string): string => {
|
|
23
|
+
if (val.trim().length < minLength) {
|
|
24
|
+
return `Please enter valid ${key}`;
|
|
25
|
+
}
|
|
26
|
+
return '';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default function validate(data: { [key: string]: string }): boolean | string {
|
|
30
|
+
const {
|
|
31
|
+
email,
|
|
32
|
+
name,
|
|
33
|
+
otp,
|
|
34
|
+
password
|
|
35
|
+
} = data;
|
|
36
|
+
|
|
37
|
+
if (name !== undefined) {
|
|
38
|
+
const emptyValidationText = checkEmpty(name, "User name");
|
|
39
|
+
if (emptyValidationText) { return emptyValidationText };
|
|
40
|
+
|
|
41
|
+
const minLengthValidation = checkMinLength(name, 3, "User name");
|
|
42
|
+
if (minLengthValidation) { return minLengthValidation };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (email !== undefined) {
|
|
46
|
+
const emptyValidationText = checkEmpty(email, "email");
|
|
47
|
+
if (emptyValidationText) { return emptyValidationText };
|
|
48
|
+
|
|
49
|
+
if (!validator.email(email)) { return "Please enter valid email" };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (password !== undefined) {
|
|
53
|
+
const emptyValidationText = checkEmpty(password, "password");
|
|
54
|
+
if (emptyValidationText) { return emptyValidationText };
|
|
55
|
+
|
|
56
|
+
const minLengthValidation = checkMinLength(password, 6, "password");
|
|
57
|
+
if (minLengthValidation) { return minLengthValidation };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (otp !== undefined) {
|
|
61
|
+
const emptyValidationText = checkEmpty(otp, "Otp");
|
|
62
|
+
if (emptyValidationText) { return emptyValidationText };
|
|
63
|
+
|
|
64
|
+
const minLengthValidation = checkMinLength(otp, 4, "Otp");
|
|
65
|
+
if (minLengthValidation) { return minLengthValidation }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@react-native/typescript-config",
|
|
3
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
4
|
+
"exclude": ["**/node_modules", "**/Pods"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"jsx": "react",
|
|
7
|
+
"paths": {
|
|
8
|
+
"@api/*": ["./src/api/*"],
|
|
9
|
+
"@assets/*": ["./src/assets/*"],
|
|
10
|
+
"@components/*": ["./src/components/*"],
|
|
11
|
+
"@screens/*": ["./src/screens/*"],
|
|
12
|
+
"@utils/*": ["./src/utils/*"],
|
|
13
|
+
"@constants/*": ["./src/constants/*"],
|
|
14
|
+
"@typings/*": ["./src/typings/*"],
|
|
15
|
+
"@redux/*": ["./src/redux/*"],
|
|
16
|
+
"@navigations/*": ["./src/navigations/*"],
|
|
17
|
+
"@hooks/*": ["./src/hooks/*"],
|
|
18
|
+
"@models/*": ["./src/models/*"],
|
|
19
|
+
"src/*": ["./src/*"]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|