boilerplate completed

pull/1/head
hamed 3 years ago
parent 003561703c
commit f2cacf9e26
  1. 48
      App.js
  2. 553
      ios/Podfile.lock
  3. 149
      ios/rn_danovin.xcodeproj/project.pbxproj
  4. 10
      ios/rn_danovin.xcworkspace/contents.xcworkspacedata
  5. 38
      navigation.js
  6. 10996
      package-lock.json
  7. 6
      package.json
  8. 1
      src/actions/actionTypes.js
  9. 137
      src/components/AlertModal.js
  10. 9
      src/constants/defaultValues.js
  11. 25
      src/navigation.js
  12. 29
      src/reducers/DefaultReducer.js
  13. 11
      src/reducers/index.js
  14. 14
      src/router.js
  15. 0
      src/screens/AR/index.js
  16. 0
      src/screens/Activation/index.js
  17. 0
      src/screens/Blog/index.js
  18. 0
      src/screens/Blogs/index.js
  19. 0
      src/screens/Chat/index.js
  20. 0
      src/screens/Contact/index.js
  21. 0
      src/screens/Home/index.js
  22. 0
      src/screens/Login/index.js
  23. 0
      src/screens/OrdersFollowUp/index.js
  24. 13
      src/screens/Otp/index.js
  25. 0
      src/screens/Product/index.js
  26. 0
      src/screens/Products/index.js
  27. 0
      src/screens/Profile/index.js
  28. 0
      src/screens/QR/index.js
  29. 0
      src/screens/ShoppingCart/index.js
  30. 29
      src/screens/Splash/index.js
  31. 0
      src/screens/Support/index.js
  32. 4
      src/services/api/config.js
  33. 118
      src/services/api/fetch-retry.js
  34. 139
      src/services/api/index.js
  35. 203
      src/services/api/oldindex.js
  36. 147
      src/services/api/utils.js
  37. 31
      src/states/actions/activation.js
  38. 19
      src/states/actions/blog.js
  39. 37
      src/states/actions/book.js
  40. 35
      src/states/actions/chat.js
  41. 40
      src/states/actions/comment.js
  42. 22
      src/states/actions/file.js
  43. 14
      src/states/actions/index.js
  44. 13
      src/states/actions/message.js
  45. 29
      src/states/actions/public.js
  46. 32
      src/states/actions/qr.js
  47. 37
      src/states/actions/transport.js
  48. 61
      src/states/actions/user.js
  49. 41
      src/states/actions/userFactor.js
  50. 38
      src/states/actions/userProduct.js
  51. 7
      src/states/index.js
  52. 121
      src/states/proxy.js
  53. 32
      src/states/reducers/activation.js
  54. 28
      src/states/reducers/blog.js
  55. 127
      src/states/reducers/book.js
  56. 25
      src/states/reducers/chat.js
  57. 35
      src/states/reducers/comment.js
  58. 26
      src/states/reducers/file.js
  59. 14
      src/states/reducers/index.js
  60. 16
      src/states/reducers/message.js
  61. 186
      src/states/reducers/public.js
  62. 34
      src/states/reducers/qr.js
  63. 32
      src/states/reducers/transport.js
  64. 66
      src/states/reducers/user.js
  65. 51
      src/states/reducers/userFactor.js
  66. 53
      src/states/reducers/userProduct.js
  67. 13
      src/states/store.js
  68. 55
      src/utils/AsyncWrappers.js
  69. 12
      src/utils/debounceFunction.js
  70. 17
      src/utils/dimension.js
  71. 9
      src/utils/message.js

@ -8,18 +8,58 @@ import {
StyleSheet,
useColorScheme,
} from 'react-native';
import { Provider } from 'react-redux';
import { applyMiddleware, createStore, compose } from 'redux';
import { createLogger } from 'redux-logger';
import thunk from 'redux-thunk';
import { persistStore, persistReducer } from 'redux-persist';
import AsyncStorage from '@react-native-community/async-storage';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import allReducers from './src/reducers';
import Navigator from './navigation';
import AlertModal from './src/components/AlertModal';
import {
Colors,
} from 'react-native/Libraries/NewAppScreen';
import Navigator from './src/navigation';
const persistConfig = {
key: 'root',
storage: AsyncStorage,
stateReconciler: autoMergeLevel2, // see "Merge Process" section for details.
whitelist: ['profile'],
};
const pReducer = persistReducer(persistConfig, allReducers);
const middleWare = [];
middleWare.push(thunk);
const loggerMiddleware = createLogger({
predicate: () => process.env.NODE_ENV === 'development',
});
middleWare.push(loggerMiddleware);
const store = createStore(pReducer, compose(applyMiddleware(...middleWare)));
const persistor = persistStore(store);
const ReactNative = require('react-native');
try {
ReactNative.I18nManager.allowRTL(false);
enableScreens();
} catch (e) {
console.log(e);
}
console.disableYellowBox = true;
const App = () => {
const isDarkMode = useColorScheme() === 'dark';
return (
<Provider store={store}>
<Navigator />
<AlertModal />
</Provider>
);
};

@ -0,0 +1,553 @@
PODS:
- boost-for-react-native (1.63.0)
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- FBLazyVector (0.65.1)
- FBReactNativeSpec (0.65.1):
- RCT-Folly (= 2021.04.26.00)
- RCTRequired (= 0.65.1)
- RCTTypeSafety (= 0.65.1)
- React-Core (= 0.65.1)
- React-jsi (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- Flipper (0.93.0):
- Flipper-Folly (~> 2.6)
- Flipper-RSocket (~> 1.4)
- Flipper-Boost-iOSX (1.76.0.1.11)
- Flipper-DoubleConversion (3.1.7)
- Flipper-Fmt (7.1.7)
- Flipper-Folly (2.6.7):
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt (= 7.1.7)
- Flipper-Glog
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.180)
- Flipper-Glog (0.3.6)
- Flipper-PeerTalk (0.0.4)
- Flipper-RSocket (1.4.3):
- Flipper-Folly (~> 2.6)
- FlipperKit (0.93.0):
- FlipperKit/Core (= 0.93.0)
- FlipperKit/Core (0.93.0):
- Flipper (~> 0.93.0)
- FlipperKit/CppBridge
- FlipperKit/FBCxxFollyDynamicConvert
- FlipperKit/FBDefines
- FlipperKit/FKPortForwarding
- FlipperKit/CppBridge (0.93.0):
- Flipper (~> 0.93.0)
- FlipperKit/FBCxxFollyDynamicConvert (0.93.0):
- Flipper-Folly (~> 2.6)
- FlipperKit/FBDefines (0.93.0)
- FlipperKit/FKPortForwarding (0.93.0):
- CocoaAsyncSocket (~> 7.6)
- Flipper-PeerTalk (~> 0.0.4)
- FlipperKit/FlipperKitHighlightOverlay (0.93.0)
- FlipperKit/FlipperKitLayoutHelpers (0.93.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutTextSearchable
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.93.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutPlugin (0.93.0):
- FlipperKit/Core
- FlipperKit/FlipperKitHighlightOverlay
- FlipperKit/FlipperKitLayoutHelpers
- FlipperKit/FlipperKitLayoutIOSDescriptors
- FlipperKit/FlipperKitLayoutTextSearchable
- YogaKit (~> 1.18)
- FlipperKit/FlipperKitLayoutTextSearchable (0.93.0)
- FlipperKit/FlipperKitNetworkPlugin (0.93.0):
- FlipperKit/Core
- FlipperKit/FlipperKitReactPlugin (0.93.0):
- FlipperKit/Core
- FlipperKit/FlipperKitUserDefaultsPlugin (0.93.0):
- FlipperKit/Core
- FlipperKit/SKIOSNetworkPlugin (0.93.0):
- FlipperKit/Core
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- glog (0.3.5)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.180)
- RCT-Folly (2021.04.26.00):
- boost-for-react-native
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCT-Folly/Default (= 2021.04.26.00)
- RCT-Folly/Default (2021.04.26.00):
- boost-for-react-native
- DoubleConversion
- fmt (~> 6.2.1)
- glog
- RCTRequired (0.65.1)
- RCTTypeSafety (0.65.1):
- FBLazyVector (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- RCTRequired (= 0.65.1)
- React-Core (= 0.65.1)
- React (0.65.1):
- React-Core (= 0.65.1)
- React-Core/DevSupport (= 0.65.1)
- React-Core/RCTWebSocket (= 0.65.1)
- React-RCTActionSheet (= 0.65.1)
- React-RCTAnimation (= 0.65.1)
- React-RCTBlob (= 0.65.1)
- React-RCTImage (= 0.65.1)
- React-RCTLinking (= 0.65.1)
- React-RCTNetwork (= 0.65.1)
- React-RCTSettings (= 0.65.1)
- React-RCTText (= 0.65.1)
- React-RCTVibration (= 0.65.1)
- React-callinvoker (0.65.1)
- React-Core (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default (= 0.65.1)
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/CoreModulesHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/Default (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/DevSupport (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default (= 0.65.1)
- React-Core/RCTWebSocket (= 0.65.1)
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-jsinspector (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTActionSheetHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTAnimationHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTBlobHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTImageHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTLinkingHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTNetworkHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTSettingsHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTTextHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTVibrationHeaders (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-Core/RCTWebSocket (0.65.1):
- glog
- RCT-Folly (= 2021.04.26.00)
- React-Core/Default (= 0.65.1)
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsiexecutor (= 0.65.1)
- React-perflogger (= 0.65.1)
- Yoga
- React-CoreModules (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- RCTTypeSafety (= 0.65.1)
- React-Core/CoreModulesHeaders (= 0.65.1)
- React-jsi (= 0.65.1)
- React-RCTImage (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-cxxreact (0.65.1):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.04.26.00)
- React-callinvoker (= 0.65.1)
- React-jsi (= 0.65.1)
- React-jsinspector (= 0.65.1)
- React-perflogger (= 0.65.1)
- React-runtimeexecutor (= 0.65.1)
- React-jsi (0.65.1):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.04.26.00)
- React-jsi/Default (= 0.65.1)
- React-jsi/Default (0.65.1):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.04.26.00)
- React-jsiexecutor (0.65.1):
- DoubleConversion
- glog
- RCT-Folly (= 2021.04.26.00)
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-perflogger (= 0.65.1)
- React-jsinspector (0.65.1)
- react-native-restart (0.0.22):
- React-Core
- react-native-safe-area-context (3.3.2):
- React-Core
- React-perflogger (0.65.1)
- React-RCTActionSheet (0.65.1):
- React-Core/RCTActionSheetHeaders (= 0.65.1)
- React-RCTAnimation (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- RCTTypeSafety (= 0.65.1)
- React-Core/RCTAnimationHeaders (= 0.65.1)
- React-jsi (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-RCTBlob (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- React-Core/RCTBlobHeaders (= 0.65.1)
- React-Core/RCTWebSocket (= 0.65.1)
- React-jsi (= 0.65.1)
- React-RCTNetwork (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-RCTImage (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- RCTTypeSafety (= 0.65.1)
- React-Core/RCTImageHeaders (= 0.65.1)
- React-jsi (= 0.65.1)
- React-RCTNetwork (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-RCTLinking (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- React-Core/RCTLinkingHeaders (= 0.65.1)
- React-jsi (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-RCTNetwork (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- RCTTypeSafety (= 0.65.1)
- React-Core/RCTNetworkHeaders (= 0.65.1)
- React-jsi (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-RCTSettings (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- RCTTypeSafety (= 0.65.1)
- React-Core/RCTSettingsHeaders (= 0.65.1)
- React-jsi (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-RCTText (0.65.1):
- React-Core/RCTTextHeaders (= 0.65.1)
- React-RCTVibration (0.65.1):
- FBReactNativeSpec (= 0.65.1)
- RCT-Folly (= 2021.04.26.00)
- React-Core/RCTVibrationHeaders (= 0.65.1)
- React-jsi (= 0.65.1)
- ReactCommon/turbomodule/core (= 0.65.1)
- React-runtimeexecutor (0.65.1):
- React-jsi (= 0.65.1)
- ReactCommon/turbomodule/core (0.65.1):
- DoubleConversion
- glog
- RCT-Folly (= 2021.04.26.00)
- React-callinvoker (= 0.65.1)
- React-Core (= 0.65.1)
- React-cxxreact (= 0.65.1)
- React-jsi (= 0.65.1)
- React-perflogger (= 0.65.1)
- RNCAsyncStorage (1.12.1):
- React-Core
- RNDeviceInfo (8.4.0):
- React-Core
- RNGestureHandler (1.10.3):
- React-Core
- RNScreens (3.8.0):
- React-Core
- React-RCTImage
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
- Flipper (= 0.93.0)
- Flipper-Boost-iOSX (= 1.76.0.1.11)
- Flipper-DoubleConversion (= 3.1.7)
- Flipper-Fmt (= 7.1.7)
- Flipper-Folly (= 2.6.7)
- Flipper-Glog (= 0.3.6)
- Flipper-PeerTalk (= 0.0.4)
- Flipper-RSocket (= 1.4.3)
- FlipperKit (= 0.93.0)
- FlipperKit/Core (= 0.93.0)
- FlipperKit/CppBridge (= 0.93.0)
- FlipperKit/FBCxxFollyDynamicConvert (= 0.93.0)
- FlipperKit/FBDefines (= 0.93.0)
- FlipperKit/FKPortForwarding (= 0.93.0)
- FlipperKit/FlipperKitHighlightOverlay (= 0.93.0)
- FlipperKit/FlipperKitLayoutPlugin (= 0.93.0)
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.93.0)
- FlipperKit/FlipperKitNetworkPlugin (= 0.93.0)
- FlipperKit/FlipperKitReactPlugin (= 0.93.0)
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.93.0)
- FlipperKit/SKIOSNetworkPlugin (= 0.93.0)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
- React (from `../node_modules/react-native/`)
- React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
- React-Core (from `../node_modules/react-native/`)
- React-Core/DevSupport (from `../node_modules/react-native/`)
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- react-native-restart (from `../node_modules/react-native-restart`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
- React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
- React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
- React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
- React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
- React-RCTText (from `../node_modules/react-native/Libraries/Text`)
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- RNDeviceInfo (from `../node_modules/react-native-device-info`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNScreens (from `../node_modules/react-native-screens`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
trunk:
- boost-for-react-native
- CocoaAsyncSocket
- Flipper
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
- Flipper-Fmt
- Flipper-Folly
- Flipper-Glog
- Flipper-PeerTalk
- Flipper-RSocket
- FlipperKit
- fmt
- libevent
- OpenSSL-Universal
- YogaKit
EXTERNAL SOURCES:
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
FBLazyVector:
:path: "../node_modules/react-native/Libraries/FBLazyVector"
FBReactNativeSpec:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
:path: "../node_modules/react-native/Libraries/RCTRequired"
RCTTypeSafety:
:path: "../node_modules/react-native/Libraries/TypeSafety"
React:
:path: "../node_modules/react-native/"
React-callinvoker:
:path: "../node_modules/react-native/ReactCommon/callinvoker"
React-Core:
:path: "../node_modules/react-native/"
React-CoreModules:
:path: "../node_modules/react-native/React/CoreModules"
React-cxxreact:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
React-jsi:
:path: "../node_modules/react-native/ReactCommon/jsi"
React-jsiexecutor:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
react-native-restart:
:path: "../node_modules/react-native-restart"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
React-perflogger:
:path: "../node_modules/react-native/ReactCommon/reactperflogger"
React-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation:
:path: "../node_modules/react-native/Libraries/NativeAnimation"
React-RCTBlob:
:path: "../node_modules/react-native/Libraries/Blob"
React-RCTImage:
:path: "../node_modules/react-native/Libraries/Image"
React-RCTLinking:
:path: "../node_modules/react-native/Libraries/LinkingIOS"
React-RCTNetwork:
:path: "../node_modules/react-native/Libraries/Network"
React-RCTSettings:
:path: "../node_modules/react-native/Libraries/Settings"
React-RCTText:
:path: "../node_modules/react-native/Libraries/Text"
React-RCTVibration:
:path: "../node_modules/react-native/Libraries/Vibration"
React-runtimeexecutor:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage"
RNDeviceInfo:
:path: "../node_modules/react-native-device-info"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNScreens:
:path: "../node_modules/react-native-screens"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0
FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e
Flipper: b1fddf9a17c32097b2b4c806ad158b2f36bb2692
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a
Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 5337263514dd6f09803962437687240c5dc39aa4
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46
RCTRequired: 6cf071ab2adfd769014b3d94373744ee6e789530
RCTTypeSafety: b829c59453478bb5b02487b8de3336386ab93ab1
React: 29d8a785041b96a2754c25cc16ddea57b7a618ce
React-callinvoker: 2857b61132bd7878b736e282581f4b42fd93002b
React-Core: 001e21bad5ca41e59e9d90df5c0b53da04c3ce8e
React-CoreModules: 0a0410ab296a62ab38e2f8d321e822d1fcc2fe49
React-cxxreact: 8d904967134ae8ff0119c5357c42eaae976806f8
React-jsi: 12913c841713a15f64eabf5c9ad98592c0ec5940
React-jsiexecutor: 43f2542aed3c26e42175b339f8d37fe3dd683765
React-jsinspector: 41e58e5b8e3e0bf061fdf725b03f2144014a8fb0
react-native-restart: d4ea7637e193da7558d229b3704d500ec0d75f9c
react-native-safe-area-context: 5cf05f49df9d17261e40e518481f2e334c6cd4b5
React-perflogger: fd28ee1f2b5b150b00043f0301d96bd417fdc339
React-RCTActionSheet: 7f3fa0855c346aa5d7c60f9ced16e067db6d29fa
React-RCTAnimation: 2119a18ee26159004b001bc56404ca5dbaae6077
React-RCTBlob: a493cc306deeaba0c0efa8ecec2da154afd3a798
React-RCTImage: 54999ddc896b7db6650af5760607aaebdf30425c
React-RCTLinking: 7fb3fa6397d3700c69c3d361870a299f04f1a2e6
React-RCTNetwork: 329ee4f75bd2deb8cf6c4b14231b5bb272cbd9af
React-RCTSettings: 1a659d58e45719bc77c280dbebce6a5a5a2733f5
React-RCTText: e12d7aae2a038be9ae72815436677a7c6549dd26
React-RCTVibration: 92d41c2442e5328cc4d342cd7f78e5876b68bae5
React-runtimeexecutor: 85187f19dd9c47a7c102f9994f9d14e4dc2110de
ReactCommon: eafed38eec7b591c31751bfa7494801618460459
RNCAsyncStorage: cb9a623793918c6699586281f0b51cbc38f046f9
RNDeviceInfo: 99b0a4fc191808e58e0a045640706100fc3d771c
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNScreens: 6e1ea5787989f92b0671049b808aef64fa1ef98c
Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: faba147f20a5b5186a4f2593154201ce5fd6d3db
COCOAPODS: 1.11.2

@ -11,7 +11,9 @@
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
186DACE6731944347DDADC50 /* libPods-rn_danovin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 50566E7583AC574BEBD6612E /* libPods-rn_danovin.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
F517CC37F9387268222C54EA /* libPods-rn_danovin-rn_danovinTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34ABB2DB97F7BCFE445EAAE2 /* libPods-rn_danovin-rn_danovinTests.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -28,12 +30,18 @@
00E356EE1AD99517003FC87E /* rn_danovinTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = rn_danovinTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* rn_danovinTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = rn_danovinTests.m; sourceTree = "<group>"; };
09969D98AA6C4EB625476F6A /* Pods-rn_danovin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_danovin.release.xcconfig"; path = "Target Support Files/Pods-rn_danovin/Pods-rn_danovin.release.xcconfig"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* rn_danovin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = rn_danovin.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = rn_danovin/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = rn_danovin/AppDelegate.m; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = rn_danovin/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = rn_danovin/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = rn_danovin/main.m; sourceTree = "<group>"; };
34ABB2DB97F7BCFE445EAAE2 /* libPods-rn_danovin-rn_danovinTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rn_danovin-rn_danovinTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
415A912903C1C3485971B022 /* Pods-rn_danovin-rn_danovinTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_danovin-rn_danovinTests.release.xcconfig"; path = "Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests.release.xcconfig"; sourceTree = "<group>"; };
49D73F696B67D8E66F819E66 /* Pods-rn_danovin-rn_danovinTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_danovin-rn_danovinTests.debug.xcconfig"; path = "Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests.debug.xcconfig"; sourceTree = "<group>"; };
50566E7583AC574BEBD6612E /* libPods-rn_danovin.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rn_danovin.a"; sourceTree = BUILT_PRODUCTS_DIR; };
51568AED141124553CE42FDE /* Pods-rn_danovin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_danovin.debug.xcconfig"; path = "Target Support Files/Pods-rn_danovin/Pods-rn_danovin.debug.xcconfig"; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = rn_danovin/LaunchScreen.storyboard; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@ -43,6 +51,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F517CC37F9387268222C54EA /* libPods-rn_danovin-rn_danovinTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -50,6 +59,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
186DACE6731944347DDADC50 /* libPods-rn_danovin.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -90,6 +100,8 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
50566E7583AC574BEBD6612E /* libPods-rn_danovin.a */,
34ABB2DB97F7BCFE445EAAE2 /* libPods-rn_danovin-rn_danovinTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
@ -109,6 +121,7 @@
00E356EF1AD99517003FC87E /* rn_danovinTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
C29C5607BEE0756FD7E3E2F7 /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
@ -124,6 +137,18 @@
name = Products;
sourceTree = "<group>";
};
C29C5607BEE0756FD7E3E2F7 /* Pods */ = {
isa = PBXGroup;
children = (
51568AED141124553CE42FDE /* Pods-rn_danovin.debug.xcconfig */,
09969D98AA6C4EB625476F6A /* Pods-rn_danovin.release.xcconfig */,
49D73F696B67D8E66F819E66 /* Pods-rn_danovin-rn_danovinTests.debug.xcconfig */,
415A912903C1C3485971B022 /* Pods-rn_danovin-rn_danovinTests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -131,9 +156,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "rn_danovinTests" */;
buildPhases = (
21E7D69DE7DC52EABDB10D39 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
D6D93BCAD07B9716F361ADA1 /* [CP] Embed Pods Frameworks */,
5DD6A3F12144A20368E7F11A /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -149,11 +177,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rn_danovin" */;
buildPhases = (
6B799893CB055B8CE0B974A8 /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
BE27ABB490D9C60E8E5BFD60 /* [CP] Embed Pods Frameworks */,
7F36AB923C0E35E32CA3CF7A /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -234,6 +265,118 @@
shellPath = /bin/sh;
shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
21E7D69DE7DC52EABDB10D39 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-rn_danovin-rn_danovinTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
5DD6A3F12144A20368E7F11A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
6B799893CB055B8CE0B974A8 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-rn_danovin-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
7F36AB923C0E35E32CA3CF7A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin/Pods-rn_danovin-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin/Pods-rn_danovin-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rn_danovin/Pods-rn_danovin-resources.sh\"\n";
showEnvVarsInLog = 0;
};
BE27ABB490D9C60E8E5BFD60 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin/Pods-rn_danovin-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin/Pods-rn_danovin-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rn_danovin/Pods-rn_danovin-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
D6D93BCAD07B9716F361ADA1 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rn_danovin-rn_danovinTests/Pods-rn_danovin-rn_danovinTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -286,6 +429,7 @@
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 49D73F696B67D8E66F819E66 /* Pods-rn_danovin-rn_danovinTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
@ -312,6 +456,7 @@
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 415A912903C1C3485971B022 /* Pods-rn_danovin-rn_danovinTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
@ -335,6 +480,7 @@
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 51568AED141124553CE42FDE /* Pods-rn_danovin.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
@ -360,6 +506,7 @@
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 09969D98AA6C4EB625476F6A /* Pods-rn_danovin.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
@ -414,6 +561,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@ -478,6 +626,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:rn_danovin.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

@ -0,0 +1,38 @@
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Splash from './src/screens/Splash';
import Home from './src/screens/Home';
import Login from './src/screens/Login';
import Otp from './src/screens/Otp';
import { connect } from 'react-redux';
const mapStateToProps = state => {
return {
profile: state.profile
}
}
const Stack = createNativeStackNavigator();
function Navigator(props) {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen options={{headerShown: false}} name="Splash" component={Splash} />
{!props.profile.token ? (
<>
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Otp" component={Otp} />
</>
) : (
<>
<Stack.Screen name="Home" component={Home} />
</>
)}
</Stack.Navigator>
</NavigationContainer>
);
}
export default connect(mapStateToProps)(Navigator);

10996
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -10,18 +10,24 @@
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.1",
"@react-navigation/native": "^6.0.4",
"@react-navigation/native-stack": "^6.2.2",
"@react-navigation/stack": "^6.0.9",
"axios": "^0.22.0",
"react": "17.0.2",
"react-native": "0.65.1",
"react-native-awesome-alerts": "^1.5.2",
"react-native-device-info": "^8.4.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-restart": "0.0.22",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.8.0",
"react-redux": "^7.2.5",
"redux": "^4.1.1",
"redux-devtools-extension": "^2.13.9",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {

@ -0,0 +1 @@
export const PROFILE_RECORD = 'PROFILE_RECORD';

@ -0,0 +1,137 @@
import React, { useState } from "react"
import AwesomeAlert from 'react-native-awesome-alerts';
const ReactNative = require('react-native');
const AlertModal = props => {
const [alert, setAlert] = useState({
show: false,
showProgress: false,
title: "خطا",
message: "خطای ناشناخته",
closeOnTouchOutside: false,
closeOnHardwareBackPress: false,
showCancelButton: true,
showConfirmButton: true,
cancelText: "بیخیال",
confirmText: "باشه",
confirmButtonColor: "#2980b9",
onCancel: () => {
},
onConfirm: () => {
},
})
const [apiAlert, setApiAlert] = useState({
show: false,
showProgress: false,
title: "خطا",
message: "خطای ناشناخته",
closeOnTouchOutside: false,
closeOnHardwareBackPress: false,
showCancelButton: true,
showConfirmButton: true,
cancelText: "بیخیال",
confirmText: "باشه",
confirmButtonColor: "#2980b9",
onCancel: () => {
},
onConfirm: () => {
},
})
global.globalAlert = (params) => {
setAlert({
...alert,
...params
})
}
global.globalApiAlert = (params) => {
setApiAlert({
...apiAlert,
...params
})
}
function hideAlert() {
setAlert({ ...alert, show: false })
}
function onApiCancelPressed(){
globalApiAlert({ show: false })
apiAlert.onCancel()
}
function onApiConfirmPressed(){
globalApiAlert({ show: false })
apiAlert.onConfirm()
}
function onCancelPressed(){
hideAlert()
alert.onCancel()
}
function onConfirmPressed(){
hideAlert()
alert.onConfirm()
}
return <>
<AwesomeAlert
show={alert.show}
progressColor="red"
showProgress={alert.showProgress}
title={alert.title}
message={alert.message}
closeOnTouchOutside={alert.closeOnTouchOutside}
closeOnHardwareBackPress={alert.closeOnHardwareBackPress}
showCancelButton={alert.showCancelButton}
showConfirmButton={alert.showConfirmButton}
cancelText={alert.cancelText}
confirmText={alert.confirmText}
confirmButtonColor={alert.confirmButtonColor}
onCancelPressed={onCancelPressed}
onConfirmPressed={(onConfirmPressed)}
contentStyle={{
width: ReactNative.Dimensions.get('window').width / 1.5,
}}
confirmButtonStyle={
{
width: ReactNative.Dimensions.get('window').width / 4,
alignItems: 'center',
justifyContent: 'center'
}
}
useNativeDriver={true}
/>
<AwesomeAlert
show={apiAlert.show}
progressColor="red"
showProgress={apiAlert.showProgress}
title={apiAlert.title}
message={apiAlert.message}
closeOnTouchOutside={apiAlert.closeOnTouchOutside}
closeOnHardwareBackPress={apiAlert.closeOnHardwareBackPress}
showCancelButton={apiAlert.showCancelButton}
showConfirmButton={apiAlert.showConfirmButton}
cancelText={apiAlert.cancelText}
confirmText={apiAlert.confirmText}
confirmButtonColor={apiAlert.confirmButtonColor}
onCancelPressed={onApiCancelPressed}
onConfirmPressed={(onApiConfirmPressed)}
contentStyle={{
width: ReactNative.Dimensions.get('window').width / 1.5
}}
confirmButtonStyle={
{
width: ReactNative.Dimensions.get('window').width / 4,
alignItems: 'center',
justifyContent: 'center'
}
}
useNativeDriver={true}
/>
</>
}
export default AlertModal;

@ -1,9 +0,0 @@
export const ApiConfig = {
apiKey: "AIzaSyBBksq-Asxq2M4Ot-75X19IyrEYJqNBPcg",
authDomain: "dnvn.ir",
baseUrl: "https://dnvn.ir/api/v1/",
//baseUrl: 'http://localhost:3030/api/v1',
loginURL: "user/login",
otploginURL: "user/otp/login",
logoutURL: "user/logout",
};

@ -1,25 +0,0 @@
// In App.js in a new project
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Provider } from 'react-redux';
import {store} from './states/store';
import Home from './views/Home/index';
const Stack = createNativeStackNavigator();
function Navigator() {
return (
// <Provider store={store}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" component={Home} />
</Stack.Navigator>
</NavigationContainer>
// </Provider>
);
}
export default Navigator;

@ -0,0 +1,29 @@
export function DefaultReducer(key, initialState = {}) {
return (state = initialState, {type = '', payload = {}}) => {
switch (type) {
case key:
return {...state, ...payload};
}
return state;
};
}
export function buildAction(id) {
return function(payload) {
return {
type: id,
payload: payload,
};
};
}
export function buildActionForKey(id, key) {
return function(payload) {
let result = {
type: id,
payload: {},
};
result.payload[key] = payload;
return result;
};
}

@ -0,0 +1,11 @@
import {combineReducers} from 'redux';
import {DefaultReducer} from './DefaultReducer';
import * as action from '../actions/actionTypes';
const allReducers = combineReducers({
profile: DefaultReducer(action.PROFILE_RECORD, {
isLogin: false,
}),
});
export default allReducers;

@ -1,14 +0,0 @@
import { createStackNavigator } from '@react-navigation/stack';
const Stack = createStackNavigator();
function MyStack() {
return (
<Stack.Navigator>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Notifications" component={Notifications} />
<Stack.Screen name="Profile" component={Profile} />
<Stack.Screen name="Settings" component={Settings} />
</Stack.Navigator>
);
}

@ -0,0 +1,13 @@
import React from 'react'
import { View, Text } from 'react-native';
import {connect} from 'react-redux';
function Otp({}) {
return (
<View>
<Text></Text>
</View>
)
}
export default Otp;

@ -0,0 +1,29 @@
import React, {useEffect} from 'react'
import { View, Text } from 'react-native';
import {connect} from 'react-redux';
const mapStateToProps = state => {
return {
profile: state.profile
}
}
function Splash({navigation, profile}) {
useEffect(() => {
setTimeout(() => {
!profile.token ? navigation.reset({
index: 0,
routes: [{ name: 'Login' }],
}) : navigation.navigate('Home')
}, 2000)
}, [])
return (
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Text>Splash</Text>
</View>
)
}
export default connect(mapStateToProps)(Splash);

@ -0,0 +1,4 @@
export default {
dev: 'https://dnvn.ir/api/v1/',
splash: 'https://topsito.ir/api/v1.1',
};

@ -0,0 +1,118 @@
'use strict';
module.exports = function (fetch, defaults) {
defaults = defaults || {};
if (typeof fetch !== 'function') {
throw new ArgumentError('fetch must be a function');
}
if (typeof defaults !== 'object') {
throw new ArgumentError('defaults must be an object');
}
if (defaults.retries !== undefined && !isPositiveInteger(defaults.retries)) {
throw new ArgumentError('retries must be a positive integer');
}
if (defaults.retryDelay !== undefined && !isPositiveInteger(defaults.retryDelay) && typeof defaults.retryDelay !== 'function') {
throw new ArgumentError('retryDelay must be a positive integer or a function returning a positive integer');
}
if (defaults.retryOn !== undefined && !Array.isArray(defaults.retryOn) && typeof defaults.retryOn !== 'function') {
throw new ArgumentError('retryOn property expects an array or function');
}
var baseDefaults = {
retries: 3,
retryDelay: 1000,
retryOn: [500, 502, 503, 504],
};
defaults = Object.assign(baseDefaults, defaults);
return function fetchRetry(input, init) {
var retries = defaults.retries;
var retryDelay = defaults.retryDelay;
var retryOn = defaults.retryOn;
if (init && init.retries !== undefined) {
if (isPositiveInteger(init.retries)) {
retries = init.retries;
} else {
throw new ArgumentError('retries must be a positive integer');
}
}
if (init && init.retryDelay !== undefined) {
if (isPositiveInteger(init.retryDelay) || (typeof init.retryDelay === 'function')) {
retryDelay = init.retryDelay;
} else {
throw new ArgumentError('retryDelay must be a positive integer or a function returning a positive integer');
}
}
if (init && init.retryOn) {
if (Array.isArray(init.retryOn) || (typeof init.retryOn === 'function')) {
retryOn = init.retryOn;
} else {
throw new ArgumentError('retryOn property expects an array or function');
}
}
// eslint-disable-next-line no-undef
return new Promise(function (resolve, reject) {
var wrappedFetch = function (attempt) {
fetch(input, init)
.then(function (response) {
if (Array.isArray(retryOn) && retryOn.indexOf(response.status) === -1) {
resolve(response);
} else if (typeof retryOn === 'function') {
if (retryOn(attempt, null, response)) {
retry(attempt, null, response);
} else {
resolve(response);
}
} else {
if (attempt < retries) {
retry(attempt, null, response);
} else {
resolve(response);
}
}
})
.catch(function (error) {
if (typeof retryOn === 'function') {
if (retryOn(attempt, error, null)) {
retry(attempt, error, null);
} else {
reject(error);
}
} else if (attempt < retries) {
retry(attempt, error, null);
} else {
reject(error);
}
});
};
function retry(attempt, error, response) {
var delay = (typeof retryDelay === 'function') ?
retryDelay(attempt, error, response) : retryDelay;
setTimeout(function () {
wrappedFetch(++attempt);
}, delay);
}
wrappedFetch(0);
});
};
};
function isPositiveInteger(value) {
return Number.isInteger(value) && value >= 0;
}
function ArgumentError(message) {
this.name = 'ArgumentError';
this.message = message;
}

@ -0,0 +1,139 @@
import {Alert} from 'react-native';
import {toastMessage} from '../../utils/message';
import {
restartApp,
getToken,
deviceHeaders,
getUrl,
isUnexpected,
renewTokenHandler,
resetApp,
networkAlert,
unexpectedAlert,
} from './utils';
import FetchRetry from './fetch-retry';
import {asyncApiAwesomeAlert} from '../../utils/AsyncWrappers';
const fetchRetry = FetchRetry(fetch, {});
let deviceInfo;
export async function fetchApi(
endPoint,
payload = {},
method = 'GET',
headers = {},
isS = false,
splash = false,
dev = 'production',
) {
var timeout = setTimeout(() => {
console.log(endPoint, ' TIMEOUT ');
asyncApiAwesomeAlert('خطای ارتباط', '. لطفا اینترنت خود را بررسی کنید .').then(
async () => await fetchApi(endPoint, payload, method, headers, isS),
);
}, 30000);
if (!deviceInfo) {
deviceInfo = await deviceHeaders();
if (!deviceInfo) {
deviceInfo = [];
}
}
let options = {
method,
headers: {
Accept: 'application/json;charset=utf-8',
'Content-Type': 'application/json;charset=utf-8',
Authorization: await getToken(),
...deviceInfo,
...headers,
},
};
if (['POST', 'PUT'].includes(method)) {
options.body = JSON.stringify(payload);
}
try {
// console.log('req', await getUrl(endPoint), options)
let res = await fetchRetry(await getUrl(endPoint, dev), options);
clearTimeout(timeout);
let statusCode = res.status;
// console.log('RES', { statusCode, url: await getUrl(endPoint) })
if (isUnexpected(statusCode)) {
console.log('unexpected', await res.json());
console.log('RES-unexpected', {statusCode, url: await getUrl(endPoint)});
let check = await unexpectedAlert();
return await fetchApi(
endPoint,
payload,
method,
headers,
isS,
false,
true,
);
}
let {data, error, status} = await res.json();
if (res.ok) {
return data;
}
if (!res.ok) {
if (data.hasOwnProperty('message')) {
toastMessage(data.message);
}
if (statusCode === 403) {
console.log('req-401', await getUrl(endPoint), options);
return resetApp();
}
if (statusCode === 401) {
let checkRenew = await renewTokenHandler();
if (!checkRenew.ok && checkRenew.restart) {
console.log('req-401', await getUrl(endPoint), options);
resetApp();
} else if (!checkRenew.ok) {
console.log('req-401', await getUrl(endPoint), options);
restartApp();
}
return await fetchApi(endPoint, payload, method, headers, isS, splash);
}
if (statusCode === 400) {
return error;
}
return data;
}
} catch (err) {
clearTimeout(timeout);
console.log('catch', endPoint, err);
// global.globalAlert({
// show: true
// })
let check = await networkAlert();
return await fetchApi(endPoint, payload, method, headers, isS);
}
}
/**
* next version of fetch API
* @param {String} endPoint
* @param {Object} options
* @param {string} options.method
* @param {string} options.payload
* @param {string} options.headers
* @param {Boolean} options.splash
*/
export async function nextFetchApi(endPoint, options = {}) {
let {payload, method, headers, isS, splash} = options;
try {
let res = await fetchApi(endPoint, payload, method, headers, isS, splash);
return {
ok: true,
data: res,
};
} catch (error) {
return {
ok: false,
data: error,
};
}
}

@ -0,0 +1,203 @@
/* global fetch */
import apiConfig from './config';
import {
AsyncStorage,
Alert,
AlertIOS,
Platform,
ToastAndroid,
} from 'react-native';
import {toastMessage} from '../../utils/message';
import RNRestart from 'react-native-restart';
import config from './config';
import Refresh from './fetch-retry';
import FetchRetry from './fetch-retry';
let fetchRetry = FetchRetry(fetch, {});
function restartApp() {
AsyncStorage.setItem('UID_USER', JSON.stringify({}), () => {
RNRestart.Restart();
});
}
export function fetchApi(
endPoint,
payload = {},
method = 'GET',
headers = {},
isS = false,
splash = false,
) {
return new Promise((resolve, reject) => {
var timeout = setTimeout(() => {
console.log(endPoint, ' TIMEOUT ');
Alert.alert('خطای ارتباط', 'خطایی ارتباط با سرور پیش امده .', [
{
text: 'تلاش مجدد',
onPress: () =>
resolve(fetchApi(endPoint, payload, method, headers, isS)),
},
]);
}, 10000);
AsyncStorage.getItem('UID_USER', (err, result) => {
var tokens = '';
var refreshTokens = '';
var userDATA = JSON.parse(result);
var headrsRequest = {};
if (
userDATA != null &&
userDATA.token != null &&
userDATA.token != '' &&
isS
) {
tokens = userDATA.token;
refreshTokens = userDATA.refresh_token;
headers = {
Authorization: 'Bearer ' + tokens,
};
}
if (method === 'POST' || method === 'PUT') {
headrsRequest = {
method: method,
headers: {
Accept: 'application/json;charset=utf-8',
'Content-Type': 'application/json;charset=utf-8',
...headers,
},
body: JSON.stringify(payload),
};
} else {
headrsRequest = {
method: method,
headers: {
Accept: 'application/json;charset=utf-8',
'Content-Type': 'application/json;charset=utf-8',
...headers,
},
};
}
AsyncStorage.getItem('SPLASH_DATA', (err, result) => {
var splashDATA = JSON.parse(result);
var baseUrl;
if (endPoint.includes('splash')) {
baseUrl = apiConfig.splash;
} else {
var baseUrl = splashDATA.base_urls.backend + '/v1.1';
}
fetchRetry(`${baseUrl}${endPoint}`, headrsRequest)
.then(response => {
const statusCode = response.status;
const data = response.json();
return Promise.all([statusCode, data]);
})
.then(([statusCode, data]) => {
console.log(baseUrl + endPoint, statusCode, data);
if (data.hasOwnProperty('message')) {
toastMessage(data.message);
}
if (statusCode === 403) {
clearTimeout(timeout);
restartApp();
}
if (statusCode === 401) {
clearTimeout(timeout);
var dataaaaa = {
method: 'POST',
body: JSON.stringify({
refresh_token: refreshTokens,
}),
headers: {
Accept: 'application/json;charset=utf-8',
'Content-Type': 'application/json;charset=utf-8',
},
};
fetchRetry(`${baseUrl}/auth/renew-token`, dataaaaa)
.then(response1 => {
const statusCode1 = response1.status;
const data1 = response1.json();
return Promise.all([statusCode1, data1]);
})
.then(([statusCode1, data1]) => {
console.log(
'refresh token call and response is ',
statusCode1,
data1,
refreshTokens,
);
if (statusCode1 == 200) {
userDATA.token = data1.data.token;
AsyncStorage.setItem(
'UID_USER',
JSON.stringify(userDATA),
() => {
resolve(
fetchApi(endPoint, payload, method, headers, isS),
);
},
);
} else {
restartApp();
}
})
.catch(e => restartApp());
}
if (statusCode === 400) {
toastMessage(data.error.message);
clearTimeout(timeout);
reject(data.error);
}
if (statusCode === 200) {
clearTimeout(timeout);
resolve(data.data);
}
if (statusCode === 201) {
clearTimeout(timeout);
resolve(data.data);
}
return data;
})
.catch(async e => {
console.log('e', error.message);
let res = await neto();
if (e.networkError) {
toastMessage('اشکال در اتصال اینترنت دوباره تلاش کنید .');
Alert.alert(
'اینترنت',
'اشکال در اتصال اینترنت دوباره تلاش کنید .',
[
{
text: 'تلاش مجدد',
onPress: () =>
resolve(
fetchApi(endPoint, payload, method, headers, isS),
),
},
{text: 'بیخیال', onPress: () => reject(e)},
],
);
}
});
});
});
});
}

@ -0,0 +1,147 @@
import RNRestart from 'react-native-restart';
import { toastMessage } from "../../utils/message"
import { asyncAlert, asyncAwesomeAlert, asyncApiAwesomeAlert } from "../../utils/AsyncWrappers";
import AsyncStorage from '@react-native-community/async-storage'
import DeviceInfo from 'react-native-device-info';
import {
ImageBackground,
Text,
Image,
View,
SafeAreaView,
StyleSheet,
BackHandler,
Platform
} from 'react-native';
import apiConfig from './config';
import FetchRetry from './fetch-retry'
import { nextFetchApi } from '.';
const fetchRetry = FetchRetry(fetch, {})
export const restartApp = () => {
RNRestart.Restart()
}
export const resetApp = () => {
AsyncStorage.setItem('UID_USER', JSON.stringify({}), () => {
RNRestart.Restart()
});
}
export const networkAlert = async () => {
return await asyncApiAwesomeAlert("خطا", "خطا در اتصال به اینترنت", {
confirmText: "تلاش مجدد"
})
}
export const unexpectedAlert = async () => {
return await asyncApiAwesomeAlert("خطا", "خطای داخلی سرور!", {
confirmText: "تلاش مجدد"
})
// return await asyncAlert("خطا","خطای داخلی سرور!", [
// { text: "تلاش مجدد", value: 'retry' },
// // { text: "بیخیال", value: 'ignore' }
// ])
}
export const getToken = async () => {
let user = await AsyncStorage.getItem('UID_USER')
if (!user) return ''
let { token } = JSON.parse(user)
if (!token) {
return ''
}
return 'Bearer ' + token
}
export const deviceHeaders = async () => {
return {
'dev-os': Platform.OS,
'dev-app-version': '1.6.0',
'dev-os-version': Platform.Version + '',
'dev-phone-manufacturer': DeviceInfo.getBrand(),
'dev-phone-model': await DeviceInfo.getDeviceName(),
'dev-phone-hash': DeviceInfo.getUniqueId(),
}
}
export const getUrl = async (endpoint, dev) => {
if (endpoint.includes('splash')) {
if (dev === 'dev') {
return apiConfig.dev + endpoint
}
return apiConfig.splash + endpoint
}
let base_urls = await getBaseUrls()
return `${base_urls.backend}/v1.1${endpoint}`
}
export const isUnexpected = (statusCode) => {
if (![200, 201, 400, 401, 403].includes(statusCode)) return true
return false
}
export const renewTokenHandler = async () => {
try {
let splashData = JSON.parse(await AsyncStorage.getItem('UID_USER'))
if (!splashData || !splashData.refresh_token) {
return {
ok: false,
restart: true
}
}
const options = {
method: 'POST',
body: JSON.stringify({
refresh_token: splashData.refresh_token
}),
headers: {
Accept: 'application/json;charset=utf-8',
'Content-Type': 'application/json;charset=utf-8'
}
}
let res = await fetchRetry(await getUrl('/auth/renew-token'), options)
let { data } = await res.json()
const statusCode = res.status
if (statusCode == 200) {
splashData.token = data.token
await AsyncStorage.setItem('UID_USER', JSON.stringify(splashData))
return {
ok: true
}
}
if (statusCode == 400) {
return {
ok: false,
restart: true
}
}
return {
ok: false
}
} catch (error) {
return {
ok: false
}
}
}
export const getBaseUrls = async () => {
let { base_urls } = JSON.parse((await AsyncStorage.getItem('SPLASH_DATA')))
return base_urls
}
export const getCachedProfile = async () => {
return JSON.parse(await AsyncStorage.getItem('UID_USER'))
}
export const cacheProfile = async () => {
let data = await getProfile()
let oldData = await getCachedProfile()
if (data) {
await AsyncStorage.removeItem('UID_USER')
await AsyncStorage.setItem('UID_USER', JSON.stringify({
...oldData,
...data
}))
}
}
export const getProfile = async () => {
let { ok, data } = await nextFetchApi('/profile?with_details=1&no_cache=1')
if (!ok) return null
return data
}

@ -1,31 +0,0 @@
import proxy from "../proxy";
const activation = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("activation/list", data, { dispatch }),
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("activation/update", data);
await proxy.get("activation/list", data2, { dispatch });
},
updateStatus:
(data = {}) =>
async (dispatch) => {
await proxy.put("activation/updateStatus", data, { dispatch });
},
add:
(data = {}) =>
async (dispatch) => {
await proxy.post("activation/add", data);
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("activation/delete", data);
await proxy.get("activation/list", data2, { dispatch });
},
};
export default activation;

@ -1,19 +0,0 @@
import proxy from '../proxy';
const blog = {
list: (data = {}) => async (dispatch) =>
await proxy.get('blog/list', data, { dispatch }),
update: (data = {}, data2 = {}) => async (dispatch) => {
await proxy.put('blog/update', data);
await proxy.get('blog/list', data2, { dispatch });
},
add: (data = {}, data2 = {}) => async (dispatch) => {
await proxy.post('blog/add', data);
await proxy.get('blog/list', data2, { dispatch });
},
del: (data = {}, data2 = {}) => async (dispatch) => {
await proxy.delete('blog/delete', data);
await proxy.get('blog/list', data2, { dispatch });
},
};
export default blog;

@ -1,37 +0,0 @@
import proxy from "../proxy";
const book = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("book/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch) =>
await proxy.get("book/info", data, { dispatch }),
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("book/update", data);
await proxy.get("book/list", data2, { dispatch });
},
add:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("book/add", data);
await proxy.get("book/list", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("book/delete", data);
await proxy.get("book/list", data2, { dispatch });
},
searchBook: (data) => async (dispatch) => {
dispatch({ type: "book/search", data: data });
},
filterBook: (data) => async (dispatch) => {
dispatch({ type: "book/filter", data: data });
},
};
export default book;

@ -1,35 +0,0 @@
import proxy from "../proxy";
const chat = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("chat/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch) =>
await proxy.get("chat/info", data, { dispatch }),
bio:
(data = {}) =>
async (dispatch) =>
await proxy.get("chat/bio", data, { dispatch }),
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("blog/update", data);
await proxy.get("blog/list", data2, { dispatch });
},
add:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("blog/add", data);
await proxy.get("blog/list", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("blog/delete", data);
await proxy.get("blog/list", data2, { dispatch });
},
};
export default chat;

@ -1,40 +0,0 @@
import proxy from "../proxy";
const comment = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("comment/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch) => {
await proxy.get("comment/info", data, { dispatch });
},
add:
(
data = {},
data2 = {
id: window.location.pathname.slice(
window.location.pathname.lastIndexOf("/") + 1,
window.location.pathname.length
),
}
) =>
async (dispatch) => {
await proxy.post("comment/add", data);
await proxy.get("book/info", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("ar/delete", data);
await proxy.get("ar/list", data2, { dispatch });
},
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("ar/update", data);
await proxy.get("ar/list", data2, { dispatch });
},
};
export default comment;

@ -1,22 +0,0 @@
import proxy from "../proxy";
const file = {
upload:
(data = {}) =>
async (dispatch) => {
var formData = new FormData();
for (let key in data) formData.append(key, data[key]);
return await proxy.post(
"file/upload",
formData,
{
dispatch,
headers: {
"Content-Type": "multipart/form-data",
},
},
data
);
},
};
export default file;

@ -1,14 +0,0 @@
// @create-index
export { default as chat } from "./chat.js";
// export { default as message } from './message.js';
export { default as publicApi } from "./public.js";
export { default as user } from "./user.js";
export { default as qr } from "./qr.js";
export { default as book } from "./book.js";
export { default as userProduct } from "./userProduct.js";
export { default as userFactor } from "./userFactor.js";
export { default as transport } from "./transport.js";
export { default as comment } from "./comment.js";
export { default as activation } from "./activation.js";
export { default as file } from "./file.js";

@ -1,13 +0,0 @@
import proxy from '../proxy';
export const list =
(data = {}) =>
async (dispatch) =>
(await proxy.get('message/list', data)).dispatch(dispatch);
export const send =
(data = {}) =>
async (dispatch) =>
(await proxy.post('message/send', data)).dispatch(dispatch);
export const sendKeys =
(data = {}) =>
async (dispatch) =>
(await proxy.post('message/sendKeys', data)).dispatch(dispatch);

@ -1,29 +0,0 @@
import proxy from "../proxy";
const publicApi = {
getHomeData: (data, history) => async (dispatch) =>
await proxy.get("public/homePage", data, { history, dispatch }),
getFaqList: (data, history) => async (dispatch) =>
await proxy.get("faq/list", data, { history, dispatch }),
setFaqActive: (data) => async (dispatch) =>
await dispatch({ type: "public/faq/activate", data: data }),
searchFaq: (data) => async (dispatch) =>
await dispatch({ type: "public/faq/search", data: data }),
getContactData:
(data = {}, history) =>
async (dispatch) =>
await proxy.get("public/contact", data, { history, dispatch }),
getArList: (data, history) => async (dispatch) =>
await proxy.get("public/ar", data, { history, dispatch }),
getBlogList: (data, history) => async (dispatch) =>
await proxy.get("public/blogList", data, { history, dispatch }),
getBlogInfo: (data, history) => async (dispatch) =>
await proxy.get("public/blogInfo", data, { history, dispatch }),
filterNewProducts: (data, history) => async (dispatch) =>
await dispatch({ type: "public/filter", data }),
getProvince: (data, history) => async (dispatch) =>
await proxy.get("public/province", data, { history, dispatch }),
getCity: (data, history) => async (dispatch) =>
await proxy.get("public/city", data, { history, dispatch }),
};
export default publicApi;

@ -1,32 +0,0 @@
import proxy from "../proxy";
const qr = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("qr/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch) => {
await proxy.get("qr/info", data, { dispatch });
},
add:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("qr/add", data);
await proxy.get("qr/list", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("ar/delete", data);
await proxy.get("ar/list", data2, { dispatch });
},
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("ar/update", data);
await proxy.get("ar/list", data2, { dispatch });
},
};
export default qr;

@ -1,37 +0,0 @@
import proxy from "../proxy";
const transport = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("transport/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch) =>
await proxy.get("transport/info", data, { dispatch }),
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("transport/update", data);
await proxy.get("transport/list", data2, { dispatch });
},
add:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("transport/add", data);
await proxy.get("transport/list", data2, { dispatch });
},
setTransport:
(data = {}, data2 = {}, data3 = {}) =>
async (dispatch) => {
await proxy.post("transport/setTransport", data);
await proxy.get("userFactor/info", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("transport/delete", data);
await proxy.get("transport/list", data2, { dispatch });
},
};
export default transport;

@ -1,61 +0,0 @@
import proxy from "../proxy";
const user = {
otp: (data, history) => async (dispatch) =>
await proxy.login("public/sendOTP", data, { history, dispatch }),
// otp:
// (data = {}) =>
// async (dispatch) =>
// dispatch({ type: "public/sendOTP", payload: data }),
otp_login: (data, history) => async (dispatch) =>
await proxy.login("user/otp/login", data, { history, dispatch }),
// otp_login:
// (data = {}) =>
// async (dispatch) =>
// dispatch({ type: "user/otp/login", payload: data }),
register: (data, history) => async (dispatch) =>
await proxy.login("user/register", data, { history, dispatch }),
switchRole: (data, history) => async (dispatch) =>
await proxy.login("user/switchRole", data, { history, dispatch }),
logout: (data, history) => async (dispatch) =>
await proxy.logout("user/logout", data, { history, dispatch }),
getUserRole: (data) => async (dispatch) =>
await proxy.get("user/getUserRole", data, { dispatch }),
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("user/list", data, { dispatch }),
domains:
(data = {}) =>
async (dispatch) =>
await proxy.get("user/domains", data, { dispatch }),
getmothers:
(data = {}) =>
async (dispatch) =>
await proxy.get2("mothers/list", data, {
dispatch,
}),
getProfile:
(data = {}) =>
async (dispatch) =>
await proxy.get("user/getProfile", data, { dispatch }),
setProfile:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("user/setProfile", data, { dispatch });
await proxy.get("user/getProfile", data2, { dispatch });
},
add:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("user/add", data);
await proxy.get("user/list", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("user/delete", data);
await proxy.get("user/list", data2, { dispatch });
},
};
export default user;

@ -1,41 +0,0 @@
import proxy from "../proxy";
const userFactor = {
list:
(data = {}) =>
async (dispatch) =>
await proxy.get("userFactor/list", data, { dispatch }),
info:
(data = {}) =>
async (dispatch) =>
await proxy.get("userFactor/info", data, { dispatch }),
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("userFactor/update", data, { dispatch });
await proxy.get("userFactor/info", data2, { dispatch });
},
payment:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("userFactor/payment", data, { dispatch });
},
verify:
(data = {}) =>
async (dispatch) => {
await proxy.post("userFactor/verify", data, { dispatch });
},
add:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.post("userFactor/add", data, { dispatch });
await proxy.get("userFactor/list", data2, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("userFactor/delete", data, { dispatch });
await proxy.get("userFactor/list", data2, { dispatch });
},
};
export default userFactor;

@ -1,38 +0,0 @@
import proxy from "../proxy";
const userProduct = {
list:
(data = {}) =>
async (dispatch) => {
await proxy.get("userProduct/list", data, { dispatch });
},
myList:
(data = {}) =>
async (dispatch) => {
await proxy.get("userProduct/myList", data, { dispatch });
},
info:
(data = {}) =>
async (dispatch) =>
await proxy.get("userProduct/info", data, { dispatch }),
update:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.put("userProduct/update", data);
await proxy.get("userProduct/list", data2, { dispatch });
},
add:
(data = {}, data2 = {}, data3 = {}) =>
async (dispatch) => {
await proxy.post("userProduct/add", data, { dispatch });
await proxy.get("userProduct/list", data2, { dispatch });
await proxy.get("userFactor/info", data3, { dispatch });
},
del:
(data = {}, data2 = {}) =>
async (dispatch) => {
await proxy.delete("userProduct/delete", data);
await proxy.get("userProduct/list", data2, { dispatch });
},
};
export default userProduct;

@ -1,7 +0,0 @@
// @create-index
export { default as actions } from './actions';
export { default as proxy } from './proxy.js';
export { default as reducers } from './reducers';
export { default as store } from './store.js';

@ -1,121 +0,0 @@
import { ApiConfig } from "../constants/defaultValues";
import axios from "axios";
let { baseUrl } = ApiConfig;
// let access = window.localStorage.getItem("access");
window.baseURL = baseUrl;
baseUrl = baseUrl + "/";
const Axios = axios.create({
withCredentials: true,
validateStatus: null,
baseURL: baseUrl,
//headers: access ? { Authorization: `Bearer ${access}` } : {},
});
class Proxy {
get = async (url, params, opt = {}, data) =>
await this.check(
url,
opt,
async () => await Axios.get(url, { params, ...opt }),
data || params
);
post = async (url, params, opt = {}, data) =>
await this.check(
url,
opt,
async () => await Axios.post(url, params, opt),
data || params
);
put = async (url, params, opt = {}, data) =>
await this.check(
url,
opt,
async () => await Axios.put(url, params, opt),
data || params
);
delete = async (url, params, opt = {}, data) => {
await this.check(
url,
opt,
async () => await Axios.delete(url, { ...opt, data: params }),
data || params
);
};
check = async (url, { dispatch }, fetch, params) => {
dispatch = dispatch || (() => {});
dispatch({ type: url.split("/")[0] + "/" + "loading" });
let response = await fetch();
switch (response.status) {
case 200:
dispatch({ type: url, data: response.data.data, params });
return response.data.data;
case 401:
if (await this.refresh()) {
let response = await fetch();
dispatch({ type: url, data: response.data.data, params });
return response.data.data;
}
break;
default:
dispatch({
type: url.split("/")[0] + "/" + "error",
data: response.data,
params,
});
}
return false;
};
refresh = async () => {
let refresh = localStorage.getItem("refresh");
if (!refresh) window.location.href = "/";
let login = await this.login(
"user/login",
{},
{ headers: { Authorization: `Bearer ${refresh}` } }
);
return login ? true : false;
};
login = async (url, params, { dispatch }) =>
this.post(url, params, {
dispatch: (obj) => {
let login = obj.data;
if (!login || !login.refreshToken) return false;
// localStorage.setItem("refresh", login.refreshToken);
// localStorage.setItem("access", login.accessToken);
delete login.refreshToken;
delete login.accessToken;
// localStorage.setItem("userData", JSON.stringify(login.profile));
dispatch(obj);
},
});
logout = async (url, params, { dispatch }) => {
this.post(url, params, {
dispatch: (obj) => {
// localStorage.removeItem("refresh");
// localStorage.removeItem("access");
// localStorage.removeItem("userData");
dispatch(obj);
},
});
};
status = () => {
// let refresh = localStorage.getItem("refresh");
// let userData = localStorage.getItem("userData");
// if (!refresh) return false;
// if (refresh == "undefined") {
// localStorage.removeItem("refresh");
// localStorage.removeItem("access");
// localStorage.removeItem("userData");
// return false;
// }
// return JSON.parse(userData);
};
}
const _proxy = new Proxy();
export default _proxy;

@ -1,32 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: [],
updateStatus: false,
};
export default function activation(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "activation/list":
return { ...state, loading: false, list: data, error: null };
case "activation/update":
return { ...state, loading: false, error: null };
case "activation/updateStatus":
// toast.success("کتاب شما با موفقیت فعال گردید.");
return { ...state, loading: false, error: null, updateStatus: true };
case "activation/add":
// toast.success("کتاب شما با موفقیت فعال گردید.");
return { ...state, loading: false, error: null };
case "activation/delete":
return { ...state, loading: false, error: null };
case "activation/loading":
return { ...state, loading: true };
case "activation/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,28 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: [],
};
export default function blog(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "blog/list":
return { ...state, loading: false, list: data, error: null };
case "blog/update":
return { ...state, loading: false, error: null };
case "blog/add":
return { ...state, loading: false, error: null };
case "blog/delete":
return { ...state, loading: false, error: null };
/////////////
case "blog/loading":
return { ...state, loading: true };
case "blog/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,127 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: [],
info: null,
searchResult: [],
filterResult: [],
subjects: [],
levels: [],
sortFilters: ["مرتب سازی", "محبوب ترین", "جدیدترین"],
};
const grades = [
"پیش دبستان",
"اول",
"دوم",
"سوم",
"چهارم",
"پنجم",
"ششم",
"هفتم",
"هشتم",
"نهم",
"دهم",
"یازدهم",
"دوازدهم",
];
export default function book(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "book/list":
let itemsSubject = (Array.isArray(data) ? data : []).map(
(item, index) => item.name
);
if (window.innerWidth < 1000) {
itemsSubject.unshift("نام کتاب");
}
let itemsLevel = (Array.isArray(data) ? data : [])
.map((item) => item.gradeId * 1)
.sort((a, b) => a - b)
.map((e) => grades[e]);
if (window.innerWidth < 1000) {
itemsLevel.unshift("پایه تحصیلی");
}
return {
...state,
loading: false,
list: data,
subjects: [...new Set(itemsSubject)],
levels: [...new Set(itemsLevel)],
filterResult: data,
error: null,
};
case "book/info":
return { ...state, loading: false, info: data, error: null };
case "book/update":
return { ...state, loading: false, error: null };
case "book/add":
return { ...state, loading: false, error: null };
case "book/delete":
return { ...state, loading: false, error: null };
case "book/search":
return { ...state };
case "book/filter":
const realList = state.list;
const level = data.level;
const subject = data.subject;
const sort = data.sort;
const search = data.search;
if (level.length > 0 || subject.length > 0 || sort || search) {
localStorage.setItem("filter", "ON");
}
let finalSort;
let byLevelFilter = [];
if (level.length > 0) {
level.map((item1) => {
for (let i = 0; i < realList.length; i++) {
if (grades[realList[i].gradeId] === item1) {
byLevelFilter.push(realList[i]);
}
}
});
} else {
byLevelFilter = realList;
}
let bySubjectFilter = [];
if (subject.length > 0) {
subject.map((item1) => {
for (let i = 0; i < byLevelFilter.length; i++) {
if (byLevelFilter[i].name === item1) {
bySubjectFilter.push(byLevelFilter[i]);
}
}
});
} else {
bySubjectFilter = byLevelFilter;
}
const bySearchFilter = search
? bySubjectFilter.filter((item1) => item1.name.indexOf(search) !== -1)
: bySubjectFilter;
if (sort === "گران ترین") {
finalSort = bySearchFilter.sort((item1, item2) => {
return item1.product[0].price - item2.product[0].price;
});
} else {
finalSort = bySearchFilter;
}
return {
...state,
loading: false,
error: null,
filterResult: finalSort,
};
case "book/loading":
return { ...state, loading: true };
case "book/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,25 +0,0 @@
const initialState = {
list: [],
info: { users: [] },
bio: {
album: [],
images: [],
videos: [],
music: [],
documnet: [],
link: [],
},
};
export default function chat(state = initialState, action) {
let { type, data } = action;
switch (type) {
case 'chat/list':
return { ...state, list: data };
case 'chat/info':
return { ...state, info: data };
case 'chat/bio':
return { ...state, bio: data };
default:
return state;
}
}

@ -1,35 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: null,
};
export default function comment(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "comment/list":
return { ...state, loading: false, error: null };
case "comment/update":
return { ...state, loading: false, error: null };
case "comment/add":
return { ...state, loading: false, error: null };
case "comment/delete":
return { ...state, loading: false, error: null };
case "comment/info":
return {
...state,
loading: false,
list: data,
error: null,
};
case "comment/loading":
return { ...state, loading: true };
case "comment/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,26 +0,0 @@
const initialState = {
loading: false,
error: null,
uploads: {},
lastUpload: null,
};
export default function file(state = initialState, action) {
let { type, data, params } = action;
switch (type) {
case "file/upload":
return {
...state,
loading: false,
error: null,
uploads: { ...state.uploads, [params?.target || "last"]: data.id },
lastUpload: data.id,
};
case "file/loading":
return { ...state, loading: true };
case "file/error":
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,14 +0,0 @@
// @create-index
export { default as chat } from "./chat.js";
export { default as message } from "./message.js";
export { default as publicApi } from "./public.js";
export { default as user } from "./user.js";
export { default as qr } from "./qr.js";
export { default as book } from "./book.js";
export { default as userProduct } from "./userProduct.js";
export { default as userFactor } from "./userFactor.js";
export { default as transport } from "./transport.js";
export { default as comment } from "./comment.js";
export { default as activation } from "./activation.js";
export { default as file } from "./file.js";

@ -1,16 +0,0 @@
const initialState = {
list: [],
};
export default function chat(state = initialState, action) {
let { type, data } = action;
switch (type) {
case 'message/list':
return { ...state, list: data };
case 'message/send':
return { ...state, list: [...state.list, ...data] };
case 'message/sendKeys':
return { ...state, list: [...state.list, ...data] };
default:
return state;
}
}

@ -1,186 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
homeData: [],
newProducts: [],
levels: [],
faqList: [],
loading: false,
error: null,
searchResult: [],
contactData: null,
arList: [],
blogList: [],
blog: null,
province: [],
city: [],
};
const grades = [
"پیش دبستان",
"اول",
"دوم",
"سوم",
"چهارم",
"پنجم",
"ششم",
"هفتم",
"هشتم",
"نهم",
"دهم",
"یازدهم",
"دوازدهم",
];
export default function publicApi(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "public/homePage":
let itemsLevel;
// if (window.innerWidth > 1000) {
const jadidTarin = data.filter(
(item) => item.title === "کتابهای دانوین"
);
itemsLevel =
jadidTarin[0] && jadidTarin[0].data
? jadidTarin[0].data
.map((item) => item.book.gradeId * 1)
.sort((a, b) => a - b)
.map((e) => grades[e])
: [];
itemsLevel.unshift("پایه تحصیلی");
// }
return {
...state,
loading: false,
levels: [...new Set(itemsLevel)],
error: null,
homeData: data,
};
case "user/logout":
case "user/login":
case "user/otp/login":
return { ...state, homeData: [] };
case "public/filter":
const realList =
state.newProducts.length === 0
? state.homeData.filter((item) => item.title === "کتابهای دانوین")[0]
.data
: state.newProducts;
if (state.newProducts.length === 0) {
state = {
...state,
newProducts: realList,
};
console.log("here1");
}
const level = data.levels;
const search = data.search;
if (level.length > 0 || search) {
localStorage.setItem("filter", "ON");
} else {
return {
...state,
loading: false,
error: null,
homeData: state.homeData.map((item) =>
item.title === "کتابهای دانوین"
? { ...item, data: state.newProducts }
: { ...item }
),
newProducts: [],
};
}
let byLevelFilter = [];
if (level.length > 0) {
level.map((item1) => {
for (let i = 0; i < realList.length; i++) {
if (grades[realList[i].book.gradeId] === item1) {
byLevelFilter.push(realList[i]);
}
}
});
} else {
byLevelFilter = realList;
}
// let bySubjectFilter = [];
// if (subject.length > 0) {
// subject.map((item1) => {
// for (let i = 0; i < byLevelFilter.length; i++) {
// if (byLevelFilter[i].name === item1) {
// bySubjectFilter.push(byLevelFilter[i]);
// }
// }
// });
// } else {
// bySubjectFilter = byLevelFilter;
// }
const bySearchFilter = search
? byLevelFilter.filter((item1) => item1.name.indexOf(search) !== -1)
: byLevelFilter;
// if (sort === "گران ترین") {
// finalSort = bySearchFilter.sort((item1, item2) => {
// return item1.product[0].price - item2.product[0].price;
// });
// } else {
// finalSort = bySearchFilter;
// }
return {
...state,
loading: false,
error: null,
homeData: state.homeData.map((item) =>
item.title === "کتابهای دانوین"
? { ...item, data: bySearchFilter }
: { ...item }
),
};
case "faq/list":
return { ...state, loading: false, error: null, faqList: data };
case "public/province":
return { ...state, loading: false, error: null, province: data };
case "public/city":
return { ...state, loading: false, error: null, city: data };
case "public/faq/activate":
return {
...state,
loading: false,
error: null,
faqList: state.faqList.map((item) =>
item.id === data
? { ...item, active: !item.active }
: { ...item, active: false }
),
};
case "public/faq/search":
return {
...state,
loading: false,
error: null,
searchResult: state.faqList.filter(
(item) =>
item.title.indexOf(data) !== -1 ||
item.description.indexOf(data) !== -1
),
};
case "public/contact":
return { ...state, loading: false, error: null, contactData: data };
case "public/ar":
return { ...state, loading: false, error: null, arList: data };
case "public/blogList":
return { ...state, loading: false, error: null, blogList: data };
case "public/blogInfo":
return { ...state, loading: false, error: null, blog: data };
case "public/loading":
return { ...state, loading: true };
case "public/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,34 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: null,
};
export default function qr(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "qr/list":
return { ...state, loading: false, error: null };
case "qr/update":
return { ...state, loading: false, error: null };
case "qr/add":
return { ...state, loading: false, error: null };
case "qr/delete":
return { ...state, loading: false, error: null };
case "qr/info":
return {
...state,
loading: false,
list: data,
error: null,
};
/////////////
case "qr/loading":
return { ...state, loading: true };
case "qr/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,32 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: [],
info: null,
};
export default function transport(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "transport/list":
return { ...state, loading: false, list: data, error: null };
case "transport/info":
return { ...state, loading: false, list: null, info: data, error: null };
case "transport/update":
return { ...state, loading: false, error: null };
case "transport/add":
return { ...state, loading: false, error: null };
case "transport/setTransport":
// toast.success("روش ارسال با موفقیت تغییر یافت!");
return { ...state, loading: false, error: null };
case "transport/delete":
return { ...state, loading: false, error: null };
case "transport/loading":
return { ...state, loading: true };
case "transport/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,66 +0,0 @@
import proxy from "../proxy";
// import { toast } from "react-toastify";
const initialState = {
status: proxy.status(),
loading: false,
error: null,
list: null,
domains: [],
mothers: [],
profileStatus: false,
setDone: false,
};
export default function user(state = initialState, action) {
let { type, data } = action;
switch (type) {
case "user/login":
case "user/register":
case "user/switchRole":
case "public/sendOTP":
// toast.success("کد به شماره شما ارسال گردید.");
return { ...state, loading: false, status: data.profile, error: null };
case "user/otp/login":
// window.location = "https://dnvn.ir/?" + Math.random();
// toast.success("به دانوین خوش آمدید.");
return {
...state,
loading: false,
status: data.profile,
error: null,
};
case "user/getProfile":
localStorage.setItem("userData", JSON.stringify(data));
return {
...state,
loading: false,
status: data,
error: null,
setDone: false,
};
case "user/logout":
localStorage.removeItem("refresh");
localStorage.removeItem("access");
localStorage.removeItem("userData");
// window.location = "https://dnvn.ir/?" + Math.random();
return { ...state, loading: false, status: proxy.status(), error: null };
case "user/getUserRole":
return { ...state, loading: false, userRoles: data, error: null };
case "user/list":
return { ...state, loading: false, list: data, error: null };
case "user/domains":
return { ...state, loading: false, domains: data, error: null };
case "mothers/list":
return { ...state, loading: false, mothers: data, error: null };
case "user/setProfile":
return { ...state, loading: false, error: null, setDone: true };
case "user/loading":
return { ...state, loading: true };
case "user/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,51 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: [],
info: null,
sum: null,
checkEmpty: false,
isVerified: null,
};
export default function userFactor(state = initialState, action) {
let { type, data, message } = action;
switch (type) {
case "userFactor/list":
const checkEmpty = data.filter(
(item) => item.condition === 2 && item.product.productType === (1 || 3)
);
return {
...state,
loading: false,
list: data,
checkEmpty: checkEmpty.length > 0 ? false : true,
error: null,
};
case "userFactor/info":
return { ...state, loading: false, info: data, error: null };
case "userFactor/update":
console.log("userFactor/update");
// toast.success("درخواست شما با موفقیت انجام شد.");
return { ...state, loading: false, error: null };
case "userFactor/add":
// toast.success("درخواست شما با موفقیت انجام شد.");
return { ...state, loading: false, error: null, sum: data.payPrice };
case "userFactor/delete":
return { ...state, loading: false, error: null };
case "userFactor/payment":
window.location.replace(data);
return { ...state, loading: false, error: null, isVerified: false };
case "userFactor/verify":
return { ...state, loading: false, error: null, isVerified: true };
case "userFactor/loading":
return { ...state, loading: true };
case "userFactor/error":
console.log("error");
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,53 +0,0 @@
// import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
list: null,
info: null,
sum: null,
checkEmpty: false,
hasPhysical: false,
myList: [],
};
export default function userProduct(state = initialState, action) {
let { type, data, message } = action;
switch (type) {
case "userProduct/list":
const checkEmpty = data.filter(
(item) => item.condition === 2 && item.product.productType === (1 || 3)
);
const hasPhysical =
data.filter((item) => item.product.productType === 2).length > 0
? true
: false;
return {
...state,
loading: false,
list: data,
checkEmpty: checkEmpty.length > 0 ? false : true,
error: null,
hasPhysical: hasPhysical,
};
case "userProduct/info":
return { ...state, loading: false, info: data, error: null };
case "userProduct/myList":
return { ...state, loading: false, myList: data, error: null };
case "userProduct/update":
return { ...state, loading: false, error: null };
case "userProduct/add":
if (window.location.pathname.indexOf("products") !== -1) {
// toast.success("درخواست شما با موفقیت انجام شد.");
}
return { ...state, loading: false, error: null, sum: data.payPrice };
case "userProduct/delete":
return { ...state, loading: false, error: null };
case "userProduct/loading":
return { ...state, loading: true };
case "userProduct/error":
// toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;
}
}

@ -1,13 +0,0 @@
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import { combineReducers } from 'redux';
import * as reducers from './reducers';
import thunk from 'redux-thunk';
const initialState = {};
const middleware = [thunk];
const store = createStore(
combineReducers(reducers),
initialState,
composeWithDevTools(applyMiddleware(...middleware))
);
export default store;

@ -0,0 +1,55 @@
import { Alert } from "react-native"
let awesomeResolve
const onConfirm = () => {
awesomeResolve(true)
}
const onCancel = () => {
awesomeResolve(false)
}
let apiResolverArray = []
const resolver = ()=>{
for(let item of apiResolverArray){
item(true)
}
apiResolverArray = []
}
export const asyncAlert = async (title, message, buttons, options) => new Promise((resolve) => {
for (let i in buttons) {
buttons[i].onPress = () => {
resolve(buttons[i].value)
}
delete buttons.value
}
Alert.alert(title, message, buttons, options)
})
export const asyncAwesomeAlert = async (title, message, options) => new Promise((resolve) => {
awesomeResolve = resolve
global.globalAlert({
show: true,
onConfirm: onConfirm,
onCancel: onCancel,
title,
message,
...options
})
})
export const asyncApiAwesomeAlert = async (title, message, options) => new Promise((resolve) => {
apiResolverArray.push(resolve)
global.globalApiAlert({
show: true,
onConfirm: resolver,
onCancel: ()=>{},
title,
message,
...options
})
})
export const asyncSleep = function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export const randomApiSleep = function randomApiSleep() {
return new Promise(resolve => setTimeout(resolve, Math.ceil(Math.random() * 1000 + 10)))
}

@ -0,0 +1,12 @@
export function debounce(callback, wait, context = this) {
let timeout = null;
let callbackArgs = null;
const later = () => callback.apply(context, callbackArgs);
return function() {
callbackArgs = arguments;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
}

@ -0,0 +1,17 @@
const ExtraDimension = require('react-native-extra-dimensions-android')
import { Dimensions } from "react-native"
import { isSoftMenuBarEnabled } from "react-native-extra-dimensions-android"
const getHeight = () => {
var height = Math.round(Dimensions.get('window').height)
if (isSoftMenuBarEnabled()) {
height = height - ExtraDimension.get("STATUS_BAR_HEIGHT")
}
return height
}
export const viewportWidth = ExtraDimension.get("REAL_WINDOW_WIDTH")
export const viewportHeight = getHeight()

@ -0,0 +1,9 @@
import { AsyncStorage, AlertIOS, Platform, ToastAndroid, } from "react-native"
export const toastMessage = (msg) => {
if (Platform.OS === 'android') {
ToastAndroid.show(msg, ToastAndroid.SHORT)
} else {
AlertIOS.alert(msg);
}
}
Loading…
Cancel
Save