create-du-app 0.1.3 ā 0.1.5
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 +15 -9
- package/package.json +6 -5
- package/src/generate.js +15 -2
- package/src/index.js +15 -9
- package/src/prompts.js +1 -1
- package/templates/mobile/expo/.env.example +5 -0
- package/templates/mobile/expo/.eslintrc.js +7 -0
- package/templates/mobile/expo/.prettierrc.js +7 -0
- package/templates/mobile/expo/.svgrrc.js +9 -0
- package/templates/mobile/expo/README.md +70 -7
- package/templates/mobile/expo/_gitignore +20 -0
- package/templates/mobile/expo/_package.json +60 -1
- package/templates/mobile/expo/app.json +26 -0
- package/templates/mobile/expo/babel.config.js +21 -0
- package/templates/mobile/expo/index.js +7 -0
- package/templates/mobile/expo/metro.config.js +31 -0
- package/templates/mobile/expo/src/app/App.tsx +24 -0
- package/templates/mobile/expo/src/app/app-provider.tsx +40 -0
- package/templates/mobile/expo/src/app/config/translation.ts +30 -0
- package/templates/mobile/expo/src/app/index.ts +1 -0
- package/templates/mobile/expo/src/app/navigation/app-route-type.ts +27 -0
- package/templates/mobile/expo/src/app/navigation/bottom-tabs.tsx +34 -0
- package/templates/mobile/expo/src/app/navigation/index.tsx +14 -0
- package/templates/mobile/expo/src/app/stores/auth.store.ts +33 -0
- package/templates/mobile/expo/src/app/stores/common.store.ts +19 -0
- package/templates/mobile/expo/src/app/stores/index.ts +3 -0
- package/templates/mobile/expo/src/app/stores/loading.store.ts +22 -0
- package/templates/mobile/expo/src/assets/Images/empty-list.png +0 -0
- package/templates/mobile/expo/src/assets/Images/index.ts +5 -0
- package/templates/mobile/expo/src/assets/Images/screen-bg-gradian.png +0 -0
- package/templates/mobile/expo/src/assets/i18n/en.json +28 -0
- package/templates/mobile/expo/src/assets/i18n/fr.json +28 -0
- package/templates/mobile/expo/src/assets/lotties/index.ts +3 -0
- package/templates/mobile/expo/src/assets/lotties/loading.json +1 -0
- package/templates/mobile/expo/src/assets/svgs/arrow-left.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/arrow-right.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/calendar.svg +12 -0
- package/templates/mobile/expo/src/assets/svgs/check.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/close.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/eye-hide.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/eye.svg +4 -0
- package/templates/mobile/expo/src/assets/svgs/index.ts +29 -0
- package/templates/mobile/expo/src/assets/svgs/minus.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/plus.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/search.svg +3 -0
- package/templates/mobile/expo/src/assets/svgs/toast-error.svg +5 -0
- package/templates/mobile/expo/src/assets/svgs/toast-success.svg +4 -0
- package/templates/mobile/expo/src/core/api/endpoints.ts +8 -0
- package/templates/mobile/expo/src/core/api/example.api.ts +53 -0
- package/templates/mobile/expo/src/core/api/index.ts +4 -0
- package/templates/mobile/expo/src/core/components/common/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/common/list-empty/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/common/list-empty/list-empty.tsx +30 -0
- package/templates/mobile/expo/src/core/components/common/list-empty/list-empty.type.ts +5 -0
- package/templates/mobile/expo/src/core/components/forms/date-time-picker.modal.tsx +116 -0
- package/templates/mobile/expo/src/core/components/forms/hf-date-time.tsx +293 -0
- package/templates/mobile/expo/src/core/components/forms/hf-password-input.tsx +153 -0
- package/templates/mobile/expo/src/core/components/forms/hf-text-input.tsx +59 -0
- package/templates/mobile/expo/src/core/components/forms/hf-time-picker.tsx +116 -0
- package/templates/mobile/expo/src/core/components/forms/index.ts +4 -0
- package/templates/mobile/expo/src/core/components/index.ts +5 -0
- package/templates/mobile/expo/src/core/components/loading/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/loading/loading-app/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/loading/loading-app/loading-app.tsx +50 -0
- package/templates/mobile/expo/src/core/components/offline/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/offline/offline-banner.tsx +186 -0
- package/templates/mobile/expo/src/core/components/screen/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/screen/screen-container/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/screen/screen-container/screen-container.tsx +248 -0
- package/templates/mobile/expo/src/core/components/splash/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/splash/splash-overlay/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/splash/splash-overlay/splash-overlay.tsx +93 -0
- package/templates/mobile/expo/src/core/components/ui/animated-list-item/animated-list-item.tsx +48 -0
- package/templates/mobile/expo/src/core/components/ui/animated-list-item/animated-list-item.type.ts +10 -0
- package/templates/mobile/expo/src/core/components/ui/animated-list-item/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/app-image/app-image.tsx +101 -0
- package/templates/mobile/expo/src/core/components/ui/app-image/app-image.type.ts +19 -0
- package/templates/mobile/expo/src/core/components/ui/app-image/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/asset-placeholder/asset-placeholder.tsx +76 -0
- package/templates/mobile/expo/src/core/components/ui/asset-placeholder/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/ui/avatar-image/avatar-image.tsx +90 -0
- package/templates/mobile/expo/src/core/components/ui/avatar-image/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/ui/bottom-sheet/bottom-sheet.tsx +145 -0
- package/templates/mobile/expo/src/core/components/ui/bottom-sheet/bottom-sheet.type.ts +10 -0
- package/templates/mobile/expo/src/core/components/ui/bottom-sheet/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/button/button.style.ts +146 -0
- package/templates/mobile/expo/src/core/components/ui/button/button.tsx +97 -0
- package/templates/mobile/expo/src/core/components/ui/button/button.type.ts +47 -0
- package/templates/mobile/expo/src/core/components/ui/button/index.ts +4 -0
- package/templates/mobile/expo/src/core/components/ui/checkbox/checkbox.tsx +127 -0
- package/templates/mobile/expo/src/core/components/ui/checkbox/checkbox.type.ts +24 -0
- package/templates/mobile/expo/src/core/components/ui/checkbox/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/collapsible-section/collapsible-section.tsx +141 -0
- package/templates/mobile/expo/src/core/components/ui/collapsible-section/collapsible-section.type.ts +10 -0
- package/templates/mobile/expo/src/core/components/ui/collapsible-section/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/components.registry.json +313 -0
- package/templates/mobile/expo/src/core/components/ui/field/field-frame.tsx +62 -0
- package/templates/mobile/expo/src/core/components/ui/field/field.shared.ts +31 -0
- package/templates/mobile/expo/src/core/components/ui/header/header.tsx +196 -0
- package/templates/mobile/expo/src/core/components/ui/header/header.type.ts +30 -0
- package/templates/mobile/expo/src/core/components/ui/header/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/icon-button/icon-button.style.ts +23 -0
- package/templates/mobile/expo/src/core/components/ui/icon-button/icon-button.tsx +66 -0
- package/templates/mobile/expo/src/core/components/ui/icon-button/icon-button.type.ts +25 -0
- package/templates/mobile/expo/src/core/components/ui/icon-button/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/image-slider/image-slider.tsx +107 -0
- package/templates/mobile/expo/src/core/components/ui/image-slider/image-slider.type.ts +10 -0
- package/templates/mobile/expo/src/core/components/ui/image-slider/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/index.ts +25 -0
- package/templates/mobile/expo/src/core/components/ui/label/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/label/label.tsx +36 -0
- package/templates/mobile/expo/src/core/components/ui/label/label.type.ts +12 -0
- package/templates/mobile/expo/src/core/components/ui/modal/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/modal/modal.tsx +62 -0
- package/templates/mobile/expo/src/core/components/ui/modal/modal.type.ts +11 -0
- package/templates/mobile/expo/src/core/components/ui/otp-input/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/otp-input/otp-input.tsx +129 -0
- package/templates/mobile/expo/src/core/components/ui/otp-input/otp-input.type.ts +20 -0
- package/templates/mobile/expo/src/core/components/ui/page-dots/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/ui/page-dots/page-dots.tsx +60 -0
- package/templates/mobile/expo/src/core/components/ui/radio/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/radio/radio.tsx +121 -0
- package/templates/mobile/expo/src/core/components/ui/radio/radio.type.ts +20 -0
- package/templates/mobile/expo/src/core/components/ui/screen/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/ui/screen/screen-gradient.tsx +33 -0
- package/templates/mobile/expo/src/core/components/ui/search-box/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/search-box/search-box.tsx +162 -0
- package/templates/mobile/expo/src/core/components/ui/search-box/search-box.type.ts +26 -0
- package/templates/mobile/expo/src/core/components/ui/segmented-control/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/segmented-control/segmented-control.tsx +86 -0
- package/templates/mobile/expo/src/core/components/ui/segmented-control/segmented-control.type.ts +22 -0
- package/templates/mobile/expo/src/core/components/ui/skeleton/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/skeleton/skeleton.tsx +106 -0
- package/templates/mobile/expo/src/core/components/ui/skeleton/skeleton.type.ts +8 -0
- package/templates/mobile/expo/src/core/components/ui/success-state/index.ts +1 -0
- package/templates/mobile/expo/src/core/components/ui/success-state/success-state.tsx +68 -0
- package/templates/mobile/expo/src/core/components/ui/tabs/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/tabs/tabs.tsx +273 -0
- package/templates/mobile/expo/src/core/components/ui/tabs/tabs.type.ts +21 -0
- package/templates/mobile/expo/src/core/components/ui/tag-input/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/tag-input/tag-input.tsx +146 -0
- package/templates/mobile/expo/src/core/components/ui/tag-input/tag-input.type.ts +22 -0
- package/templates/mobile/expo/src/core/components/ui/text-area/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/text-area/text-area.tsx +90 -0
- package/templates/mobile/expo/src/core/components/ui/text-area/text-area.type.ts +20 -0
- package/templates/mobile/expo/src/core/components/ui/text-field/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/text-field/text-field.tsx +116 -0
- package/templates/mobile/expo/src/core/components/ui/text-field/text-field.type.ts +21 -0
- package/templates/mobile/expo/src/core/components/ui/toggle/index.ts +2 -0
- package/templates/mobile/expo/src/core/components/ui/toggle/toggle.tsx +110 -0
- package/templates/mobile/expo/src/core/components/ui/toggle/toggle.type.ts +19 -0
- package/templates/mobile/expo/src/core/constants/external-urls.constant.ts +5 -0
- package/templates/mobile/expo/src/core/constants/hard-data.constant.ts +0 -0
- package/templates/mobile/expo/src/core/constants/index.ts +2 -0
- package/templates/mobile/expo/src/core/constants/type.constant.ts +3 -0
- package/templates/mobile/expo/src/core/context/index.ts +1 -0
- package/templates/mobile/expo/src/core/context/shared-transition-context.tsx +35 -0
- package/templates/mobile/expo/src/core/hook/index.ts +8 -0
- package/templates/mobile/expo/src/core/hook/useActiveRouteName.ts +63 -0
- package/templates/mobile/expo/src/core/hook/useAppNavigation.tsx +7 -0
- package/templates/mobile/expo/src/core/hook/useBottomInset.tsx +26 -0
- package/templates/mobile/expo/src/core/hook/useDebounce.tsx +16 -0
- package/templates/mobile/expo/src/core/hook/useEndReached.tsx +46 -0
- package/templates/mobile/expo/src/core/hook/useManualRefetch.ts +56 -0
- package/templates/mobile/expo/src/core/hook/useNetworkStatus.ts +68 -0
- package/templates/mobile/expo/src/core/hook/useTimeout.tsx +30 -0
- package/templates/mobile/expo/src/core/index.ts +7 -0
- package/templates/mobile/expo/src/core/services/api.service.ts +230 -0
- package/templates/mobile/expo/src/core/services/device-id.service.ts +37 -0
- package/templates/mobile/expo/src/core/services/index.ts +3 -0
- package/templates/mobile/expo/src/core/services/session-end.bridge.ts +26 -0
- package/templates/mobile/expo/src/core/theme/dark.theme.ts +10 -0
- package/templates/mobile/expo/src/core/theme/index.ts +5 -0
- package/templates/mobile/expo/src/core/theme/light.theme.ts +44 -0
- package/templates/mobile/expo/src/core/theme/theme-context.tsx +82 -0
- package/templates/mobile/expo/src/core/theme/theme.types.ts +26 -0
- package/templates/mobile/expo/src/core/theme/use-themed-styles.ts +25 -0
- package/templates/mobile/expo/src/core/utils/color.util.tsx +198 -0
- package/templates/mobile/expo/src/core/utils/date.util.ts +97 -0
- package/templates/mobile/expo/src/core/utils/device-locale.util.ts +24 -0
- package/templates/mobile/expo/src/core/utils/emitter/index.ts +161 -0
- package/templates/mobile/expo/src/core/utils/emitter/type.ts +40 -0
- package/templates/mobile/expo/src/core/utils/enum.util.tsx +15 -0
- package/templates/mobile/expo/src/core/utils/font.util.tsx +42 -0
- package/templates/mobile/expo/src/core/utils/func.util.ts +48 -0
- package/templates/mobile/expo/src/core/utils/greeting.util.ts +20 -0
- package/templates/mobile/expo/src/core/utils/image-format.util.ts +117 -0
- package/templates/mobile/expo/src/core/utils/image-picker.util.ts +63 -0
- package/templates/mobile/expo/src/core/utils/index.ts +18 -0
- package/templates/mobile/expo/src/core/utils/linking.util.ts +16 -0
- package/templates/mobile/expo/src/core/utils/navigation.util.tsx +100 -0
- package/templates/mobile/expo/src/core/utils/number-format.ts +28 -0
- package/templates/mobile/expo/src/core/utils/query-client.util.ts +35 -0
- package/templates/mobile/expo/src/core/utils/query-persister.util.ts +31 -0
- package/templates/mobile/expo/src/core/utils/schema.util.tsx +2713 -0
- package/templates/mobile/expo/src/core/utils/size.util.tsx +74 -0
- package/templates/mobile/expo/src/core/utils/storage.util.tsx +53 -0
- package/templates/mobile/expo/src/core/utils/toast.util.tsx +151 -0
- package/templates/mobile/expo/src/core/utils/translator.util.tsx +23 -0
- package/templates/mobile/expo/src/core/utils/typography.util.tsx +69 -0
- package/templates/mobile/expo/src/core/utils/validate.util.tsx +13 -0
- package/templates/mobile/expo/src/declarations.d.ts +54 -0
- package/templates/mobile/expo/src/modules/home/home.screen.tsx +110 -0
- package/templates/mobile/expo/src/modules/profile/profile.screen.tsx +29 -0
- package/templates/mobile/expo/src/scripts/link-fonts.js +60 -0
- package/templates/mobile/expo/src/scripts/sync-images.js +56 -0
- package/templates/mobile/expo/src/scripts/sync-svgs.js +50 -0
- package/templates/mobile/expo/src/types/models.d.ts +24 -0
- package/templates/mobile/expo/tsconfig.json +19 -0
- package/templates/mobile/rn/.bundle/config +2 -0
- package/templates/mobile/rn/.env.example +5 -0
- package/templates/mobile/rn/.eslintrc.js +7 -0
- package/templates/mobile/rn/.prettierrc.js +7 -0
- package/templates/mobile/rn/.svgrrc.js +9 -0
- package/templates/mobile/rn/.watchmanconfig +1 -0
- package/templates/mobile/rn/Gemfile +17 -0
- package/templates/mobile/rn/README.md +72 -7
- package/templates/mobile/rn/_gitignore +24 -0
- package/templates/mobile/rn/_package.json +69 -1
- package/templates/mobile/rn/android/app/build.gradle +126 -0
- package/templates/mobile/rn/android/app/debug.keystore +0 -0
- package/templates/mobile/rn/android/app/proguard-rules.pro +10 -0
- package/templates/mobile/rn/android/app/src/main/AndroidManifest.xml +27 -0
- package/templates/mobile/rn/android/app/src/main/java/com/dumobile/MainActivity.kt +22 -0
- package/templates/mobile/rn/android/app/src/main/java/com/dumobile/MainApplication.kt +27 -0
- package/templates/mobile/rn/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/values/strings.xml +3 -0
- package/templates/mobile/rn/android/app/src/main/res/values/styles.xml +9 -0
- package/templates/mobile/rn/android/build.gradle +21 -0
- package/templates/mobile/rn/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/mobile/rn/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/templates/mobile/rn/android/gradle.properties +44 -0
- package/templates/mobile/rn/android/gradlew +248 -0
- package/templates/mobile/rn/android/gradlew.bat +98 -0
- package/templates/mobile/rn/android/settings.gradle +21 -0
- package/templates/mobile/rn/app.json +4 -0
- package/templates/mobile/rn/babel.config.js +18 -0
- package/templates/mobile/rn/index.js +10 -0
- package/templates/mobile/rn/ios/.xcode.env +11 -0
- package/templates/mobile/rn/ios/DuMobile/AppDelegate.swift +48 -0
- package/templates/mobile/rn/ios/DuMobile/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/templates/mobile/rn/ios/DuMobile/Images.xcassets/Contents.json +6 -0
- package/templates/mobile/rn/ios/DuMobile/Info.plist +59 -0
- package/templates/mobile/rn/ios/DuMobile/LaunchScreen.storyboard +47 -0
- package/templates/mobile/rn/ios/DuMobile/PrivacyInfo.xcprivacy +37 -0
- package/templates/mobile/rn/ios/DuMobile.xcodeproj/project.pbxproj +475 -0
- package/templates/mobile/rn/ios/DuMobile.xcodeproj/xcshareddata/xcschemes/DuMobile.xcscheme +88 -0
- package/templates/mobile/rn/ios/Podfile +34 -0
- package/templates/mobile/rn/metro.config.js +33 -0
- package/templates/mobile/rn/src/app/App.tsx +24 -0
- package/templates/mobile/rn/src/app/app-provider.tsx +41 -0
- package/templates/mobile/rn/src/app/config/translation.ts +29 -0
- package/templates/mobile/rn/src/app/index.ts +1 -0
- package/templates/mobile/rn/src/app/navigation/app-route-type.ts +27 -0
- package/templates/mobile/rn/src/app/navigation/bottom-tabs.tsx +34 -0
- package/templates/mobile/rn/src/app/navigation/index.tsx +14 -0
- package/templates/mobile/rn/src/app/stores/auth.store.ts +33 -0
- package/templates/mobile/rn/src/app/stores/common.store.ts +19 -0
- package/templates/mobile/rn/src/app/stores/index.ts +3 -0
- package/templates/mobile/rn/src/app/stores/loading.store.ts +22 -0
- package/templates/mobile/rn/src/assets/Images/empty-list.png +0 -0
- package/templates/mobile/rn/src/assets/Images/index.ts +5 -0
- package/templates/mobile/rn/src/assets/Images/screen-bg-gradian.png +0 -0
- package/templates/mobile/rn/src/assets/i18n/en.json +22 -0
- package/templates/mobile/rn/src/assets/i18n/fr.json +22 -0
- package/templates/mobile/rn/src/assets/lotties/index.ts +3 -0
- package/templates/mobile/rn/src/assets/lotties/loading.json +1 -0
- package/templates/mobile/rn/src/assets/svgs/arrow-left.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/arrow-right.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/calendar.svg +12 -0
- package/templates/mobile/rn/src/assets/svgs/check.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/close.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/eye-hide.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/eye.svg +4 -0
- package/templates/mobile/rn/src/assets/svgs/index.ts +29 -0
- package/templates/mobile/rn/src/assets/svgs/minus.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/plus.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/search.svg +3 -0
- package/templates/mobile/rn/src/assets/svgs/toast-error.svg +5 -0
- package/templates/mobile/rn/src/assets/svgs/toast-success.svg +4 -0
- package/templates/mobile/rn/src/core/api/endpoints.ts +8 -0
- package/templates/mobile/rn/src/core/api/example.api.ts +53 -0
- package/templates/mobile/rn/src/core/api/index.ts +4 -0
- package/templates/mobile/rn/src/core/components/common/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/common/list-empty/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/common/list-empty/list-empty.tsx +30 -0
- package/templates/mobile/rn/src/core/components/common/list-empty/list-empty.type.ts +5 -0
- package/templates/mobile/rn/src/core/components/forms/hf-date-time.tsx +301 -0
- package/templates/mobile/rn/src/core/components/forms/hf-password-input.tsx +153 -0
- package/templates/mobile/rn/src/core/components/forms/hf-text-input.tsx +59 -0
- package/templates/mobile/rn/src/core/components/forms/hf-time-picker.tsx +117 -0
- package/templates/mobile/rn/src/core/components/forms/index.ts +4 -0
- package/templates/mobile/rn/src/core/components/index.ts +5 -0
- package/templates/mobile/rn/src/core/components/loading/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/loading/loading-app/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/loading/loading-app/loading-app.tsx +50 -0
- package/templates/mobile/rn/src/core/components/offline/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/offline/offline-banner.tsx +186 -0
- package/templates/mobile/rn/src/core/components/screen/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/screen/screen-container/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/screen/screen-container/screen-container.tsx +252 -0
- package/templates/mobile/rn/src/core/components/splash/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/splash/splash-overlay/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/splash/splash-overlay/splash-overlay.tsx +93 -0
- package/templates/mobile/rn/src/core/components/ui/animated-list-item/animated-list-item.tsx +48 -0
- package/templates/mobile/rn/src/core/components/ui/animated-list-item/animated-list-item.type.ts +10 -0
- package/templates/mobile/rn/src/core/components/ui/animated-list-item/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/app-image/app-image.tsx +104 -0
- package/templates/mobile/rn/src/core/components/ui/app-image/app-image.type.ts +19 -0
- package/templates/mobile/rn/src/core/components/ui/app-image/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/asset-placeholder/asset-placeholder.tsx +76 -0
- package/templates/mobile/rn/src/core/components/ui/asset-placeholder/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/ui/avatar-image/avatar-image.tsx +90 -0
- package/templates/mobile/rn/src/core/components/ui/avatar-image/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/ui/bottom-sheet/bottom-sheet.tsx +145 -0
- package/templates/mobile/rn/src/core/components/ui/bottom-sheet/bottom-sheet.type.ts +10 -0
- package/templates/mobile/rn/src/core/components/ui/bottom-sheet/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/button/button.style.ts +146 -0
- package/templates/mobile/rn/src/core/components/ui/button/button.tsx +97 -0
- package/templates/mobile/rn/src/core/components/ui/button/button.type.ts +47 -0
- package/templates/mobile/rn/src/core/components/ui/button/index.ts +4 -0
- package/templates/mobile/rn/src/core/components/ui/checkbox/checkbox.tsx +127 -0
- package/templates/mobile/rn/src/core/components/ui/checkbox/checkbox.type.ts +24 -0
- package/templates/mobile/rn/src/core/components/ui/checkbox/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/collapsible-section/collapsible-section.tsx +141 -0
- package/templates/mobile/rn/src/core/components/ui/collapsible-section/collapsible-section.type.ts +10 -0
- package/templates/mobile/rn/src/core/components/ui/collapsible-section/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/components.registry.json +313 -0
- package/templates/mobile/rn/src/core/components/ui/field/field-frame.tsx +62 -0
- package/templates/mobile/rn/src/core/components/ui/field/field.shared.ts +31 -0
- package/templates/mobile/rn/src/core/components/ui/header/header.tsx +196 -0
- package/templates/mobile/rn/src/core/components/ui/header/header.type.ts +30 -0
- package/templates/mobile/rn/src/core/components/ui/header/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/icon-button/icon-button.style.ts +23 -0
- package/templates/mobile/rn/src/core/components/ui/icon-button/icon-button.tsx +66 -0
- package/templates/mobile/rn/src/core/components/ui/icon-button/icon-button.type.ts +25 -0
- package/templates/mobile/rn/src/core/components/ui/icon-button/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/image-slider/image-slider.tsx +107 -0
- package/templates/mobile/rn/src/core/components/ui/image-slider/image-slider.type.ts +10 -0
- package/templates/mobile/rn/src/core/components/ui/image-slider/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/index.ts +25 -0
- package/templates/mobile/rn/src/core/components/ui/label/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/label/label.tsx +36 -0
- package/templates/mobile/rn/src/core/components/ui/label/label.type.ts +12 -0
- package/templates/mobile/rn/src/core/components/ui/modal/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/modal/modal.tsx +62 -0
- package/templates/mobile/rn/src/core/components/ui/modal/modal.type.ts +11 -0
- package/templates/mobile/rn/src/core/components/ui/otp-input/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/otp-input/otp-input.tsx +129 -0
- package/templates/mobile/rn/src/core/components/ui/otp-input/otp-input.type.ts +20 -0
- package/templates/mobile/rn/src/core/components/ui/page-dots/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/ui/page-dots/page-dots.tsx +60 -0
- package/templates/mobile/rn/src/core/components/ui/radio/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/radio/radio.tsx +121 -0
- package/templates/mobile/rn/src/core/components/ui/radio/radio.type.ts +20 -0
- package/templates/mobile/rn/src/core/components/ui/screen/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/ui/screen/screen-gradient.tsx +33 -0
- package/templates/mobile/rn/src/core/components/ui/search-box/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/search-box/search-box.tsx +162 -0
- package/templates/mobile/rn/src/core/components/ui/search-box/search-box.type.ts +26 -0
- package/templates/mobile/rn/src/core/components/ui/segmented-control/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/segmented-control/segmented-control.tsx +86 -0
- package/templates/mobile/rn/src/core/components/ui/segmented-control/segmented-control.type.ts +22 -0
- package/templates/mobile/rn/src/core/components/ui/skeleton/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/skeleton/skeleton.tsx +106 -0
- package/templates/mobile/rn/src/core/components/ui/skeleton/skeleton.type.ts +8 -0
- package/templates/mobile/rn/src/core/components/ui/success-state/index.ts +1 -0
- package/templates/mobile/rn/src/core/components/ui/success-state/success-state.tsx +68 -0
- package/templates/mobile/rn/src/core/components/ui/tabs/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/tabs/tabs.tsx +273 -0
- package/templates/mobile/rn/src/core/components/ui/tabs/tabs.type.ts +21 -0
- package/templates/mobile/rn/src/core/components/ui/tag-input/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/tag-input/tag-input.tsx +146 -0
- package/templates/mobile/rn/src/core/components/ui/tag-input/tag-input.type.ts +22 -0
- package/templates/mobile/rn/src/core/components/ui/text-area/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/text-area/text-area.tsx +90 -0
- package/templates/mobile/rn/src/core/components/ui/text-area/text-area.type.ts +20 -0
- package/templates/mobile/rn/src/core/components/ui/text-field/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/text-field/text-field.tsx +116 -0
- package/templates/mobile/rn/src/core/components/ui/text-field/text-field.type.ts +21 -0
- package/templates/mobile/rn/src/core/components/ui/toggle/index.ts +2 -0
- package/templates/mobile/rn/src/core/components/ui/toggle/toggle.tsx +110 -0
- package/templates/mobile/rn/src/core/components/ui/toggle/toggle.type.ts +19 -0
- package/templates/mobile/rn/src/core/constants/external-urls.constant.ts +5 -0
- package/templates/mobile/rn/src/core/constants/hard-data.constant.ts +0 -0
- package/templates/mobile/rn/src/core/constants/index.ts +2 -0
- package/templates/mobile/rn/src/core/constants/type.constant.ts +3 -0
- package/templates/mobile/rn/src/core/context/index.ts +1 -0
- package/templates/mobile/rn/src/core/context/shared-transition-context.tsx +35 -0
- package/templates/mobile/rn/src/core/hook/index.ts +8 -0
- package/templates/mobile/rn/src/core/hook/useActiveRouteName.ts +63 -0
- package/templates/mobile/rn/src/core/hook/useAppNavigation.tsx +7 -0
- package/templates/mobile/rn/src/core/hook/useBottomInset.tsx +26 -0
- package/templates/mobile/rn/src/core/hook/useDebounce.tsx +16 -0
- package/templates/mobile/rn/src/core/hook/useEndReached.tsx +46 -0
- package/templates/mobile/rn/src/core/hook/useManualRefetch.ts +56 -0
- package/templates/mobile/rn/src/core/hook/useNetworkStatus.ts +68 -0
- package/templates/mobile/rn/src/core/hook/useTimeout.tsx +30 -0
- package/templates/mobile/rn/src/core/index.ts +7 -0
- package/templates/mobile/rn/src/core/services/api.service.ts +230 -0
- package/templates/mobile/rn/src/core/services/device-id.service.ts +23 -0
- package/templates/mobile/rn/src/core/services/index.ts +3 -0
- package/templates/mobile/rn/src/core/services/session-end.bridge.ts +26 -0
- package/templates/mobile/rn/src/core/theme/dark.theme.ts +10 -0
- package/templates/mobile/rn/src/core/theme/index.ts +5 -0
- package/templates/mobile/rn/src/core/theme/light.theme.ts +44 -0
- package/templates/mobile/rn/src/core/theme/theme-context.tsx +82 -0
- package/templates/mobile/rn/src/core/theme/theme.types.ts +26 -0
- package/templates/mobile/rn/src/core/theme/use-themed-styles.ts +25 -0
- package/templates/mobile/rn/src/core/utils/color.util.tsx +198 -0
- package/templates/mobile/rn/src/core/utils/date.util.ts +97 -0
- package/templates/mobile/rn/src/core/utils/device-locale.util.ts +22 -0
- package/templates/mobile/rn/src/core/utils/emitter/index.ts +161 -0
- package/templates/mobile/rn/src/core/utils/emitter/type.ts +40 -0
- package/templates/mobile/rn/src/core/utils/enum.util.tsx +15 -0
- package/templates/mobile/rn/src/core/utils/font.util.tsx +42 -0
- package/templates/mobile/rn/src/core/utils/func.util.ts +48 -0
- package/templates/mobile/rn/src/core/utils/greeting.util.ts +20 -0
- package/templates/mobile/rn/src/core/utils/image-format.util.ts +117 -0
- package/templates/mobile/rn/src/core/utils/image-picker.util.ts +84 -0
- package/templates/mobile/rn/src/core/utils/index.ts +18 -0
- package/templates/mobile/rn/src/core/utils/linking.util.ts +16 -0
- package/templates/mobile/rn/src/core/utils/navigation.util.tsx +100 -0
- package/templates/mobile/rn/src/core/utils/number-format.ts +28 -0
- package/templates/mobile/rn/src/core/utils/query-client.util.ts +35 -0
- package/templates/mobile/rn/src/core/utils/query-persister.util.ts +36 -0
- package/templates/mobile/rn/src/core/utils/schema.util.tsx +2713 -0
- package/templates/mobile/rn/src/core/utils/size.util.tsx +74 -0
- package/templates/mobile/rn/src/core/utils/storage.util.tsx +53 -0
- package/templates/mobile/rn/src/core/utils/toast.util.tsx +151 -0
- package/templates/mobile/rn/src/core/utils/translator.util.tsx +23 -0
- package/templates/mobile/rn/src/core/utils/typography.util.tsx +69 -0
- package/templates/mobile/rn/src/core/utils/validate.util.tsx +13 -0
- package/templates/mobile/rn/src/declarations.d.ts +54 -0
- package/templates/mobile/rn/src/modules/home/home.screen.tsx +67 -0
- package/templates/mobile/rn/src/modules/profile/profile.screen.tsx +29 -0
- package/templates/mobile/rn/src/scripts/link-fonts.js +60 -0
- package/templates/mobile/rn/src/scripts/sync-images.js +56 -0
- package/templates/mobile/rn/src/scripts/sync-svgs.js +50 -0
- package/templates/mobile/rn/src/types/models.d.ts +24 -0
- package/templates/mobile/rn/tsconfig.json +21 -0
- package/templates/shared/src/api-endpoints.ts +8 -0
- package/templates/shared/src/enums.ts +34 -0
- package/templates/shared/src/external-urls.ts +5 -0
- package/templates/shared/src/index.ts +6 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Dimensions, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const { width, height } = Dimensions.get('window');
|
|
4
|
+
const [shortDimension, longDimension] = width < height ? [width, height] : [height, width];
|
|
5
|
+
|
|
6
|
+
const guidelineBaseWidth = 375;
|
|
7
|
+
const guidelineBaseHeight = 812;
|
|
8
|
+
const WIDTH_SCREEN = width;
|
|
9
|
+
const HEIGHT_SCREEN = height;
|
|
10
|
+
|
|
11
|
+
const horizontalScale = (size: number) => (shortDimension / guidelineBaseWidth) * size;
|
|
12
|
+
const verticalScale = (size: number) => (longDimension / guidelineBaseHeight) * size;
|
|
13
|
+
const moderateScale = (size: number, factor = 0.5) =>
|
|
14
|
+
size + (horizontalScale(size) - size) * factor;
|
|
15
|
+
// scale fontsize
|
|
16
|
+
// const scaleWidth = width / guidelineBaseWidth;
|
|
17
|
+
// const scaleHeight = height / guidelineBaseHeight;
|
|
18
|
+
// const scale = Math.min(scaleWidth, scaleHeight);
|
|
19
|
+
const fontSize = (size: number) => size;
|
|
20
|
+
|
|
21
|
+
const isIOS = Platform.OS === 'ios';
|
|
22
|
+
|
|
23
|
+
// Spacing tokens ā Life-Master-Design (Figma "Spacing & Grid").
|
|
24
|
+
// Base unit 4px. Scale: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64.
|
|
25
|
+
const Spacing = {
|
|
26
|
+
spacing_none: 0, // 0px
|
|
27
|
+
spacing_2xs: 2, // 2px (nudge, off-scale)
|
|
28
|
+
spacing_xs: 4, // xs
|
|
29
|
+
spacing_s_nudge: 6, // 6px (nudge, off-scale)
|
|
30
|
+
spacing_sm: 8, // sm
|
|
31
|
+
spacing_m_nudge: 10, // 10px (nudge, off-scale)
|
|
32
|
+
spacing_md: 12, // md
|
|
33
|
+
spacing_base: 16, // base
|
|
34
|
+
spacing_lg: 20, // lg
|
|
35
|
+
spacing_xl: 24, // xl
|
|
36
|
+
spacing_2xl: 32, // 2xl
|
|
37
|
+
spacing_3xl: 40, // 3xl
|
|
38
|
+
spacing_4xl: 48, // 4xl
|
|
39
|
+
spacing_5xl: 64, // 5xl
|
|
40
|
+
} as const;
|
|
41
|
+
|
|
42
|
+
// Border-radius tokens ā Life-Master-Design (Figma "Border Radius").
|
|
43
|
+
// Scale: 4, 8, 12, 16, 24, full.
|
|
44
|
+
const Radius = {
|
|
45
|
+
radius_none: 0, // 0px
|
|
46
|
+
radius_xs: 2, // xs
|
|
47
|
+
radius_sm: 4, // sm
|
|
48
|
+
radius_md: 8, // md
|
|
49
|
+
radius_lg: 12, // lg
|
|
50
|
+
radius_xl: 16, // xl
|
|
51
|
+
radius_2xl: 24, // 2xl
|
|
52
|
+
radius_full: 999, // full
|
|
53
|
+
} as const;
|
|
54
|
+
|
|
55
|
+
// stroke width tokens (theo Figma, dùng px thÓ)
|
|
56
|
+
const Stroke = {
|
|
57
|
+
stroke_none: 0, // 0px
|
|
58
|
+
stroke_xs: 0.5, // 0.5px
|
|
59
|
+
stroke_s: 1, // 1px
|
|
60
|
+
stroke_m: 2, // 2px
|
|
61
|
+
} as const;
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
fontSize,
|
|
65
|
+
HEIGHT_SCREEN,
|
|
66
|
+
horizontalScale,
|
|
67
|
+
isIOS,
|
|
68
|
+
moderateScale,
|
|
69
|
+
Radius,
|
|
70
|
+
Spacing,
|
|
71
|
+
Stroke,
|
|
72
|
+
verticalScale,
|
|
73
|
+
WIDTH_SCREEN,
|
|
74
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
+
|
|
3
|
+
export enum StorageKeys {
|
|
4
|
+
APP_ACCESS_TOKEN = 'APP_ACCESS_TOKEN',
|
|
5
|
+
APP_REFRESH_TOKEN = 'APP_REFRESH_TOKEN',
|
|
6
|
+
LANGUAGE = 'LANGUAGE',
|
|
7
|
+
FAVORIS_SEARCH_HISTORY = 'FAVORIS_SEARCH_HISTORY',
|
|
8
|
+
CHAT_LIST_SEARCH_HISTORY = 'CHAT_LIST_SEARCH_HISTORY',
|
|
9
|
+
ENUM_VALUES = 'ENUM_VALUES',
|
|
10
|
+
THEME = 'THEME',
|
|
11
|
+
USER_PATH_TYPE = 'USER_PATH_TYPE',
|
|
12
|
+
LIBRARY_ITEMS = 'LIBRARY_ITEMS',
|
|
13
|
+
ENTITLEMENT = 'ENTITLEMENT',
|
|
14
|
+
ONBOARDED = 'ONBOARDED',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class AppStorageUtil {
|
|
18
|
+
static setItem = async (key: string, value: any) => {
|
|
19
|
+
try {
|
|
20
|
+
await AsyncStorage.setItem(key, JSON.stringify(value));
|
|
21
|
+
} catch {
|
|
22
|
+
// ignored
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
static getItem = async (key: string) => {
|
|
27
|
+
try {
|
|
28
|
+
const data: any = await AsyncStorage.getItem(key);
|
|
29
|
+
return JSON.parse(data);
|
|
30
|
+
} catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
static removeItem = async (key: string) => {
|
|
36
|
+
try {
|
|
37
|
+
await AsyncStorage.removeItem(key);
|
|
38
|
+
} catch {
|
|
39
|
+
// ignored
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
static removeAll = async () => {
|
|
44
|
+
try {
|
|
45
|
+
Promise.all([
|
|
46
|
+
AppStorageUtil.removeItem(StorageKeys.APP_ACCESS_TOKEN),
|
|
47
|
+
AppStorageUtil.removeItem(StorageKeys.APP_REFRESH_TOKEN),
|
|
48
|
+
]);
|
|
49
|
+
} catch {
|
|
50
|
+
// ignored
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Colors } from './color.util';
|
|
2
|
+
import { IconToastError, IconToastSuccess } from '@src/assets/svgs';
|
|
3
|
+
import {
|
|
4
|
+
fontSize,
|
|
5
|
+
horizontalScale,
|
|
6
|
+
verticalScale,
|
|
7
|
+
} from './size.util';
|
|
8
|
+
import { Font } from './font.util';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
11
|
+
import Toast, {
|
|
12
|
+
BaseToast,
|
|
13
|
+
BaseToastProps,
|
|
14
|
+
ToastConfig,
|
|
15
|
+
} from 'react-native-toast-message';
|
|
16
|
+
|
|
17
|
+
const toastProps: BaseToastProps = {
|
|
18
|
+
text1Style: {
|
|
19
|
+
fontSize: 12,
|
|
20
|
+
fontWeight: undefined,
|
|
21
|
+
},
|
|
22
|
+
text2Style: {
|
|
23
|
+
fontSize: 12,
|
|
24
|
+
},
|
|
25
|
+
text2NumberOfLines: 0,
|
|
26
|
+
style: {
|
|
27
|
+
height: 'auto',
|
|
28
|
+
paddingVertical: 20,
|
|
29
|
+
paddingHorizontal: 0,
|
|
30
|
+
marginTop: 20,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const CustomSuccessToast = (props: BaseToastProps) => (
|
|
35
|
+
<TouchableOpacity
|
|
36
|
+
activeOpacity={1}
|
|
37
|
+
onPress={props.onPress}
|
|
38
|
+
style={styles.container}
|
|
39
|
+
>
|
|
40
|
+
<IconToastSuccess width={horizontalScale(24)} height={horizontalScale(24)} />
|
|
41
|
+
<View style={styles.textWrapper}>
|
|
42
|
+
{props.text1 ? (
|
|
43
|
+
<Text style={styles.text1} numberOfLines={1}>
|
|
44
|
+
{props.text1}
|
|
45
|
+
</Text>
|
|
46
|
+
) : null}
|
|
47
|
+
{props.text2 ? (
|
|
48
|
+
<Text style={styles.text2} numberOfLines={0}>
|
|
49
|
+
{props.text2}
|
|
50
|
+
</Text>
|
|
51
|
+
) : null}
|
|
52
|
+
</View>
|
|
53
|
+
</TouchableOpacity>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const CustomErrorToast = (props: BaseToastProps) => (
|
|
57
|
+
<TouchableOpacity
|
|
58
|
+
activeOpacity={1}
|
|
59
|
+
onPress={props.onPress}
|
|
60
|
+
style={[styles.container, { borderWidth: 1 }]}
|
|
61
|
+
>
|
|
62
|
+
<IconToastError width={horizontalScale(24)} height={horizontalScale(24)} />
|
|
63
|
+
<View style={styles.textWrapper}>
|
|
64
|
+
{props.text1 ? (
|
|
65
|
+
<Text style={styles.text1} numberOfLines={1}>
|
|
66
|
+
{props.text1}
|
|
67
|
+
</Text>
|
|
68
|
+
) : null}
|
|
69
|
+
{props.text2 ? (
|
|
70
|
+
<Text style={styles.text2} numberOfLines={0}>
|
|
71
|
+
{props.text2}
|
|
72
|
+
</Text>
|
|
73
|
+
) : null}
|
|
74
|
+
</View>
|
|
75
|
+
</TouchableOpacity>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
export const toastConfig: ToastConfig = {
|
|
79
|
+
success: props => <CustomSuccessToast {...props} />,
|
|
80
|
+
error: props => <CustomErrorToast {...props} />,
|
|
81
|
+
warning: props => (
|
|
82
|
+
<BaseToast
|
|
83
|
+
{...props}
|
|
84
|
+
{...toastProps}
|
|
85
|
+
style={[
|
|
86
|
+
toastProps.style,
|
|
87
|
+
{
|
|
88
|
+
borderLeftColor: Colors.bd_warning_normal,
|
|
89
|
+
},
|
|
90
|
+
]}
|
|
91
|
+
/>
|
|
92
|
+
),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const styles = StyleSheet.create({
|
|
96
|
+
container: {
|
|
97
|
+
flexDirection: 'row',
|
|
98
|
+
backgroundColor: Colors.hFFFFFF,
|
|
99
|
+
borderRadius: horizontalScale(16),
|
|
100
|
+
padding: horizontalScale(12),
|
|
101
|
+
marginTop: verticalScale(20),
|
|
102
|
+
shadowColor: Colors.h000000,
|
|
103
|
+
shadowOffset: { width: 0, height: 2 },
|
|
104
|
+
shadowOpacity: 0.08,
|
|
105
|
+
shadowRadius: 8,
|
|
106
|
+
elevation: 4,
|
|
107
|
+
marginHorizontal: horizontalScale(16),
|
|
108
|
+
gap: verticalScale(8),
|
|
109
|
+
borderColor: '#FEE9E7',
|
|
110
|
+
},
|
|
111
|
+
textWrapper: {
|
|
112
|
+
flex: 1,
|
|
113
|
+
justifyContent: 'center',
|
|
114
|
+
},
|
|
115
|
+
text1: {
|
|
116
|
+
fontSize: fontSize(16),
|
|
117
|
+
fontFamily: Font.rethinkSansSemiBold,
|
|
118
|
+
color: Colors.text_primary,
|
|
119
|
+
marginBottom: verticalScale(2),
|
|
120
|
+
},
|
|
121
|
+
text2: {
|
|
122
|
+
fontSize: fontSize(14),
|
|
123
|
+
fontFamily: Font.rethinkSansRegular,
|
|
124
|
+
color: Colors.sub_text,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export const showErrorToast = (title?: string, message?: string) => {
|
|
129
|
+
Toast.show({
|
|
130
|
+
type: 'error',
|
|
131
|
+
text1: title || 'Erreur!',
|
|
132
|
+
text2: message || '',
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const showSuccessToast = (title?: string, message?: string, onPress?: () => void) => {
|
|
137
|
+
Toast.show({
|
|
138
|
+
type: 'success',
|
|
139
|
+
text1: title ?? 'SuccĆØs',
|
|
140
|
+
text2: message || '',
|
|
141
|
+
onPress
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const showWarningToast = (title?: string, message?: string) => {
|
|
146
|
+
Toast.show({
|
|
147
|
+
type: 'warning',
|
|
148
|
+
text1: title || 'Warning!',
|
|
149
|
+
text2: message || '',
|
|
150
|
+
});
|
|
151
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import I18n, { i18n, InitOptions } from 'i18next'
|
|
2
|
+
import { initReactI18next } from 'react-i18next'
|
|
3
|
+
|
|
4
|
+
export class Translator {
|
|
5
|
+
public static setup(options: InitOptions): i18n {
|
|
6
|
+
I18n.use(initReactI18next).init(options)
|
|
7
|
+
|
|
8
|
+
return I18n
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public static translate(message: string): string {
|
|
12
|
+
return I18n.t(message) || message
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public static changeLanguages = (lng: string | undefined) => {
|
|
16
|
+
I18n.changeLanguage(lng)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The active i18n language (e.g. 'fr' | 'en'); '' before init. */
|
|
20
|
+
public static currentLanguage(): string {
|
|
21
|
+
return I18n.language ?? ''
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { TextStyle } from 'react-native';
|
|
2
|
+
import { Font } from './font.util';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Typography scale ā Life-Master-Design (Figma "Typography", DM Sans).
|
|
6
|
+
*
|
|
7
|
+
* Each token is a ready-to-spread `TextStyle` (fontFamily + fontSize + lineHeight).
|
|
8
|
+
* Use these instead of hand-writing font sizes so text stays consistent with the
|
|
9
|
+
* design system.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Text style={Typography.headingXl}>Life Master</Text>
|
|
13
|
+
* <Text style={[Typography.bodyM, { color: Colors.sub_text }]}>...</Text>
|
|
14
|
+
*
|
|
15
|
+
* | Token | size | weight | line | usage |
|
|
16
|
+
* |--------------|------|-----------|------|-----------------------|
|
|
17
|
+
* | headingXl | 32 | SemiBold | 40 | Page titles, hero |
|
|
18
|
+
* | headingL | 24 | SemiBold | 32 | Section headings |
|
|
19
|
+
* | headingM | 20 | Medium | 28 | Card titles |
|
|
20
|
+
* | bodyL | 16 | Regular | 24 | Primary body text |
|
|
21
|
+
* | bodyM | 14 | Regular | 20 | Secondary body text |
|
|
22
|
+
* | bodyMBold | 14 | SemiBold | 20 | Emphasized body text |
|
|
23
|
+
* | caption | 12 | Regular | 18 | Captions, labels |
|
|
24
|
+
* | captionBold | 10 | Medium | 14 | Tags, badges |
|
|
25
|
+
*/
|
|
26
|
+
export const Typography = {
|
|
27
|
+
headingXl: {
|
|
28
|
+
fontFamily: Font.dmSansSemiBold,
|
|
29
|
+
fontSize: 32,
|
|
30
|
+
lineHeight: 40,
|
|
31
|
+
},
|
|
32
|
+
headingL: {
|
|
33
|
+
fontFamily: Font.dmSansSemiBold,
|
|
34
|
+
fontSize: 24,
|
|
35
|
+
lineHeight: 32,
|
|
36
|
+
},
|
|
37
|
+
headingM: {
|
|
38
|
+
fontFamily: Font.dmSansMedium,
|
|
39
|
+
fontSize: 20,
|
|
40
|
+
lineHeight: 28,
|
|
41
|
+
},
|
|
42
|
+
bodyL: {
|
|
43
|
+
fontFamily: Font.dmSansRegular,
|
|
44
|
+
fontSize: 16,
|
|
45
|
+
lineHeight: 24,
|
|
46
|
+
},
|
|
47
|
+
bodyM: {
|
|
48
|
+
fontFamily: Font.dmSansRegular,
|
|
49
|
+
fontSize: 14,
|
|
50
|
+
lineHeight: 20,
|
|
51
|
+
},
|
|
52
|
+
bodyMBold: {
|
|
53
|
+
fontFamily: Font.dmSansSemiBold,
|
|
54
|
+
fontSize: 14,
|
|
55
|
+
lineHeight: 20,
|
|
56
|
+
},
|
|
57
|
+
caption: {
|
|
58
|
+
fontFamily: Font.dmSansRegular,
|
|
59
|
+
fontSize: 12,
|
|
60
|
+
lineHeight: 18,
|
|
61
|
+
},
|
|
62
|
+
captionBold: {
|
|
63
|
+
fontFamily: Font.dmSansMedium,
|
|
64
|
+
fontSize: 10,
|
|
65
|
+
lineHeight: 14,
|
|
66
|
+
},
|
|
67
|
+
} satisfies Record<string, TextStyle>;
|
|
68
|
+
|
|
69
|
+
export type TypographyToken = keyof typeof Typography;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _ from 'lodash'
|
|
2
|
+
export const regexNumber = /^[0-9]+$/;
|
|
3
|
+
export const checkEmail = (value: string) => value && /^[\w+\-]+(\.[\w+\-]+)*@[\w\-]+(\.[\w\-]+)*\.\w{2,}$/.test(value) ? 1 : 0
|
|
4
|
+
export const requiredTrim = (value: string) => value && _.startsWith(value, ' ') || _.endsWith(value, ' ') ? 0 : 1
|
|
5
|
+
export const minLenght8 = (value: string) => value && value.length >= 8 ? 1 : 0
|
|
6
|
+
export const isPhoneNumber = (value: string) => value && /([0-9\s\-]{7,})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/g.test(value) ? 1 : 0
|
|
7
|
+
export const regexEmail = /^[\w+\-]+(\.[\w+\-]+)*@[\w\-]+(\.[\w\-]+)*\.\w{2,}$/
|
|
8
|
+
export const isAppleEmail = (value?: string | null) =>
|
|
9
|
+
!!value && /@(icloud|me|mac)\.com$/i.test(value.trim())
|
|
10
|
+
export const removeFromArray = (original: Array<{ _id?: string | number }>, remove: Array<{ _id?: string | number }>) => {
|
|
11
|
+
const removeIds = remove.map(item => item?._id);
|
|
12
|
+
return original.filter(value => !removeIds.includes(value?._id));
|
|
13
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
declare module '*.svg' {
|
|
2
|
+
import { SvgProps } from 'react-native-svg';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
const content: React.FC<SvgProps>;
|
|
6
|
+
export default content;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module '*.png' {
|
|
10
|
+
const value: any;
|
|
11
|
+
export default value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module 'react-native-fs' {
|
|
15
|
+
type DownloadFileOptions = {
|
|
16
|
+
fromUrl: string;
|
|
17
|
+
toFile: string;
|
|
18
|
+
headers?: Record<string, string>;
|
|
19
|
+
background?: boolean;
|
|
20
|
+
cacheable?: boolean;
|
|
21
|
+
progressInterval?: number;
|
|
22
|
+
progressDivider?: number;
|
|
23
|
+
begin?: (res: { contentLength: number; statusCode: number }) => void;
|
|
24
|
+
progress?: (res: { bytesWritten: number; contentLength: number }) => void;
|
|
25
|
+
};
|
|
26
|
+
type DownloadResult = {
|
|
27
|
+
statusCode: number;
|
|
28
|
+
bytesWritten: number;
|
|
29
|
+
};
|
|
30
|
+
const RNFS: {
|
|
31
|
+
CachesDirectoryPath: string;
|
|
32
|
+
DocumentDirectoryPath: string;
|
|
33
|
+
exists(path: string): Promise<boolean>;
|
|
34
|
+
mkdir(path: string): Promise<void>;
|
|
35
|
+
unlink(path: string): Promise<void>;
|
|
36
|
+
stopDownload(jobId: number): void;
|
|
37
|
+
writeFile(
|
|
38
|
+
path: string,
|
|
39
|
+
contents: string,
|
|
40
|
+
encoding: string,
|
|
41
|
+
): Promise<void>;
|
|
42
|
+
stat(path: string): Promise<{
|
|
43
|
+
size: number | string;
|
|
44
|
+
isFile(): boolean;
|
|
45
|
+
isDirectory(): boolean;
|
|
46
|
+
}>;
|
|
47
|
+
downloadFile(options: DownloadFileOptions): {
|
|
48
|
+
jobId: number;
|
|
49
|
+
promise: Promise<DownloadResult>;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default RNFS;
|
|
54
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useTheme } from '@src/core/theme';
|
|
5
|
+
|
|
6
|
+
// What's inside the starter ā rendered as the landing screen so a fresh
|
|
7
|
+
// generate is self-documenting. Replace this with your real home feature.
|
|
8
|
+
const FEATURES = [
|
|
9
|
+
{ key: 'nav', icon: 'š§' },
|
|
10
|
+
{ key: 'data', icon: 'š' },
|
|
11
|
+
{ key: 'i18n', icon: 'š' },
|
|
12
|
+
{ key: 'theme', icon: 'šØ' },
|
|
13
|
+
{ key: 'forms', icon: 'š' },
|
|
14
|
+
{ key: 'ui', icon: 'š§©' },
|
|
15
|
+
{ key: 'state', icon: 'š¦' },
|
|
16
|
+
{ key: 'shared', icon: 'š' },
|
|
17
|
+
] as const;
|
|
18
|
+
|
|
19
|
+
export function HomeScreen() {
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const { colors } = useTheme();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<ScrollView
|
|
25
|
+
style={{ backgroundColor: colors.bg_elevation_level_1_normal }}
|
|
26
|
+
contentContainerStyle={styles.container}>
|
|
27
|
+
<Text style={[styles.title, { color: colors.fg_neutral_normal }]}>{'{{PROJECT_NAME}}'}</Text>
|
|
28
|
+
<Text style={[styles.subtitle, { color: colors.fg_neutral_faded }]}>{t('home.subtitle')}</Text>
|
|
29
|
+
|
|
30
|
+
<View style={styles.list}>
|
|
31
|
+
{FEATURES.map(f => (
|
|
32
|
+
<View
|
|
33
|
+
key={f.key}
|
|
34
|
+
style={[
|
|
35
|
+
styles.card,
|
|
36
|
+
{ backgroundColor: colors.bg_elevation_level_2_normal, borderColor: colors.bd_neutral_faded },
|
|
37
|
+
]}>
|
|
38
|
+
<Text style={styles.icon}>{f.icon}</Text>
|
|
39
|
+
<View style={styles.cardText}>
|
|
40
|
+
<Text style={[styles.cardTitle, { color: colors.fg_neutral_normal }]}>
|
|
41
|
+
{t(`home.features.${f.key}.title`)}
|
|
42
|
+
</Text>
|
|
43
|
+
<Text style={[styles.cardDesc, { color: colors.fg_neutral_faded }]}>
|
|
44
|
+
{t(`home.features.${f.key}.desc`)}
|
|
45
|
+
</Text>
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
))}
|
|
49
|
+
</View>
|
|
50
|
+
|
|
51
|
+
<Text style={[styles.footer, { color: colors.fg_neutral_faded }]}>{t('home.footer')}</Text>
|
|
52
|
+
</ScrollView>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const styles = StyleSheet.create({
|
|
57
|
+
container: { padding: 20, paddingBottom: 40, gap: 8 },
|
|
58
|
+
title: { fontSize: 28, fontWeight: '700' },
|
|
59
|
+
subtitle: { fontSize: 15, marginBottom: 16, lineHeight: 21 },
|
|
60
|
+
list: { gap: 12 },
|
|
61
|
+
card: { flexDirection: 'row', gap: 14, padding: 16, borderRadius: 16, borderWidth: 1 },
|
|
62
|
+
icon: { fontSize: 24 },
|
|
63
|
+
cardText: { flex: 1, gap: 4 },
|
|
64
|
+
cardTitle: { fontSize: 16, fontWeight: '600' },
|
|
65
|
+
cardDesc: { fontSize: 13, lineHeight: 19 },
|
|
66
|
+
footer: { fontSize: 13, marginTop: 20, textAlign: 'center', fontStyle: 'italic' },
|
|
67
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { Button } from '@src/core/components/ui';
|
|
5
|
+
import { useTheme } from '@src/core/theme';
|
|
6
|
+
import { useAuthStore } from '@src/app/stores';
|
|
7
|
+
|
|
8
|
+
export function ProfileScreen() {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const { colors } = useTheme();
|
|
11
|
+
const clearTokens = useAuthStore(s => s.clearTokens);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<View style={[styles.container, { backgroundColor: colors.bg_elevation_level_1_normal }]}>
|
|
15
|
+
<Text style={[styles.title, { color: colors.fg_neutral_normal }]}>{t('profile.title')}</Text>
|
|
16
|
+
<Button
|
|
17
|
+
label={t('profile.signOut')}
|
|
18
|
+
variant="solid"
|
|
19
|
+
colorScheme="primary"
|
|
20
|
+
onPress={() => clearTokens()}
|
|
21
|
+
/>
|
|
22
|
+
</View>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
container: { flex: 1, padding: 24, gap: 24 },
|
|
28
|
+
title: { fontSize: 22, fontWeight: '600' },
|
|
29
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Script to help link fonts in React Native
|
|
5
|
+
* Fonts are automatically linked when you build the app,
|
|
6
|
+
* but this script helps verify configuration and prepare for linking
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
|
|
12
|
+
const fontsDir = path.join(__dirname, '../../src/assets/fonts');
|
|
13
|
+
const configFile = path.join(__dirname, '../../react-native.config.js');
|
|
14
|
+
|
|
15
|
+
console.log('š Checking font configuration...\n');
|
|
16
|
+
|
|
17
|
+
// Check if fonts directory exists
|
|
18
|
+
if (!fs.existsSync(fontsDir)) {
|
|
19
|
+
console.error('ā Fonts directory not found:', fontsDir);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// List all font files
|
|
24
|
+
const fontFiles = fs.readdirSync(fontsDir).filter(file =>
|
|
25
|
+
file.endsWith('.ttf') || file.endsWith('.otf')
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (fontFiles.length === 0) {
|
|
29
|
+
console.warn('ā ļø No font files found in:', fontsDir);
|
|
30
|
+
console.log(' Please add your font files (.ttf or .otf) to this directory.\n');
|
|
31
|
+
} else {
|
|
32
|
+
console.log(`ā
Found ${fontFiles.length} font file(s):`);
|
|
33
|
+
fontFiles.forEach(file => {
|
|
34
|
+
console.log(` - ${file}`);
|
|
35
|
+
});
|
|
36
|
+
console.log('');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check react-native.config.js
|
|
40
|
+
if (fs.existsSync(configFile)) {
|
|
41
|
+
const configContent = fs.readFileSync(configFile, 'utf8');
|
|
42
|
+
if (configContent.includes('./src/assets/fonts')) {
|
|
43
|
+
console.log('ā
react-native.config.js is configured correctly');
|
|
44
|
+
} else {
|
|
45
|
+
console.warn('ā ļø react-native.config.js might not include fonts path');
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
console.error('ā react-native.config.js not found');
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
console.log('\nš Next steps:');
|
|
53
|
+
console.log(' 1. For iOS: Run "cd ios && pod install" (if needed)');
|
|
54
|
+
console.log(' 2. Rebuild your app:');
|
|
55
|
+
console.log(' - iOS: npm run ios');
|
|
56
|
+
console.log(' - Android: npm run android');
|
|
57
|
+
console.log('\n⨠Fonts will be automatically linked when you build the app!\n');
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
|
|
4
|
+
function sync(dir) {
|
|
5
|
+
console.log('*** Sync images ***')
|
|
6
|
+
|
|
7
|
+
const imageDirs = fs
|
|
8
|
+
.readdirSync(dir, {withFileTypes: true})
|
|
9
|
+
.filter(f => f.name.includes('.png') || f.name.includes('.jpg'))
|
|
10
|
+
.map(f => {
|
|
11
|
+
const [fileName, type] = f.name.split('.')
|
|
12
|
+
const [name] = fileName.split('@')
|
|
13
|
+
return `${name}.${type}`
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const imageDirsUnique = [...new Set(imageDirs)]
|
|
17
|
+
|
|
18
|
+
const images = imageDirsUnique.map(imageDir => {
|
|
19
|
+
const parts = imageDir.split('-')
|
|
20
|
+
let name = ''
|
|
21
|
+
for (let i = 0; i < parts.length; i++) {
|
|
22
|
+
name +=
|
|
23
|
+
parts[i][0].toUpperCase() +
|
|
24
|
+
parts[i].substring(1, parts[i].length)
|
|
25
|
+
}
|
|
26
|
+
return 'Img' + name
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const imports = imageDirsUnique.reduce((ret, imageDir, idx) => {
|
|
30
|
+
const [image] = images[idx].split('.')
|
|
31
|
+
return (
|
|
32
|
+
ret +
|
|
33
|
+
`import ${image} from './${imageDir}'` +
|
|
34
|
+
(idx !== imageDirsUnique.length - 1 ? '\n' : '')
|
|
35
|
+
)
|
|
36
|
+
}, '')
|
|
37
|
+
|
|
38
|
+
const exports = images.reduce((ret, img, idx) => {
|
|
39
|
+
const [name] = img.split('.')
|
|
40
|
+
return ret + ` ${name},\n` + (idx === images.length - 1 ? '}\n' : '')
|
|
41
|
+
}, 'export {\n')
|
|
42
|
+
|
|
43
|
+
if (images.length === 0) {
|
|
44
|
+
return '\n// Export\nexport {}'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return `// Image\n${imports}\n\n// Export\n${exports}`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const imagesPath = path.join(__dirname, '../assets/Images')
|
|
51
|
+
|
|
52
|
+
let output = sync(imagesPath)
|
|
53
|
+
|
|
54
|
+
fs.writeFile(path.join(__dirname, '../assets/Images/index.ts'), output, err =>
|
|
55
|
+
console.log(`Sync images ${err ? 'failed: ' + err : 'succeeded'}`),
|
|
56
|
+
)
|