Browse Source

IMPROVE | Update common folder

pull/2/head
Vlad Narizhnyi 1 year ago
parent
commit
8651e1040e
  1. 7
      .prettierrc.js
  2. 42
      App.tsx
  3. BIN
      android/app/src/main/assets/fonts/Roboto-Bold.ttf
  4. BIN
      android/app/src/main/assets/fonts/Roboto-Regular.ttf
  5. 17
      android/link-assets-manifest.json
  6. 6
      ios/Podfile.lock
  7. BIN
      ios/Resources/Fonts/Roboto-Bold.ttf
  8. BIN
      ios/Resources/Fonts/Roboto-Regular.ttf
  9. 16
      ios/Truth.xcodeproj/project.pbxproj
  10. 4
      ios/Truth/Info.plist
  11. 17
      ios/link-assets-manifest.json
  12. 142
      package-lock.json
  13. 5
      package.json
  14. 7
      react-native.config.js
  15. BIN
      src/assets/resources/fonts/Roboto-Bold.ttf
  16. BIN
      src/assets/resources/fonts/Roboto-Regular.ttf
  17. 6
      src/i18n/types/index.ts
  18. 10
      src/module/common/colors/colors.ts
  19. 0
      src/module/common/colors/index.ts
  20. 86
      src/module/common/components/buttons/button-primary.component.tsx
  21. 29
      src/module/common/components/buttons/button-with-icon.tsx
  22. 0
      src/module/common/components/buttons/go-back.component.tsx
  23. 3
      src/module/common/components/buttons/index.ts
  24. 0
      src/module/common/components/header/header.component.tsx
  25. 0
      src/module/common/components/header/index.ts
  26. 32
      src/module/common/components/icon/icon.component.tsx
  27. 1
      src/module/common/components/icon/index.ts
  28. 5
      src/module/common/components/index.ts
  29. 2
      src/module/common/components/layout/index.ts
  30. 93
      src/module/common/components/layout/screen-layout-content.component.tsx
  31. 98
      src/module/common/components/layout/screen-layout.component.tsx
  32. 13
      src/module/common/components/modal/atoms/body-modal.atom.tsx
  33. 20
      src/module/common/components/modal/atoms/container-modal.atom.tsx
  34. 16
      src/module/common/components/modal/atoms/footer-modal.atom.tsx
  35. 14
      src/module/common/components/modal/atoms/header-modal.atom.tsx
  36. 4
      src/module/common/components/modal/atoms/index.ts
  37. 1
      src/module/common/components/modal/index.ts
  38. 61
      src/module/common/components/modal/modal.tsx
  39. 0
      src/module/common/components/name-title/name-title.tsx
  40. 22
      src/module/common/components/question-block/question-block.tsx
  41. 0
      src/module/common/components/text-containers/main-text-container.tsx
  42. 1
      src/module/common/components/txt/index.ts
  43. 67
      src/module/common/components/txt/txt.component.tsx
  44. 0
      src/module/common/config/config.json
  45. 0
      src/module/common/config/default-packages.tsx
  46. 0
      src/module/common/config/fontello.config.ts
  47. 0
      src/module/common/config/index.ts
  48. 26
      src/module/common/events/app-events.ts
  49. 1
      src/module/common/events/index.ts
  50. 6
      src/module/common/helpers/dimensions.helper.ts
  51. 0
      src/module/common/helpers/helper-height-view.ts
  52. 4
      src/module/common/helpers/index.ts
  53. 18
      src/module/common/helpers/style.helper.ts
  54. 0
      src/module/common/hooks/index.ts
  55. 21
      src/module/common/hooks/use-events-listener.hook.ts
  56. 0
      src/module/common/hooks/use-nav.hook.ts
  57. 9
      src/module/common/index.ts
  58. 17
      src/module/common/tools/global-container.tool.ts
  59. 1
      src/module/common/tools/index.ts
  60. 4
      src/module/common/typing/enums/fonts.enum.ts
  61. 2
      src/module/common/typing/enums/index.ts
  62. 0
      src/module/common/typing/enums/route-keys.ts
  63. 2
      src/module/common/typing/index.ts
  64. 0
      src/module/common/typing/interfaces/custom-pack.ts
  65. 0
      src/module/common/typing/interfaces/dare.ts
  66. 0
      src/module/common/typing/interfaces/game-item.ts
  67. 0
      src/module/common/typing/interfaces/index.ts
  68. 0
      src/module/common/typing/interfaces/page-titles.ts
  69. 0
      src/module/common/typing/interfaces/routing.ts
  70. 0
      src/module/common/typing/interfaces/truth.ts
  71. 203
      src/module/common/widgets/alert-confirm/alert-confirm-widget.component.tsx
  72. 1
      src/module/common/widgets/alert-confirm/index.ts
  73. 139
      src/module/common/widgets/alert/alert-widget.component.tsx
  74. 1
      src/module/common/widgets/alert/index.ts
  75. 54
      src/module/common/widgets/bottom-sheet/atoms/action-sheet-button.atom.tsx
  76. 77
      src/module/common/widgets/bottom-sheet/atoms/bottom-sheet-view.atom.tsx
  77. 1
      src/module/common/widgets/bottom-sheet/atoms/index.ts
  78. 6
      src/module/common/widgets/bottom-sheet/sheets.tsx
  79. 2
      src/module/common/widgets/index.ts
  80. 2
      src/module/game/screen/select-packages.screen.tsx
  81. 7
      src/module/package/atoms/create-custom-package.atom.tsx
  82. 2
      src/module/package/components/packages-item.component.tsx
  83. 10
      src/module/privacy-policy/screens/privacy-policy.tsx
  84. 2
      src/module/root/atoms/premium-button.component.tsx
  85. 2
      src/module/root/components/content-on-boarding.component.tsx
  86. 2
      src/module/root/navigations-groups/on-boardings-group.tsx
  87. 6
      src/module/root/screens/game.tsx
  88. 4
      src/module/root/screens/language-select.screen.tsx
  89. 2
      src/module/root/screens/loading-screen.tsx
  90. 2
      src/module/root/screens/on-boarding.screen.tsx
  91. 8
      src/module/root/screens/questions.tsx
  92. 2
      src/module/root/screens/settings.screen.tsx
  93. 42
      src/module/services/dares/dares-slice.ts
  94. 10
      src/module/services/game-items/game-items-slice.ts
  95. 5
      src/module/services/truths/truth-slice.ts
  96. 2
      src/module/setting/components/Settings-Item.component.tsx
  97. 11
      src/module/shared/colors/colors.ts
  98. 14
      src/module/shared/components/Icon/Icon.component.tsx
  99. 1
      src/module/shared/components/Icon/index.ts
  100. 2
      src/module/shared/components/buttons/index.ts
  101. Some files were not shown because too many files have changed in this diff Show More

7
.prettierrc.js

@ -1,7 +1,10 @@ @@ -1,7 +1,10 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
bracketSpacing: true,
bracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
tabWidth: 4,
useTabs: true,
semi: false,
};

42
App.tsx

@ -1,26 +1,22 @@ @@ -1,26 +1,22 @@
import React, {useEffect} from 'react';
import SplashScreen from 'react-native-splash-screen';
import {Navigation} from './src/module/root';
import './src/i18n/index';
import {Provider} from 'react-redux';
import {store} from './src/store/store';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
if (__DEV__) {
import('./ReactotronConfig').then(() => console.log('Reactotron Configured'));
}
import React, { useEffect } from 'react'
import SplashScreen from 'react-native-splash-screen'
import { Navigation } from './src/module/root'
import './src/i18n/index'
import { Provider } from 'react-redux'
import { store } from './src/store/store'
import { GestureHandlerRootView } from 'react-native-gesture-handler'
const App = () => {
useEffect(() => {
SplashScreen.hide();
}, []);
return (
<GestureHandlerRootView style={{flex: 1}}>
<Provider store={store}>
<Navigation />
</Provider>
</GestureHandlerRootView>
);
};
useEffect(() => {
SplashScreen.hide()
}, [])
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<Provider store={store}>
<Navigation />
</Provider>
</GestureHandlerRootView>
)
}
export default App;
export default App

BIN
android/app/src/main/assets/fonts/Roboto-Bold.ttf

Binary file not shown.

BIN
android/app/src/main/assets/fonts/Roboto-Regular.ttf

Binary file not shown.

17
android/link-assets-manifest.json

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
{
"migIndex": 1,
"data": [
{
"path": "src/assets/resources/fonts/Roboto-Bold.ttf",
"sha1": "62442a18a9fe9457c1afeabf683d263a691b7798"
},
{
"path": "src/assets/resources/fonts/Roboto-Regular.ttf",
"sha1": "56c5c0d38bde4c1f1549dda43db37b09c608aad3"
},
{
"path": "src/assets/resources/fonts/fontello.ttf",
"sha1": "73fc32c22bdcda8f8bea6b28b74a9a45ba721f7d"
}
]
}

6
ios/Podfile.lock

@ -1279,6 +1279,8 @@ PODS: @@ -1279,6 +1279,8 @@ PODS:
- React-Core
- RNSVG (12.5.1):
- React-Core
- RNVectorIcons (9.2.0):
- React-Core
- SocketRocket (0.6.1)
- Yoga (1.14.0)
- YogaKit (1.18.1):
@ -1359,6 +1361,7 @@ DEPENDENCIES: @@ -1359,6 +1361,7 @@ DEPENDENCIES:
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNSVG (from `../node_modules/react-native-svg`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
@ -1488,6 +1491,8 @@ EXTERNAL SOURCES: @@ -1488,6 +1491,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-screens"
RNSVG:
:path: "../node_modules/react-native-svg"
RNVectorIcons:
:path: "../node_modules/react-native-vector-icons"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
@ -1566,6 +1571,7 @@ SPEC CHECKSUMS: @@ -1566,6 +1571,7 @@ SPEC CHECKSUMS:
RNGestureHandler: 6e46dde1f87e5f018a54fe5d40cd0e0b942b49ee
RNScreens: 3c2d122f5e08c192e254c510b212306da97d2581
RNSVG: d7d7bc8229af3842c9cfc3a723c815a52cdd1105
RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

BIN
ios/Resources/Fonts/Roboto-Bold.ttf

Binary file not shown.

BIN
ios/Resources/Fonts/Roboto-Regular.ttf

Binary file not shown.

16
ios/Truth.xcodeproj/project.pbxproj

@ -14,6 +14,8 @@ @@ -14,6 +14,8 @@
3F5CDF352995282400BD4B7F /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3F5CDF342995282400BD4B7F /* GoogleService-Info.plist */; };
52BCE0F228C76D5A008C74BC /* Fonts in Resources */ = {isa = PBXBuildFile; fileRef = 52BCE0EE28C76941008C74BC /* Fonts */; };
52BCE0F328C77143008C74BC /* fontello.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DA10DFDF3E05483BA976401B /* fontello.ttf */; };
637B62A42B07BAFB008D8917 /* Roboto-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 637B62A32B07BAFB008D8917 /* Roboto-Bold.ttf */; };
637B62A62B07BB0B008D8917 /* Roboto-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 637B62A52B07BB0B008D8917 /* Roboto-Regular.ttf */; };
8D22E0E3287C39ED0031C6E5 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D22E0E2287C39ED0031C6E5 /* Launch Screen.storyboard */; };
A391FF929DB227F6E78842F0 /* libPods-Truth-TruthTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28F2047B035775EA39D23C93 /* libPods-Truth-TruthTests.a */; };
BE14AC86F1757C0EC41F56B3 /* libPods-Truth.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A2B08B3350C2BC99B4477A9 /* libPods-Truth.a */; };
@ -33,6 +35,7 @@ @@ -33,6 +35,7 @@
00E356EE1AD99517003FC87E /* TruthTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TruthTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* TruthTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TruthTests.m; sourceTree = "<group>"; };
0A5DBF0F38024BCFB74F94C3 /* Roboto-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Roboto-Regular.ttf"; path = "../src/assets/resources/fonts/Roboto-Regular.ttf"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* Truth.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Truth.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Truth/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Truth/AppDelegate.m; sourceTree = "<group>"; };
@ -40,9 +43,14 @@ @@ -40,9 +43,14 @@
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Truth/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Truth/main.m; sourceTree = "<group>"; };
28F2047B035775EA39D23C93 /* libPods-Truth-TruthTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Truth-TruthTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
36C7150ADAB54DA0B3D10FF5 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Roboto-Bold.ttf"; path = "../src/assets/resources/fonts/Roboto-Bold.ttf"; sourceTree = "<group>"; };
3F5CDF302995158300BD4B7F /* ios */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ios; sourceTree = "<group>"; };
3F5CDF342995282400BD4B7F /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
52BCE0EE28C76941008C74BC /* Fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Fonts; sourceTree = "<group>"; };
637B62A12B07B836008D8917 /* Roboto-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Regular.ttf"; path = "../src/assets/resources/fonts/Roboto-Regular.ttf"; sourceTree = "<group>"; };
637B62A22B07B836008D8917 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Bold.ttf"; path = "../src/assets/resources/fonts/Roboto-Bold.ttf"; sourceTree = "<group>"; };
637B62A32B07BAFB008D8917 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Bold.ttf"; path = "../src/assets/resources/fonts/Roboto-Bold.ttf"; sourceTree = "<group>"; };
637B62A52B07BB0B008D8917 /* Roboto-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Regular.ttf"; path = "../src/assets/resources/fonts/Roboto-Regular.ttf"; sourceTree = "<group>"; };
7A2B08B3350C2BC99B4477A9 /* libPods-Truth.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Truth.a"; sourceTree = BUILT_PRODUCTS_DIR; };
8D22E0E2287C39ED0031C6E5 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
98B9F113E9FC1559D43A3977 /* Pods-Truth-TruthTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Truth-TruthTests.release.xcconfig"; path = "Target Support Files/Pods-Truth-TruthTests/Pods-Truth-TruthTests.release.xcconfig"; sourceTree = "<group>"; };
@ -118,6 +126,8 @@ @@ -118,6 +126,8 @@
isa = PBXGroup;
children = (
52BCE0EE28C76941008C74BC /* Fonts */,
36C7150ADAB54DA0B3D10FF5 /* Roboto-Bold.ttf */,
0A5DBF0F38024BCFB74F94C3 /* Roboto-Regular.ttf */,
);
path = Resources;
sourceTree = "<group>";
@ -132,6 +142,8 @@ @@ -132,6 +142,8 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
637B62A52B07BB0B008D8917 /* Roboto-Regular.ttf */,
637B62A32B07BAFB008D8917 /* Roboto-Bold.ttf */,
3F5CDF342995282400BD4B7F /* GoogleService-Info.plist */,
3F5CDF302995158300BD4B7F /* ios */,
13B07FAE1A68108700A75B9A /* Truth */,
@ -170,6 +182,8 @@ @@ -170,6 +182,8 @@
EECF0ADD7A2F4406804069EA /* Resources */ = {
isa = PBXGroup;
children = (
637B62A22B07B836008D8917 /* Roboto-Bold.ttf */,
637B62A12B07B836008D8917 /* Roboto-Regular.ttf */,
DA10DFDF3E05483BA976401B /* fontello.ttf */,
);
name = Resources;
@ -270,6 +284,8 @@ @@ -270,6 +284,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
637B62A62B07BB0B008D8917 /* Roboto-Regular.ttf in Resources */,
637B62A42B07BAFB008D8917 /* Roboto-Bold.ttf in Resources */,
52BCE0F328C77143008C74BC /* fontello.ttf in Resources */,
52BCE0F228C76D5A008C74BC /* Fonts in Resources */,
8D22E0E3287C39ED0031C6E5 /* Launch Screen.storyboard in Resources */,

4
ios/Truth/Info.plist

@ -36,10 +36,12 @@ @@ -36,10 +36,12 @@
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<string/>
<key>UIAppFonts</key>
<array>
<string>fontello.ttf</string>
<string>Roboto-Bold.ttf</string>
<string>Roboto-Regular.ttf</string>
</array>
<key>UILaunchStoryboardName</key>
<string>Launch Screen</string>

17
ios/link-assets-manifest.json

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
{
"migIndex": 1,
"data": [
{
"path": "src/assets/resources/fonts/Roboto-Bold.ttf",
"sha1": "62442a18a9fe9457c1afeabf683d263a691b7798"
},
{
"path": "src/assets/resources/fonts/Roboto-Regular.ttf",
"sha1": "56c5c0d38bde4c1f1549dda43db37b09c608aad3"
},
{
"path": "src/assets/resources/fonts/fontello.ttf",
"sha1": "73fc32c22bdcda8f8bea6b28b74a9a45ba721f7d"
}
]
}

142
package-lock.json generated

@ -16,13 +16,17 @@ @@ -16,13 +16,17 @@
"@reduxjs/toolkit": "^1.9.2",
"i18next": "^21.8.14",
"i18next-react-native-async-storage": "^1.0.4",
"jet-tools": "^1.3.0",
"link": "^1.5.1",
"lodash": "^4.17.21",
"react": "18.2.0",
"react-i18next": "^11.18.1",
"react-native": "0.72.7",
"react-native-animated-loader": "^1.0.0",
"react-native-gesture-handler": "^2.5.0",
"react-native-icomoon": "^0.1.1",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-modal": "^13.0.1",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.27.0",
"react-native-splash-screen": "^3.3.0",
@ -38,6 +42,7 @@ @@ -38,6 +42,7 @@
"@react-native/eslint-config": "^0.72.2",
"@react-native/metro-config": "^0.72.11",
"@tsconfig/react-native": "^3.0.0",
"@types/lodash": "^4.14.201",
"@types/react": "^18.0.24",
"@types/react-native": "^0.66.15",
"@types/react-native-vector-icons": "^6.4.12",
@ -4744,6 +4749,12 @@ @@ -4744,6 +4749,12 @@
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true
},
"node_modules/@types/lodash": {
"version": "4.14.201",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.201.tgz",
"integrity": "sha512-y9euML0cim1JrykNxADLfaG0FgD1g/yTHwUs/Jg9ZIU7WKj2/4IW9Lbb1WZbvck78W/lfGXFfe+u2EGfIJXdLQ==",
"dev": true
},
"node_modules/@types/node": {
"version": "20.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
@ -10480,6 +10491,28 @@ @@ -10480,6 +10491,28 @@
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
"node_modules/jet-tools": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/jet-tools/-/jet-tools-1.3.0.tgz",
"integrity": "sha512-m+jiMpaTIhqkaeDVlqtw51BANUKVkbokuAXbwXlA7egsL2TROIulTqCvXgsL+r0N4qs3kibEcBExoClQT7HUEw==",
"dependencies": {
"lodash": "^4.17.21",
"react": "^17.0.2",
"validatorjs": "^3.22.1"
}
},
"node_modules/jet-tools/node_modules/react": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
"integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==",
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/joi": {
"version": "17.11.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz",
@ -12736,6 +12769,14 @@ @@ -12736,6 +12769,14 @@
"react": "18.2.0"
}
},
"node_modules/react-native-animatable": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/react-native-animatable/-/react-native-animatable-1.3.3.tgz",
"integrity": "sha512-2ckIxZQAsvWn25Ho+DK3d1mXIgj7tITkrS4pYDvx96WyOttSvzzFeQnM2od0+FUMzILbdHDsDEqZvnz1DYNQ1w==",
"dependencies": {
"prop-types": "^15.7.2"
}
},
"node_modules/react-native-animated-loader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/react-native-animated-loader/-/react-native-animated-loader-1.0.0.tgz",
@ -12786,6 +12827,39 @@ @@ -12786,6 +12827,39 @@
"react-native": "*"
}
},
"node_modules/react-native-iphone-x-helper": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz",
"integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg==",
"peerDependencies": {
"react-native": ">=0.42.0"
}
},
"node_modules/react-native-keyboard-aware-scroll-view": {
"version": "0.9.5",
"resolved": "https://registry.npmjs.org/react-native-keyboard-aware-scroll-view/-/react-native-keyboard-aware-scroll-view-0.9.5.tgz",
"integrity": "sha512-XwfRn+T/qBH9WjTWIBiJD2hPWg0yJvtaEw6RtPCa5/PYHabzBaWxYBOl0usXN/368BL1XktnZPh8C2lmTpOREA==",
"dependencies": {
"prop-types": "^15.6.2",
"react-native-iphone-x-helper": "^1.0.3"
},
"peerDependencies": {
"react-native": ">=0.48.4"
}
},
"node_modules/react-native-modal": {
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/react-native-modal/-/react-native-modal-13.0.1.tgz",
"integrity": "sha512-UB+mjmUtf+miaG/sDhOikRfBOv0gJdBU2ZE1HtFWp6UixW9jCk/bhGdHUgmZljbPpp0RaO/6YiMmQSSK3kkMaw==",
"dependencies": {
"prop-types": "^15.6.2",
"react-native-animatable": "1.3.3"
},
"peerDependencies": {
"react": "*",
"react-native": ">=0.65.0"
}
},
"node_modules/react-native-safe-area-context": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.7.4.tgz",
@ -14562,6 +14636,11 @@ @@ -14562,6 +14636,11 @@
"node": ">=10.12.0"
}
},
"node_modules/validatorjs": {
"version": "3.22.1",
"resolved": "https://registry.npmjs.org/validatorjs/-/validatorjs-3.22.1.tgz",
"integrity": "sha512-451KiCt/3E8qV/8fOUdO0YkA8zUdQBNVxubg9jvgEB+JAg9IlRKrClzwq2ir2ndj7TWmPYQ7bXFb4BxcyX2iWw=="
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@ -18167,6 +18246,12 @@ @@ -18167,6 +18246,12 @@
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true
},
"@types/lodash": {
"version": "4.14.201",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.201.tgz",
"integrity": "sha512-y9euML0cim1JrykNxADLfaG0FgD1g/yTHwUs/Jg9ZIU7WKj2/4IW9Lbb1WZbvck78W/lfGXFfe+u2EGfIJXdLQ==",
"dev": true
},
"@types/node": {
"version": "20.9.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz",
@ -22318,6 +22403,27 @@ @@ -22318,6 +22403,27 @@
}
}
},
"jet-tools": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/jet-tools/-/jet-tools-1.3.0.tgz",
"integrity": "sha512-m+jiMpaTIhqkaeDVlqtw51BANUKVkbokuAXbwXlA7egsL2TROIulTqCvXgsL+r0N4qs3kibEcBExoClQT7HUEw==",
"requires": {
"lodash": "^4.17.21",
"react": "^17.0.2",
"validatorjs": "^3.22.1"
},
"dependencies": {
"react": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
"integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
}
}
},
"joi": {
"version": "17.11.0",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz",
@ -24096,6 +24202,14 @@ @@ -24096,6 +24202,14 @@
}
}
},
"react-native-animatable": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/react-native-animatable/-/react-native-animatable-1.3.3.tgz",
"integrity": "sha512-2ckIxZQAsvWn25Ho+DK3d1mXIgj7tITkrS4pYDvx96WyOttSvzzFeQnM2od0+FUMzILbdHDsDEqZvnz1DYNQ1w==",
"requires": {
"prop-types": "^15.7.2"
}
},
"react-native-animated-loader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/react-native-animated-loader/-/react-native-animated-loader-1.0.0.tgz",
@ -24128,6 +24242,29 @@ @@ -24128,6 +24242,29 @@
"resolved": "https://registry.npmjs.org/react-native-icomoon/-/react-native-icomoon-0.1.1.tgz",
"integrity": "sha512-/WHF2OXHGPZcjqEHutOtMIPFBMf9wfRXiA/uA5kSAr3WLhyZZ/wNMlz7C+XFjoqAE7D+M2ycDB37z6yZmnCTQg=="
},
"react-native-iphone-x-helper": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz",
"integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg=="
},
"react-native-keyboard-aware-scroll-view": {
"version": "0.9.5",
"resolved": "https://registry.npmjs.org/react-native-keyboard-aware-scroll-view/-/react-native-keyboard-aware-scroll-view-0.9.5.tgz",
"integrity": "sha512-XwfRn+T/qBH9WjTWIBiJD2hPWg0yJvtaEw6RtPCa5/PYHabzBaWxYBOl0usXN/368BL1XktnZPh8C2lmTpOREA==",
"requires": {
"prop-types": "^15.6.2",
"react-native-iphone-x-helper": "^1.0.3"
}
},
"react-native-modal": {
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/react-native-modal/-/react-native-modal-13.0.1.tgz",
"integrity": "sha512-UB+mjmUtf+miaG/sDhOikRfBOv0gJdBU2ZE1HtFWp6UixW9jCk/bhGdHUgmZljbPpp0RaO/6YiMmQSSK3kkMaw==",
"requires": {
"prop-types": "^15.6.2",
"react-native-animatable": "1.3.3"
}
},
"react-native-safe-area-context": {
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.7.4.tgz",
@ -25368,6 +25505,11 @@ @@ -25368,6 +25505,11 @@
"convert-source-map": "^2.0.0"
}
},
"validatorjs": {
"version": "3.22.1",
"resolved": "https://registry.npmjs.org/validatorjs/-/validatorjs-3.22.1.tgz",
"integrity": "sha512-451KiCt/3E8qV/8fOUdO0YkA8zUdQBNVxubg9jvgEB+JAg9IlRKrClzwq2ir2ndj7TWmPYQ7bXFb4BxcyX2iWw=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",

5
package.json

@ -23,13 +23,17 @@ @@ -23,13 +23,17 @@
"@reduxjs/toolkit": "^1.9.2",
"i18next": "^21.8.14",
"i18next-react-native-async-storage": "^1.0.4",
"jet-tools": "^1.3.0",
"link": "^1.5.1",
"lodash": "^4.17.21",
"react": "18.2.0",
"react-i18next": "^11.18.1",
"react-native": "0.72.7",
"react-native-animated-loader": "^1.0.0",
"react-native-gesture-handler": "^2.5.0",
"react-native-icomoon": "^0.1.1",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-modal": "^13.0.1",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "^3.27.0",
"react-native-splash-screen": "^3.3.0",
@ -45,6 +49,7 @@ @@ -45,6 +49,7 @@
"@react-native/eslint-config": "^0.72.2",
"@react-native/metro-config": "^0.72.11",
"@tsconfig/react-native": "^3.0.0",
"@types/lodash": "^4.14.201",
"@types/react": "^18.0.24",
"@types/react-native": "^0.66.15",
"@types/react-native-vector-icons": "^6.4.12",

7
react-native.config.js

@ -1,10 +1,3 @@ @@ -1,10 +1,3 @@
module.exports = {
assets: ['./src/assets/resources/fonts'],
dependencies: {
'react-native-vector-icons': {
platforms: {
ios: null,
},
},
},
};

BIN
src/assets/resources/fonts/Roboto-Bold.ttf

Binary file not shown.

BIN
src/assets/resources/fonts/Roboto-Regular.ttf

Binary file not shown.

6
src/i18n/types/index.ts

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import { CustomPack } from '../../module/shared/interfaces/custom-pack';
import { PageTitles } from '../../module/shared/interfaces/page-titles';
import { Buttons } from './buttons.types';
import {CustomPack} from '../../module/common/typing/interfaces/custom-pack';
import {PageTitles} from '../../module/common/typing/interfaces/page-titles';
import {Buttons} from './buttons.types';
import {OnBoardingLocale} from './on-boarding.types';
import {SettingLocale} from './settings.types';
export interface MainLocaleModule {

10
src/module/common/colors/colors.ts

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
export const colors = {
primaryColor: '#37296B',
secondaryColor: '#99EDCC',
textPrimary: '#FFFF',
secondaryText: '#7669C2',
red: '#E36588',
darkPurple: '#2C205C',
purple: '#A798FF',
lightPurple2: '#51418D',
}

0
src/module/shared/colors/index.ts → src/module/common/colors/index.ts

86
src/module/common/components/buttons/button-primary.component.tsx

@ -0,0 +1,86 @@ @@ -0,0 +1,86 @@
import React, { FC, PropsWithChildren } from 'react'
import {
ActivityIndicator,
DimensionValue,
StyleSheet,
TouchableOpacity,
View,
ViewStyle,
} from 'react-native'
import { Txt, TxtModType } from '../txt'
import { Font } from '../../typing'
import { $size } from '../../helpers'
import { colors } from '../../colors'
type ButtonStyleMod = 'filled' | 'outline' | 'danger'
interface IButtonPrimaryProps {
mod?: ButtonStyleMod
style?: ViewStyle
onPress: () => void
isLoading?: boolean
mb?: number
width?: DimensionValue | undefined
txtMod?: TxtModType
txtFont?: Font
txtColor?: string
disabled?: boolean
}
export const ButtonPrimary: FC<PropsWithChildren<IButtonPrimaryProps>> = ({
children,
style,
onPress,
isLoading,
mb = $size(20),
width = '100%',
txtFont = Font.Roboto700,
txtMod = 'md',
txtColor = colors.textPrimary,
disabled = false,
}) => {
if (isLoading) {
return (
<View style={style}>
<ActivityIndicator
style={[styles.loader, { marginBottom: mb, width }]}
/>
</View>
)
}
return (
<TouchableOpacity
activeOpacity={0.6}
disabled={disabled}
onPress={onPress}
style={[styles.container, style, { marginBottom: mb, width }]}>
<Txt
font={txtFont}
mod={txtMod}
style={[styles.txtBtn, { color: txtColor }]}>
{children}
</Txt>
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
container: {
backgroundColor: colors.red,
alignItems: 'center',
justifyContent: 'center',
borderRadius: 60,
height: $size(50),
},
txtBtn: {
color: colors.textPrimary,
},
loader: {
height: $size(56, 54),
},
})

29
src/module/common/components/buttons/button-with-icon.tsx

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
import React from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { colors } from '../../colors'
import { Icon } from '../icon'
import { $size } from '../../helpers'
interface IProps {
iconName: string
onPress: () => void
}
export const RedButton: React.FC<IProps> = ({ iconName, onPress }) => {
return (
<TouchableOpacity style={styles.container} onPress={onPress}>
<Icon name={iconName} size={$size(24)} />
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
container: {
borderRadius: 60,
backgroundColor: colors.red,
height: $size(50),
width: $size(101),
justifyContent: 'center',
alignItems: 'center',
},
})

0
src/module/shared/components/buttons/go-back.component.tsx → src/module/common/components/buttons/go-back.component.tsx

3
src/module/common/components/buttons/index.ts

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
export * from './go-back.component'
export * from './button-primary.component'
export * from './button-with-icon'

0
src/module/shared/components/header/header.component.tsx → src/module/common/components/header/header.component.tsx

0
src/module/shared/components/header/index.ts → src/module/common/components/header/index.ts

32
src/module/common/components/icon/icon.component.tsx

@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
import React, { FC } from 'react'
import { createIconSetFromFontello } from 'react-native-vector-icons'
import { ColorValue, TouchableOpacity, ViewStyle } from 'react-native'
import { fontelloConfig } from '../../config'
const FontelloIcon = createIconSetFromFontello(fontelloConfig)
interface IProps {
name: string
size: number
color?: ColorValue
style?: any
onPress?: () => void
buttonStyle?: ViewStyle | ViewStyle[]
disabled?: boolean
}
export const Icon: FC<IProps> = props => {
if (props.onPress) {
return (
<TouchableOpacity
disabled={props.disabled}
onPress={props.onPress}
style={props.buttonStyle}
activeOpacity={0.3}>
<FontelloIcon {...props} onPress={() => null} />
</TouchableOpacity>
)
}
return <FontelloIcon {...props} />
}

1
src/module/common/components/icon/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './icon.component'

5
src/module/shared/components/index.ts → src/module/common/components/index.ts

@ -1,4 +1,7 @@ @@ -1,4 +1,7 @@
export * from './Icon';
export * from './icon';
export * from './buttons';
export * from './header';
export * from './layout';
export * from './modal';
export * from './txt';

2
src/module/common/components/layout/index.ts

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
export * from './screen-layout-content.component'
export * from './screen-layout.component'

93
src/module/common/components/layout/screen-layout-content.component.tsx

@ -0,0 +1,93 @@ @@ -0,0 +1,93 @@
import React, { FC } from 'react'
import {
KeyboardAvoidingView,
Platform,
StyleSheet,
View,
ViewStyle,
} from 'react-native'
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
import { $size } from '~modules/common/helpers'
interface ScreenLayoutContentProps {
children: JSX.Element | JSX.Element[]
header?: () => React.ReactNode
horizontalPadding?: number
needScroll?: Boolean
scrollStyle?: ViewStyle
viewStyle?: ViewStyle
leftBottomRound?: boolean
background?: string
keyboardSpacerOn?: boolean
scrollRef?: React.MutableRefObject<KeyboardAwareScrollView>
extraHeight?: number
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined
topPadding?: number
}
export const ScreenLayoutContent: FC<ScreenLayoutContentProps> = ({
children,
header,
topPadding = 16,
horizontalPadding = 16,
needScroll,
scrollStyle,
viewStyle,
scrollRef,
extraHeight = 160,
pointerEvents = undefined,
}) => {
if (needScroll) {
return (
<View style={styles.view}>
{header && header()}
<KeyboardAwareScrollView
ref={scrollRef}
enableAutomaticScroll={true}
keyboardShouldPersistTaps="handled"
extraHeight={extraHeight}
scrollEventThrottle={20}
pointerEvents={pointerEvents}
contentContainerStyle={[
{
paddingTop: 16,
paddingHorizontal: $size(horizontalPadding),
},
scrollStyle,
]}>
{children}
</KeyboardAwareScrollView>
</View>
)
} else {
return (
<KeyboardAvoidingView
style={{ flex: 1 }}
behavior="height"
keyboardVerticalOffset={Platform.OS === 'android' ? 50 : 70}>
<View style={styles.view}>
{header && header()}
<View
style={[
viewStyle,
{
paddingTop: topPadding,
paddingHorizontal: $size(horizontalPadding),
flex: 1,
},
]}
pointerEvents={pointerEvents}>
{children}
</View>
</View>
</KeyboardAvoidingView>
)
}
}
const styles = StyleSheet.create({
view: {
flex: 1,
zIndex: 2,
},
})

98
src/module/common/components/layout/screen-layout.component.tsx

@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
import React, { ReactElement } from 'react'
import {
ColorValue,
StatusBar,
StyleSheet,
View,
ViewStyle,
} from 'react-native'
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { ScreenLayoutContent } from './screen-layout-content.component'
import _ from 'lodash'
import { gcService } from '../../tools'
import { colors } from '../../colors'
export interface ScreenLayoutProps {
children: JSX.Element | JSX.Element[]
needScroll?: Boolean
scrollStyle?: ViewStyle
viewStyle?: ViewStyle
leftBottomRound?: boolean
statusBarBg?: ColorValue
background?: string
horizontalPadding?: number
keyboardSpacerOn?: boolean
headerComponent?: ReactElement
scrollRef?: React.MutableRefObject<KeyboardAwareScrollView>
extraHeight?: number
footer?: () => ReactElement
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined
bottomSafeArea?: boolean
bottomBarSafeArea?: boolean
topPadding?: number
}
type StatusBarStyleConfig = {
light: 'dark-content'
dark: 'light-content'
}
const statusBarStyleConfig: StatusBarStyleConfig = {
light: 'dark-content',
dark: 'light-content',
}
export const ScreenLayout = ({
statusBarBg,
background,
bottomSafeArea = false,
topPadding,
bottomBarSafeArea = false,
...props
}: ScreenLayoutProps) => {
const insets = useSafeAreaInsets()
const heightTopDefault = _.defaultTo(
Math.max(insets.top, gcService.get('insetsTop')),
50,
)
return (
<>
<View
style={{
backgroundColor: colors.primaryColor,
height: heightTopDefault,
width: '100%',
}}>
<StatusBar
barStyle="light-content"
backgroundColor={colors.primaryColor}
/>{' '}
</View>
<View
style={[
styles.container,
{
backgroundColor: _.defaultTo(
background,
colors.primaryColor,
),
},
]}>
<ScreenLayoutContent
{...props}
header={() => props.headerComponent}
topPadding={topPadding}
/>
{props.footer ? props.footer() : null}
</View>
</>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
})

13
src/module/common/components/modal/atoms/body-modal.atom.tsx

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
import React from 'react'
import { StyleSheet, View } from 'react-native'
export const ModalBodyAtom = ({ children }: { children?: React.ReactNode }) => (
<View style={styles.body}>{children}</View>
)
const styles = StyleSheet.create({
body: {
justifyContent: 'center',
minHeight: 100,
},
})

20
src/module/common/components/modal/atoms/container-modal.atom.tsx

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
import React from 'react'
import { StyleSheet, View, ViewStyle } from 'react-native'
import { colors } from '../../../colors'
export const ModalContainerAtom = ({
children,
style,
}: {
children: React.ReactNode
style?: ViewStyle
}) => {
return <View style={[styles.container, style]}>{children}</View>
}
const styles = StyleSheet.create({
container: {
backgroundColor: colors.darkPurple,
borderRadius: 4,
},
})

16
src/module/common/components/modal/atoms/footer-modal.atom.tsx

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
import React from 'react'
import { StyleSheet, View } from 'react-native'
export const ModalFooterAtom = ({
children,
}: {
children?: React.ReactNode
}) => <View style={styles.footer}>{children}</View>
const styles = StyleSheet.create({
footer: {
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
},
})

14
src/module/common/components/modal/atoms/header-modal.atom.tsx

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
import React from 'react'
import { StyleSheet, View } from 'react-native'
export const ModalHeaderAtom = ({
children,
}: {
children?: React.ReactNode
}) => <View style={styles.header}>{children}</View>
const styles = StyleSheet.create({
header: {
justifyContent: 'center',
},
})

4
src/module/common/components/modal/atoms/index.ts

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
export * from './header-modal.atom'
export * from './body-modal.atom'
export * from './footer-modal.atom'
export * from './container-modal.atom'

1
src/module/common/components/modal/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './modal'

61
src/module/common/components/modal/modal.tsx

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
import React from 'react'
import RNModal, { ModalProps } from 'react-native-modal'
import { getDimensions } from '../../helpers'
import {
ModalBodyAtom,
ModalContainerAtom,
ModalFooterAtom,
ModalHeaderAtom,
} from './atoms'
interface Props extends Partial<ModalProps> {
isVisible: boolean
children: React.ReactNode
onClose: () => void
positionModal?:
| 'center'
| 'flex-start'
| 'flex-end'
| 'space-between'
| 'space-around'
| 'space-evenly'
}
const dimensions = getDimensions()
export const ModalComponent = ({
isVisible = false,
children,
positionModal = 'center',
onClose,
...props
}: Props) => {
return (
<RNModal
deviceHeight={dimensions.height}
deviceWidth={dimensions.width}
statusBarTranslucent
isVisible={isVisible}
animationInTiming={600}
animationOutTiming={300}
backdropTransitionInTiming={300}
backdropTransitionOutTiming={300}
backdropOpacity={0.7}
hasBackdrop={true}
onBackdropPress={onClose}
style={{
marginHorizontal: 0,
marginVertical: 0,
justifyContent: positionModal,
paddingHorizontal: 16,
}}
{...props}>
{children}
</RNModal>
)
}
ModalComponent.Header = ModalHeaderAtom
ModalComponent.Container = ModalContainerAtom
ModalComponent.Body = ModalBodyAtom
ModalComponent.Footer = ModalFooterAtom

0
src/module/shared/components/name-title/name-title.tsx → src/module/common/components/name-title/name-title.tsx

22
src/module/shared/components/question-block/question-block.tsx → src/module/common/components/question-block/question-block.tsx

@ -2,7 +2,7 @@ import {StyleSheet, View, Text, Image} from 'react-native'; @@ -2,7 +2,7 @@ import {StyleSheet, View, Text, Image} from 'react-native';
import {colors} from '../../colors';
import React, {useEffect, useState} from 'react';
import {useNavigation} from '@react-navigation/native';
import {RouteKey} from '../../enums';
import {RouteKey} from '../../typing/enums';
import {useAppDispatch, useAppSelector} from '../../../../store/hooks';
import {
getStep,
@ -12,10 +12,17 @@ import { @@ -12,10 +12,17 @@ import {
getShuffledTruths,
shuffleTruths,
} from '../../../services/truths/truth-slice';
import {getShuffledDares, shuffleDares} from '../../../services/dares/dares-slice';
import { selectPosts, selectShuffled, shuffleItems } from '../../../services/game-items/game-items-slice';
import { useTranslation } from 'react-i18next';
import { GameItem } from '../../interfaces/game-item';
import {
getShuffledDares,
shuffleDares,
} from '../../../services/dares/dares-slice';
import {
selectPosts,
selectShuffled,
shuffleItems,
} from '../../../services/game-items/game-items-slice';
import {useTranslation} from 'react-i18next';
import {GameItem} from '../../typing/interfaces/game-item';
interface IProps {
isQuestions: boolean;
@ -27,7 +34,6 @@ export const QuestionBlock: React.FC<IProps> = ({isQuestions}) => { @@ -27,7 +34,6 @@ export const QuestionBlock: React.FC<IProps> = ({isQuestions}) => {
const {i18n} = useTranslation();
const lang = i18n.language;
const currentStep = useAppSelector(getStep);
const shuffledTruths = useAppSelector(getShuffledTruths);
@ -35,8 +41,8 @@ export const QuestionBlock: React.FC<IProps> = ({isQuestions}) => { @@ -35,8 +41,8 @@ export const QuestionBlock: React.FC<IProps> = ({isQuestions}) => {
const gameItems = useAppSelector(selectShuffled);
const dares = gameItems.filter((dare) => dare.isDare);
const questions = gameItems.filter((question) => !question.isDare);
const dares = gameItems.filter(dare => dare.isDare);
const questions = gameItems.filter(question => !question.isDare);
console.log(dares);

0
src/module/shared/components/text-containers/main-text-container.tsx → src/module/common/components/text-containers/main-text-container.tsx

1
src/module/common/components/txt/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './txt.component'

67
src/module/common/components/txt/txt.component.tsx

@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
import React, { FC } from 'react'
import { Text, TextStyle, TextProps } from 'react-native'
import { $size } from '../../helpers'
import { Font } from '../../typing'
import { colors } from '../../colors'
export type TxtModType = 's' | 'es' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'
const sizes = {
s: $size(10, 8),
es: $size(12, 10),
sm: $size(14, 12),
md: $size(16, 14),
lg: $size(18, 16),
xl: $size(20, 18),
xxl: $size(24, 22),
}
const lineHeights = {
s: $size(12, 10),
es: $size(14, 12),
sm: $size(16, 14),
md: $size(18, 16),
lg: $size(20, 18),
xl: $size(22, 20),
xxl: $size(26, 24),
}
export interface TxtProps extends TextProps {
children: any
style?: TextStyle | TextStyle[]
color?: string
mod?: keyof typeof sizes
hide?: Boolean
numberOfLines?: number
font?: Font
}
export const Txt: FC<TxtProps> = ({
children,
style = {},
mod = 'es',
hide,
color,
font = Font.Roboto400,
...props
}) => {
if (hide === true) {
return null
}
return (
<Text
{...props}
style={[
{
color: color || colors.textPrimary,
fontFamily: font,
fontSize: sizes[mod],
lineHeight: lineHeights[mod],
},
style,
]}>
{children}
</Text>
)
}

0
src/module/shared/config/config.json → src/module/common/config/config.json

0
src/module/shared/config/default-packages.tsx → src/module/common/config/default-packages.tsx

0
src/module/shared/config/fontello.config.ts → src/module/common/config/fontello.config.ts

0
src/module/shared/config/index.ts → src/module/common/config/index.ts

26
src/module/common/events/app-events.ts

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
import { Events } from 'jet-tools'
export type AppEvents = {
event: {
data: string
}
alert: {
title: string
subtitle: string
btnText?: string
onClose?: () => void
}
confirm: {
cancelBtnText?: string
confirmBtnText?: string
title: string
subtitle: string
buttons: {
onPress: () => void
}[]
}
}
export const appEvents = new Events<AppEvents>()

1
src/module/common/events/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './app-events';

6
src/module/common/helpers/dimensions.helper.ts

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
import { Dimensions } from 'react-native'
export const getDimensions = () => {
const { height, width } = Dimensions.get('screen')
return { height, width }
}

0
src/module/shared/helpers/helper-height-view.ts → src/module/common/helpers/helper-height-view.ts

4
src/module/common/helpers/index.ts

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
export * from './helper-height-view';
export * from './dimensions.helper';
export * from './style.helper';

18
src/module/common/helpers/style.helper.ts

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
import { Dimensions } from 'react-native'
const screenHeight = Dimensions.get('screen').height
const BASIC_HEIGHT = 812
const coff = (screenHeight / BASIC_HEIGHT) * 100
const maxSize = (size: number) => size + (size / 100) * 20
const prepareRes = (res: number, size: number) => Math.min(res, maxSize(size))
export const $size = (size: number, min?: number) => {
const res = size * (coff / 100)
if (min) {
return Math.max(prepareRes(res, size), min)
} else {
return prepareRes(res, size)
}
}

0
src/module/shared/hooks/index.ts → src/module/common/hooks/index.ts

21
src/module/common/hooks/use-events-listener.hook.ts

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
import { useEffect } from 'react'
import { AppEvents, appEvents } from '../events'
export const useEventsListener = <T extends keyof AppEvents>(
name: T,
action: (data: AppEvents[T]) => void,
dependencies: any[] = [],
) => {
useEffect(() => {
const fn = (data: AppEvents[T]) => {
try {
action(data)
} catch (e) {
console.log('error event', e)
}
}
appEvents.on(name, fn)
return () => appEvents.off(name, fn)
}, dependencies)
}

0
src/module/shared/hooks/use-nav.hook.ts → src/module/common/hooks/use-nav.hook.ts

9
src/module/common/index.ts

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
export * from './colors'
export * from './components'
export * from './config'
export * from './typing'
export * from './helpers'
export * from './hooks'
export * from './events'
export * from './tools'
export * from './widgets'

17
src/module/common/tools/global-container.tool.ts

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
const globalData: any = {
store: null,
internetConnect: true,
scrollY: 0,
}
const set = (key: any, value: any) => {
globalData[key] = value
}
const get = (key: string) => globalData[key]
export const gcService = {
set,
get,
}

1
src/module/common/tools/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './global-container.tool'

4
src/module/common/typing/enums/fonts.enum.ts

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
export enum Font {
Roboto400 = 'Roboto-Regular',
Roboto700 = 'Roboto-Bold',
}

2
src/module/common/typing/enums/index.ts

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
export * from './route-keys'
export * from './fonts.enum'

0
src/module/shared/enums/route-keys.ts → src/module/common/typing/enums/route-keys.ts

2
src/module/common/typing/index.ts

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
export * from './interfaces';
export * from './enums';

0
src/module/shared/interfaces/custom-pack.ts → src/module/common/typing/interfaces/custom-pack.ts

0
src/module/shared/interfaces/dare.ts → src/module/common/typing/interfaces/dare.ts

0
src/module/shared/interfaces/game-item.ts → src/module/common/typing/interfaces/game-item.ts

0
src/module/shared/interfaces/index.ts → src/module/common/typing/interfaces/index.ts

0
src/module/shared/interfaces/page-titles.ts → src/module/common/typing/interfaces/page-titles.ts

0
src/module/shared/interfaces/routing.ts → src/module/common/typing/interfaces/routing.ts

0
src/module/shared/interfaces/truth.ts → src/module/common/typing/interfaces/truth.ts

203
src/module/common/widgets/alert-confirm/alert-confirm-widget.component.tsx

@ -0,0 +1,203 @@ @@ -0,0 +1,203 @@
import React, { FC, useEffect, useRef, useState } from 'react'
import { StyleSheet, TouchableOpacity, View, ViewStyle } from 'react-native'
import _ from 'lodash'
import { useEventsListener, useTheme } from '~modules/common/hooks'
import { Theme } from '~modules/common/themes/interfaces'
import { ModalComponent, Txt, ButtonPrimary } from '~modules/common/components'
import { AppEvents, appEvents } from '~modules/common/events'
import { $size } from '~modules/common/helpers'
import { Font } from '~modules/common/typing'
interface IContent {
title: string
subtitle: string
confirmBtnText?: string
cancelBtnText?: string
buttons: IContentButton[]
}
interface IContentButton {
btnText?: string
btnStyle?: ViewStyle
txtColor?: string
onPress: () => void
}
interface Params {
buttons: (() => void)[]
}
const contentInitial: IContent = {
title: '',
subtitle: '',
cancelBtnText: 'Yes',
confirmBtnText: 'No',
buttons: [
{
onPress: _.noop,
},
],
}
export const AlertConfirmWidget: FC = () => {
const { styles, theme } = useTheme(createStyles)
const settingsConfirmRef = useRef<Params>()
const [content, setContent] = useState<IContent>(contentInitial)
const [isVisible, setVisible] = useState(false)
useEventsListener(
'confirm',
data => {
settingsConfirmRef.current = {
buttons: data?.buttons.map(el => el.onPress),
}
setContent({
title: data?.title,
subtitle: data?.subtitle,
buttons: data?.buttons,
confirmBtnText: _.defaultTo(data?.confirmBtnText, 'Yes'),
cancelBtnText: _.defaultTo(data?.cancelBtnText, 'No'),
})
},
[setContent, settingsConfirmRef.current, content],
)
useEffect(() => {
if (content?.title) {
setVisible(true)
}
}, [content, settingsConfirmRef.current])
const close = () => {
setVisible(false)
}
const onConfirm = (index: number) => {
settingsConfirmRef.current.buttons[index]()
close()
}
const buttonsConfig = (buttonsOnPress: { onPress: () => void }[]) => {
return [
{
btnText: content.cancelBtnText,
btnStyle: { ...styles.button, ...styles.borderRight },
txtColor: theme.$primary,
onPress: buttonsOnPress[0].onPress,
},
{
btnText: content.confirmBtnText,
onPress: buttonsOnPress[1]?.onPress,
txtColor: theme.$primary,
btnStyle: styles.button,
},
]
}
const buttons = buttonsConfig(content.buttons)
return (
<ModalComponent
coverScreen={false}
useNativeDriverForBackdrop={true}
backdropTransitionOutTiming={400}
hideModalContentWhileAnimating={true}
backdropColor={'rgba(0,0,0,0.8)'}
animationIn="pulse"
isVisible={Boolean(isVisible)}
onBackdropPress={close}
onClose={close}
style={{ alignItems: 'center', justifyContent: 'center' }}>
<ModalComponent.Container style={styles.container}>
<View style={styles.content}>
<Txt
mod="xl"
font={Font.SFProDisplay500}
style={styles.title}>
{content?.title}
</Txt>
<Txt
mod="md"
style={styles.subtitle}
font={Font.SFProDisplay500}>
{content?.subtitle}
</Txt>
</View>
<View style={styles.buttonsContainer}>
{buttons.map((el: IContentButton, index: number) => (
<TouchableOpacity
key={index}
style={el.btnStyle}
onPress={() => onConfirm(index)}>
<Txt
mod="md"
font={Font.SFProDisplay500}
color={el.txtColor}>
{el.btnText}
</Txt>
</TouchableOpacity>
))}
</View>
</ModalComponent.Container>
</ModalComponent>
)
}
const createStyles = (theme: Theme) =>
StyleSheet.create({
container: {
borderRadius: 15,
overflow: 'hidden',
backgroundColor: '#262626',
justifyContent: 'space-between',
width: $size(270, 260),
},
content: {
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
gap: 8,
paddingHorizontal: $size(16),
paddingVertical: $size(20),
borderBottomWidth: 1,
borderBottomColor: 'rgba(255, 255, 255, 0.30)',
},
title: {
textAlign: 'center',
width: '80%',
color: theme.$textPrimary,
},
subtitle: {
textAlign: 'center',
width: '80%',
color: 'rgba(255, 255, 255, 0.50)',
},
buttonsContainer: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
},
button: {
width: '49.9%',
paddingHorizontal: $size(16),
paddingVertical: $size(12),
alignItems: 'center',
justifyContent: 'center',
},
borderRight: {
borderRightColor: 'rgba(255, 255, 255, 0.70)',
borderRightWidth: 1,
},
})
export const Confirm = {
Component: AlertConfirmWidget,
Show: (params: AppEvents['confirm']) => {
appEvents.emit('confirm', params)
},
}

1
src/module/common/widgets/alert-confirm/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './alert-confirm-widget.component'

139
src/module/common/widgets/alert/alert-widget.component.tsx

@ -0,0 +1,139 @@ @@ -0,0 +1,139 @@
import React, { useEffect, useRef, useState } from 'react'
import { StyleSheet, View } from 'react-native'
import _ from 'lodash'
import { useEventsListener } from '../../hooks/use-events-listener.hook'
import { ButtonPrimary, ModalComponent, Txt } from '../../components'
import { $size } from '../../helpers'
import { colors } from '../../colors'
import { AppEvents, appEvents } from '../../events'
interface IContent {
title: string
subtitle: string
btnText: string
}
const contentInitial: IContent = {
title: '',
subtitle: '',
btnText: 'OK',
}
export const AlertWidget = () => {
const settingsRef = useRef({
onClose: _.noop,
})
const [content, setContent] = useState<IContent>(contentInitial)
const [isVisible, setVisible] = useState(false)
useEventsListener(
'alert',
data => {
settingsRef.current = {
onClose: () => data?.onClose,
}
setContent({
title: data?.title,
subtitle: data?.subtitle,
btnText: _.defaultTo(data.btnText, contentInitial.btnText),
})
},
[setContent, settingsRef.current, content],
)
useEffect(() => {
if (content?.title) {
setVisible(true)
}
}, [content, settingsRef.current])
const close = () => {
setVisible(false)
}
const onConfirm = () => {
if (typeof settingsRef.current.onClose === 'function') {
settingsRef.current.onClose()
}
close()
}
return (
<ModalComponent
coverScreen={false}
useNativeDriverForBackdrop={true}
backdropTransitionOutTiming={400}
hideModalContentWhileAnimating={true}
backdropColor={'#787878'}
animationIn="pulse"
isVisible={Boolean(isVisible)}
onBackdropPress={close}
onClose={close}>
<ModalComponent.Container style={styles.container}>
<View style={styles.content}>
<Txt style={styles.title}>{content?.title}</Txt>
<Txt mod="md" style={styles.subtitle}>
{content?.subtitle}
</Txt>
</View>
<View style={styles.button}>
<ButtonPrimary onPress={onConfirm} mb={0}>
{content.btnText}
</ButtonPrimary>
</View>
</ModalComponent.Container>
</ModalComponent>
)
}
const styles = StyleSheet.create({
container: {
borderRadius: 16,
paddingHorizontal: 16,
paddingVertical: $size(80),
overflow: 'hidden',
backgroundColor: colors.darkPurple,
justifyContent: 'space-between',
height: $size(338),
},
content: {
justifyContent: 'center',
alignItems: 'center',
gap: 8,
},
title: {
textAlign: 'center',
width: '80%',
color: colors.textPrimary,
fontWeight: '600',
fontSize: 22,
lineHeight: 24,
},
subtitle: {
textAlign: 'center',
width: '80%',
color: colors.textPrimary,
fontWeight: '600',
},
button: {
alignSelf: 'center',
width: '100%',
},
btnTxt: {},
close: {},
bottomBtn: {},
})
export const Alert = {
Component: AlertWidget,
Show: (params: AppEvents['alert']) => {
appEvents.emit('alert', params)
},
}

1
src/module/common/widgets/alert/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './alert-widget.component'

54
src/module/common/widgets/bottom-sheet/atoms/action-sheet-button.atom.tsx

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
import _ from 'lodash'
import React, { FC } from 'react'
import { StyleSheet } from 'react-native'
import { TouchableOpacity } from 'react-native'
import { Icon } from '~modules/common'
import { Txt } from '~modules/common/components/typography'
import { $size } from '~modules/common/helpers'
interface IProps {
iconName: string
onPress: () => void
label: string
showBottomBorder: boolean
}
export const ActionSheetButtonAtom: FC<IProps> = ({
iconName,
onPress,
showBottomBorder,
label,
}) => {
const renderIcon = () => {
if (!iconName) {
return null
}
return <Icon name={iconName} size={$size(28)} color={'#007AFF'} />
}
return (
<TouchableOpacity
onPress={onPress}
style={[
styles.container,
{ borderBottomWidth: showBottomBorder ? 1 : 0 },
]}>
{renderIcon()}
<Txt style={styles.label} color="#FFFFFF" mod="md">
{label}
</Txt>
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'center',
backgroundColor: '#161616',
padding: $size(10),
borderBottomColor: 'rgba(212, 212, 212, 0.1)',
},
label: {
marginLeft: $size(10),
},
})

77
src/module/common/widgets/bottom-sheet/atoms/bottom-sheet-view.atom.tsx

@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
import React, { FC } from 'react'
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
import ActionSheet, { SheetProps } from 'react-native-actions-sheet'
import { Txt } from '~modules/common/components/typography'
import { SheetManager } from 'react-native-actions-sheet'
import { $size } from '~modules/common/helpers'
import { ActionSheetButtonAtom } from './action-sheet-button.atom'
import _ from 'lodash'
interface IPayloadSheet {
iconName?: string
onPress: () => void
label: string
}
export const BottomSheetView: FC<SheetProps<IPayloadSheet[]>> = ({
sheetId,
payload,
}) => {
const close = () => SheetManager.hide('bottom-sheet')
return (
<ActionSheet
id={sheetId}
containerStyle={styles.container}
defaultOverlayOpacity={0.8}
statusBarTranslucent={true}
animated>
<View style={styles.actionContainer}>
{payload.map((it, index) => {
const showBottomBorder = payload.length - 1 !== index
return (
<ActionSheetButtonAtom
key={it.label}
onPress={it.onPress}
iconName={it.iconName}
label={it.label}
showBottomBorder={showBottomBorder}
/>
)
})}
</View>
<TouchableOpacity style={styles.button} onPress={close}>
<Txt mod="md" style={styles.txtContent}>
Cancel
</Txt>
</TouchableOpacity>
</ActionSheet>
)
}
const styles = StyleSheet.create({
button: {
paddingVertical: $size(18),
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#161616',
borderRadius: 16,
},
container: {
backgroundColor: 'rgba(0,0,0,0.1)',
paddingHorizontal: $size(12),
paddingBottom: $size(35),
},
txtContent: {
color: '#FFFFFF',
fontWeight: '500',
},
actionContainer: {
borderRadius: 16,
padding: $size(10),
backgroundColor: '#161616',
flexDirection: 'column',
marginBottom: $size(16),
},
})

1
src/module/common/widgets/bottom-sheet/atoms/index.ts

@ -0,0 +1 @@ @@ -0,0 +1 @@
export * from './bottom-sheet-view.atom'

6
src/module/common/widgets/bottom-sheet/sheets.tsx

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
import { registerSheet } from 'react-native-actions-sheet'
import { BottomSheetView } from './atoms'
registerSheet('bottom-sheet', BottomSheetView)
export {}

2
src/module/common/widgets/index.ts

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
export * from './alert'
export * from './alert-confirm'

2
src/module/game/screen/select-packages.screen.tsx

@ -6,7 +6,7 @@ import { @@ -6,7 +6,7 @@ import {
RouteKey,
ScreenLayout,
useNav,
} from '../../shared';
} from '../../common';
import {ScrollView} from 'react-native-gesture-handler';
import {StyleSheet, View} from 'react-native';
import {CustomPackage} from '../../package/atoms/create-custom-package.atom';

7
src/module/package/atoms/create-custom-package.atom.tsx

@ -2,12 +2,11 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; @@ -2,12 +2,11 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import React from 'react';
import {useTranslation} from 'react-i18next';
import {StyleSheet, TouchableOpacity, View, Text} from 'react-native';
import {colors, Icon} from '../../shared';
import {colors, Icon} from '../../common';
export const CustomPackage = () => {
const {t, i18n} = useTranslation();
return (
<TouchableOpacity style={style.container}>
<View style={{flexDirection: 'row'}}>
@ -16,9 +15,7 @@ export const CustomPackage = () => { @@ -16,9 +15,7 @@ export const CustomPackage = () => {
</View>
<View style={style.textContainer}>
<Text style={style.title}>{t('customPack.title')}</Text>
<Text style={style.description}>
{t('customPack.description')}
</Text>
<Text style={style.description}>{t('customPack.description')}</Text>
</View>
</View>
</TouchableOpacity>

2
src/module/package/components/packages-item.component.tsx

@ -4,7 +4,7 @@ import {useAppDispatch} from '../../../store/hooks'; @@ -4,7 +4,7 @@ import {useAppDispatch} from '../../../store/hooks';
import {resetSteps} from '../../services/current-step/current-step-slice';
import {shuffleDares} from '../../services/dares/dares-slice';
import {shuffleTruths} from '../../services/truths/truth-slice';
import {Icon, RouteKey, useNav} from '../../shared';
import {Icon, RouteKey, useNav} from '../../common';
interface IType {
[key: string]: string;

10
src/module/privacy-policy/screens/privacy-policy.tsx

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import {useTranslation} from 'react-i18next';
import {View} from 'react-native';
import {
colors,
@ -7,9 +7,9 @@ import { @@ -7,9 +7,9 @@ import {
IRouteParams,
RouteKey,
ScreenLayout,
} from '../../shared';
import { MainTextContainer } from '../../shared/components/text-containers/main-text-container';
import { privacy } from '../config/privacy-texts';
} from '../../common';
import {MainTextContainer} from '../../common/components/text-containers/main-text-container';
import {privacy} from '../config/privacy-texts';
interface IProps extends IRouteParams {}
export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => {
@ -36,7 +36,7 @@ export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => { @@ -36,7 +36,7 @@ export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => {
rightIcon="none"
/>
}>
<MainTextContainer text={privacy[lang as keyof typeof privacy]}/>
<MainTextContainer text={privacy[lang as keyof typeof privacy]} />
</ScreenLayout>
);
};

2
src/module/root/atoms/premium-button.component.tsx

@ -3,7 +3,7 @@ import React, {FC} from 'react'; @@ -3,7 +3,7 @@ import React, {FC} from 'react';
import {useTranslation} from 'react-i18next';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {StorageKey} from '../../services/async-storage.service';
import {colors, PrimaryBtn, RouteKey, useNav} from '../../shared';
import {colors, PrimaryBtn, RouteKey, useNav} from '../../common';
interface IProps {
currentIndex: number;

2
src/module/root/components/content-on-boarding.component.tsx

@ -2,7 +2,7 @@ import React, {FC} from 'react'; @@ -2,7 +2,7 @@ import React, {FC} from 'react';
import {useTranslation} from 'react-i18next';
import {View, Text, StyleSheet} from 'react-native';
import {LangKeys} from '../../../i18n';
import {colors, heightPicture} from '../../shared';
import {colors, heightPicture} from '../../common';
import {GroupBtn} from '../atoms/premium-button.component';
import {OnBoardData} from '../config/data-on-boarding.config';
interface IProps {

2
src/module/root/navigations-groups/on-boardings-group.tsx

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import React, {FC} from 'react';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {RouteKey} from '../../shared';
import {RouteKey} from '../../common';
import {LanguageSelect, Onboarding, Setting} from '../screens';
import {SelectPackages} from '../../game/screen/select-packages.screen';
import {LoadingScreen} from '../screens/loading-screen';

6
src/module/root/screens/game.tsx

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {colors, Header, RouteKey, ScreenLayout, useNav} from '../../shared';
import {colors, Header, RouteKey, ScreenLayout, useNav} from '../../common';
import React, {FC} from 'react';
import {NameTitle} from '../../shared/components/name-title/name-title';
import {RedButton} from '../../shared/components/buttons/red-button';
import {NameTitle} from '../../common/components/name-title/name-title';
import {RedButton} from '../../common/components/buttons/button-with-icon';
import {useTranslation} from 'react-i18next';
import {useRoute} from '@react-navigation/native';

4
src/module/root/screens/language-select.screen.tsx

@ -3,8 +3,8 @@ import React, {FC} from 'react'; @@ -3,8 +3,8 @@ import React, {FC} from 'react';
import {useTranslation} from 'react-i18next';
import {Image, StyleSheet, Text, View} from 'react-native';
import {LangKeys} from '../../../i18n';
import { StorageKey, storageService } from '../../services/async-storage.service';
import {IRouteParams, RouteKey, colors, ScreenLayout} from '../../shared';
import {StorageKey, storageService} from '../../services/async-storage.service';
import {IRouteParams, RouteKey, colors, ScreenLayout} from '../../common';
import {LanguageItem} from '../components';
import UALogo from '../../../assets/icons/UKR.svg';
import UAELogo from '../../../assets/icons/UAE.svg';

2
src/module/root/screens/loading-screen.tsx

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import {ActivityIndicator, StyleSheet, View} from 'react-native';
import React, {useEffect} from 'react';
import {ScreenLayout, colors, RouteKey, useNav} from '../../shared';
import {ScreenLayout, colors, RouteKey, useNav} from '../../common';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {StorageKey} from '../../services/async-storage.service';
import {useTranslation} from 'react-i18next';

2
src/module/root/screens/on-boarding.screen.tsx

@ -5,7 +5,7 @@ import { @@ -5,7 +5,7 @@ import {
IRouteParams,
colors,
ScreenLayout,
} from '../../shared';
} from '../../common';
import {ContentOnBoarding} from '../components';
interface IProps extends IRouteParams {}

8
src/module/root/screens/questions.tsx

@ -6,11 +6,11 @@ import { @@ -6,11 +6,11 @@ import {
ScreenLayout,
PrimaryBtn,
useNav,
} from '../../shared';
} from '../../common';
import React, {useState} from 'react';
import {NameTitle} from '../../shared/components/name-title/name-title';
import {QuestionBlock} from '../../shared/components/question-block/question-block';
import {MainModal} from '../../shared/components/modals/main-modal';
import {NameTitle} from '../../common/components/name-title/name-title';
import {QuestionBlock} from '../../common/components/question-block/question-block';
import {MainModal} from '../../common/components/modals/main-modal';
import {useAppDispatch} from '../../../store/hooks';
import {
nextStep,

2
src/module/root/screens/settings.screen.tsx

@ -3,7 +3,7 @@ import {useTranslation} from 'react-i18next'; @@ -3,7 +3,7 @@ import {useTranslation} from 'react-i18next';
import {View} from 'react-native';
import {SettingsItem} from '../../setting/components/Settings-Item.component';
import {SettingsData} from '../../setting/config/data-setting.config';
import {Header, IRouteParams, colors, ScreenLayout, useNav} from '../../shared';
import {Header, IRouteParams, colors, ScreenLayout, useNav} from '../../common';
interface IProps extends IRouteParams {}

42
src/module/services/dares/dares-slice.ts

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
import {createSlice, PayloadAction} from '@reduxjs/toolkit';
import {RootState} from '../../../store/store';
import { Dare } from '../../shared/interfaces/dare';
import {Truth} from '../../shared/interfaces/truth';
import {Dare} from '../../common/typing/interfaces/dare';
import {Truth} from '../../common/typing/interfaces/truth';
import {shuffle} from '../shuffle/shuffle';
interface DaresState {
@ -13,25 +13,25 @@ interface DaresState { @@ -13,25 +13,25 @@ interface DaresState {
const initialState: DaresState = {
dares: [
{
id: 0,
dare: 'Дія 1',
},
{
id: 1,
dare: 'Дія 2',
},
{
id: 2,
dare: 'Дія 3',
},
{
id: 3,
dare: 'Дія 4',
},
{
id: 4,
dare: 'Дія 5',
},
id: 0,
dare: 'Дія 1',
},
{
id: 1,
dare: 'Дія 2',
},
{
id: 2,
dare: 'Дія 3',
},
{
id: 3,
dare: 'Дія 4',
},
{
id: 4,
dare: 'Дія 5',
},
],
shaffledDares: [],
};

10
src/module/services/game-items/game-items-slice.ts

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
import {GameItem} from '../../shared/interfaces/game-item';
import {GameItem} from '../../common/typing/interfaces/game-item';
import firestore from '@react-native-firebase/firestore';
import {RootState} from '../../../store/store';
import { shuffle } from '../shuffle/shuffle';
import {shuffle} from '../shuffle/shuffle';
export interface PostsState {
posts: GameItem[];
@ -24,9 +24,9 @@ export const fetchPostsAsync = createAsyncThunk( @@ -24,9 +24,9 @@ export const fetchPostsAsync = createAsyncThunk(
const data = [] as GameItem[];
let querySnapshot = await firestore().collection('GameItems').get();
querySnapshot.forEach(doc => {
const item = doc.data();
data.push(item as GameItem);
});
const item = doc.data();
data.push(item as GameItem);
});
return data;
},
);

5
src/module/services/truths/truth-slice.ts

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import {createSlice, PayloadAction} from '@reduxjs/toolkit';
import {RootState} from '../../../store/store';
import {Truth} from '../../shared/interfaces/truth';
import {Truth} from '../../common/typing/interfaces/truth';
import {shuffle} from '../shuffle/shuffle';
interface TruthsState {
@ -48,6 +48,7 @@ export const TruthSlice = createSlice({ @@ -48,6 +48,7 @@ export const TruthSlice = createSlice({
export const {shuffleTruths} = TruthSlice.actions;
export const getTruths = (state: RootState) => state.truth.truths;
export const getShuffledTruths = (state: RootState) => state.truth.shaffledTruth;
export const getShuffledTruths = (state: RootState) =>
state.truth.shaffledTruth;
export default TruthSlice.reducer;

2
src/module/setting/components/Settings-Item.component.tsx

@ -3,7 +3,7 @@ import React, {FC} from 'react'; @@ -3,7 +3,7 @@ import React, {FC} from 'react';
import {useTranslation} from 'react-i18next';
import {StyleSheet, Text, View, TouchableOpacity} from 'react-native';
import {settingTranslation} from '../../../i18n/locales/en/settings.translation';
import {Icon, RouteKey} from '../../shared';
import {Icon, RouteKey} from '../../common';
interface IProps {
title: string;

11
src/module/shared/colors/colors.ts

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
export const colors = {
primaryColor: '#37296B',
secondaryColor: '#99EDCC',
prymaryText: '#FFFF',
secondaryText: '#7669C2',
prymaryBtn: '#E36588',
darkPurple: '#2C205C',
purple: '#A798FF',
darkPurple2: '#51418D',
white: '#FFFFFF',
};

14
src/module/shared/components/Icon/Icon.component.tsx

@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
import React, {FC} from 'react';
import {ColorValue, Text, TouchableOpacity, ViewStyle} from 'react-native';
import {createIconSetFromFontello} from 'react-native-vector-icons';
import {fontelloConfig} from '../../config/';
const Svg = createIconSetFromFontello(fontelloConfig);
interface IProps {
name: string;
size: number;
color?: ColorValue;
}
export const Icon: FC<IProps> = props => {
return <Svg name={props.name} size={props.size} color={props.color} />;
};

1
src/module/shared/components/Icon/index.ts

@ -1 +0,0 @@ @@ -1 +0,0 @@
export * from './Icon.component';

2
src/module/shared/components/buttons/index.ts

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
export * from './go-back.component';
export * from './primary-btn.component';

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save