diff --git a/android/app/google-services.json b/android/app/google-services.json
index 4769970..e9f143d 100644
--- a/android/app/google-services.json
+++ b/android/app/google-services.json
@@ -1,8 +1,8 @@
{
"project_info": {
- "project_number": "180425292880",
+ "project_number": "552568521005",
"firebase_url": "https://truthordare-6493e-default-rtdb.europe-west1.firebasedatabase.app",
- "project_id": "truthordare-6493e",
+ "project_id": "truth-or-dare-fcc54",
"storage_bucket": "truthordare-6493e.appspot.com"
},
"client": [
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index de17c33..ffe2afb 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -7,7 +7,6 @@
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
- android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
diff --git a/android/app/src/main/ic_launcher-playstore.png b/android/app/src/main/ic_launcher-playstore.png
new file mode 100644
index 0000000..38943ba
Binary files /dev/null and b/android/app/src/main/ic_launcher-playstore.png differ
diff --git a/android/app/src/main/res/drawable-mdpi/splash_image.png b/android/app/src/main/res/drawable-mdpi/splash_image.png
deleted file mode 100644
index 6cb817a..0000000
Binary files a/android/app/src/main/res/drawable-mdpi/splash_image.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable-xhdpi/splash_image.png b/android/app/src/main/res/drawable-xhdpi/splash_image.png
deleted file mode 100644
index 495b766..0000000
Binary files a/android/app/src/main/res/drawable-xhdpi/splash_image.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable-xxhdpi/splash_image.png b/android/app/src/main/res/drawable-xxhdpi/splash_image.png
deleted file mode 100644
index 495b766..0000000
Binary files a/android/app/src/main/res/drawable-xxhdpi/splash_image.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable-hdpi/splash_image.png b/android/app/src/main/res/drawable/splash_screen.png
similarity index 100%
rename from android/app/src/main/res/drawable-hdpi/splash_image.png
rename to android/app/src/main/res/drawable/splash_screen.png
diff --git a/android/app/src/main/res/drawable/splashscreen.xml b/android/app/src/main/res/drawable/splashscreen.xml
deleted file mode 100644
index 6656027..0000000
--- a/android/app/src/main/res/drawable/splashscreen.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
- -
-
-
-
-
diff --git a/android/app/src/main/res/layout/launch_screen.xml b/android/app/src/main/res/layout/launch_screen.xml
deleted file mode 100644
index 0a597de..0000000
--- a/android/app/src/main/res/layout/launch_screen.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
diff --git a/android/app/src/main/res/layout/splash_screen.xml b/android/app/src/main/res/layout/splash_screen.xml
new file mode 100644
index 0000000..982e816
--- /dev/null
+++ b/android/app/src/main/res/layout/splash_screen.xml
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..036d09b
--- /dev/null
+++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..036d09b
--- /dev/null
+++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-hdpi-v26/ic_foreground.png b/android/app/src/main/res/mipmap-hdpi-v26/ic_foreground.png
deleted file mode 100644
index 8af92cd..0000000
Binary files a/android/app/src/main/res/mipmap-hdpi-v26/ic_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher.xml
deleted file mode 100644
index 4115c03..0000000
--- a/android/app/src/main/res/mipmap-hdpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
index 8af92cd..95add52 100644
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..76b09b1
Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
index 1b52399..47a12d6 100644
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-ldpi-v26/ic_foreground.png b/android/app/src/main/res/mipmap-ldpi-v26/ic_foreground.png
deleted file mode 100644
index afade04..0000000
Binary files a/android/app/src/main/res/mipmap-ldpi-v26/ic_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher.xml
deleted file mode 100644
index 4115c03..0000000
--- a/android/app/src/main/res/mipmap-ldpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-ldpi/ic_launcher.png b/android/app/src/main/res/mipmap-ldpi/ic_launcher.png
deleted file mode 100644
index afade04..0000000
Binary files a/android/app/src/main/res/mipmap-ldpi/ic_launcher.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-mdpi-v26/ic_foreground.png b/android/app/src/main/res/mipmap-mdpi-v26/ic_foreground.png
deleted file mode 100644
index 61d372d..0000000
Binary files a/android/app/src/main/res/mipmap-mdpi-v26/ic_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher.xml
deleted file mode 100644
index 4115c03..0000000
--- a/android/app/src/main/res/mipmap-mdpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
index 61d372d..13a35df 100644
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..ccdcac2
Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
index 115a4c7..1c22b70 100644
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi-v26/ic_foreground.png b/android/app/src/main/res/mipmap-xhdpi-v26/ic_foreground.png
deleted file mode 100644
index 66d217c..0000000
Binary files a/android/app/src/main/res/mipmap-xhdpi-v26/ic_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml
deleted file mode 100644
index 4115c03..0000000
--- a/android/app/src/main/res/mipmap-xhdpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
index 66d217c..904ef13 100644
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..25e17b2
Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
index 459ca60..a7caafd 100644
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi-v26/ic_foreground.png b/android/app/src/main/res/mipmap-xxhdpi-v26/ic_foreground.png
deleted file mode 100644
index f332eb1..0000000
Binary files a/android/app/src/main/res/mipmap-xxhdpi-v26/ic_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml
deleted file mode 100644
index 4115c03..0000000
--- a/android/app/src/main/res/mipmap-xxhdpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
index f332eb1..1bd9b23 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..3f934df
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
index 8e19b41..603f4c9 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_foreground.png
deleted file mode 100644
index 250a9d7..0000000
Binary files a/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml
deleted file mode 100644
index 4115c03..0000000
--- a/android/app/src/main/res/mipmap-xxxhdpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
index 250a9d7..df2e3d3 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
new file mode 100644
index 0000000..b8b1be4
Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
index 4c19a13..0f30677 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/android/app/src/main/res/values/colors-icon.xml b/android/app/src/main/res/values/colors-icon.xml
deleted file mode 100644
index 95416aa..0000000
--- a/android/app/src/main/res/values/colors-icon.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-#37296B
-
diff --git a/android/app/src/main/res/values/colors-splash.xml b/android/app/src/main/res/values/colors-splash.xml
deleted file mode 100644
index fc084dd..0000000
--- a/android/app/src/main/res/values/colors-splash.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- #37296B
-
diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml
new file mode 100644
index 0000000..7b3e003
--- /dev/null
+++ b/android/app/src/main/res/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
+
+
+ #37296B
+
\ No newline at end of file
diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml
index 07195f0..64a91b5 100644
--- a/android/app/src/main/res/values/strings.xml
+++ b/android/app/src/main/res/values/strings.xml
@@ -1,3 +1,3 @@
- Truth
+ Truth or Dare
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
index f37f311..200838f 100644
--- a/android/app/src/main/res/values/styles.xml
+++ b/android/app/src/main/res/values/styles.xml
@@ -1,12 +1,10 @@
-
-
diff --git a/android/build.gradle b/android/build.gradle
index bae0a4b..400d084 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -20,9 +20,9 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath("com.android.tools.build:gradle")
- classpath("com.facebook.react:react-native-gradle-plugin")
- classpath ("com.google.gms:google-services:4.3.14")
+ classpath "com.android.tools.build:gradle"
+ classpath "com.facebook.react:react-native-gradle-plugin"
+ classpath 'com.google.gms:google-services:4.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/index.js b/index.js
index a850d03..cbef63e 100644
--- a/index.js
+++ b/index.js
@@ -2,8 +2,8 @@
* @format
*/
-import {AppRegistry} from 'react-native';
-import App from './App';
-import {name as appName} from './app.json';
+import { AppRegistry } from 'react-native'
+import App from './App'
+import { name as appName } from './app.json'
-AppRegistry.registerComponent(appName, () => App);
+AppRegistry.registerComponent(appName, () => App)
diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist
index 618d8b7..6de5eb2 100644
--- a/ios/GoogleService-Info.plist
+++ b/ios/GoogleService-Info.plist
@@ -2,22 +2,18 @@
- CLIENT_ID
- 180425292880-bfueoq3p0oq0b0lf2qviebio2q338eu8.apps.googleusercontent.com
- REVERSED_CLIENT_ID
- com.googleusercontent.apps.180425292880-bfueoq3p0oq0b0lf2qviebio2q338eu8
API_KEY
- AIzaSyDsJWXu0NtusG6fric25R8zN-j-LSHd_tg
+ AIzaSyDmYx2wadrC7tLUI-eS_tgUVuH0GrB_4mE
GCM_SENDER_ID
- 180425292880
+ 552568521005
PLIST_VERSION
1
BUNDLE_ID
- org.reactjs.native.example.Truth
+ com.truth
PROJECT_ID
- truthordare-6493e
+ truth-or-dare-fcc54
STORAGE_BUCKET
- truthordare-6493e.appspot.com
+ truth-or-dare-fcc54.appspot.com
IS_ADS_ENABLED
IS_ANALYTICS_ENABLED
@@ -29,8 +25,6 @@
IS_SIGNIN_ENABLED
GOOGLE_APP_ID
- 1:180425292880:ios:7109aea721588b757da555
- DATABASE_URL
- https://truthordare-6493e-default-rtdb.europe-west1.firebasedatabase.app
+ 1:552568521005:ios:66c16d5229fe90142353a4
\ No newline at end of file
diff --git a/ios/Podfile b/ios/Podfile
index a9e46db..e0f9844 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -18,7 +18,8 @@ flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : Flip
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
- use_frameworks! :linkage => linkage.to_sym
+ use_frameworks! :linkage => :static
+ $RNFirebaseAsStaticFramework = true
end
target 'Truth' do
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index b19d3e0..30d2d7b 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -1588,6 +1588,6 @@ SPEC CHECKSUMS:
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
-PODFILE CHECKSUM: ce2deb38e840b0f84d5baf01ec7da0d590e1e158
+PODFILE CHECKSUM: 0c63220a19ca9fd3d2ce02dc5eecdb8c820bf5ab
COCOAPODS: 1.12.1
diff --git a/ios/Truth.xcodeproj/project.pbxproj b/ios/Truth.xcodeproj/project.pbxproj
index c432774..357b4d1 100644
--- a/ios/Truth.xcodeproj/project.pbxproj
+++ b/ios/Truth.xcodeproj/project.pbxproj
@@ -11,10 +11,10 @@
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 */; };
- 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 */; };
63120D812B0DE8C900E76BCD /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63120D802B0DE8C900E76BCD /* StoreKit.framework */; };
+ 6318D32F2B459A5D0034E561 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6318D32E2B459A5D0034E561 /* GoogleService-Info.plist */; };
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 */; };
@@ -46,9 +46,9 @@
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 = ""; };
3F5CDF302995158300BD4B7F /* ios */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ios; sourceTree = ""; };
- 3F5CDF342995282400BD4B7F /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; };
52BCE0EE28C76941008C74BC /* Fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Fonts; sourceTree = ""; };
63120D802B0DE8C900E76BCD /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
+ 6318D32E2B459A5D0034E561 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../Downloads/GoogleService-Info.plist"; sourceTree = ""; };
637B62A12B07B836008D8917 /* Roboto-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Regular.ttf"; path = "../src/assets/resources/fonts/Roboto-Regular.ttf"; sourceTree = ""; };
637B62A22B07B836008D8917 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Bold.ttf"; path = "../src/assets/resources/fonts/Roboto-Bold.ttf"; sourceTree = ""; };
637B62A32B07BAFB008D8917 /* Roboto-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Roboto-Bold.ttf"; path = "../src/assets/resources/fonts/Roboto-Bold.ttf"; sourceTree = ""; };
@@ -146,9 +146,9 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
+ 6318D32E2B459A5D0034E561 /* GoogleService-Info.plist */,
637B62A52B07BB0B008D8917 /* Roboto-Regular.ttf */,
637B62A32B07BAFB008D8917 /* Roboto-Bold.ttf */,
- 3F5CDF342995282400BD4B7F /* GoogleService-Info.plist */,
3F5CDF302995158300BD4B7F /* ios */,
13B07FAE1A68108700A75B9A /* Truth */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
@@ -289,12 +289,12 @@
buildActionMask = 2147483647;
files = (
637B62A62B07BB0B008D8917 /* Roboto-Regular.ttf in Resources */,
+ 6318D32F2B459A5D0034E561 /* GoogleService-Info.plist in Resources */,
637B62A42B07BAFB008D8917 /* Roboto-Bold.ttf in Resources */,
52BCE0F328C77143008C74BC /* fontello.ttf in Resources */,
52BCE0F228C76D5A008C74BC /* Fonts in Resources */,
8D22E0E3287C39ED0031C6E5 /* Launch Screen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
- 3F5CDF352995282400BD4B7F /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -749,7 +749,8 @@
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
- " ",
+ "-Wl",
+ "-ld_classic",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
@@ -825,7 +826,8 @@
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
- " ",
+ "-Wl",
+ "-ld_classic",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
diff --git a/src/config/fontello.json b/src/config/fontello.json
index 81e7cad..0c45e5e 100644
--- a/src/config/fontello.json
+++ b/src/config/fontello.json
@@ -236,7 +236,7 @@
},
{
"uid": "c0f00bfaafecf771a588798f5995fee2",
- "css": "settings",
+ "css": "players",
"code": 59411,
"src": "custom_icons",
"selected": true,
@@ -244,7 +244,7 @@
"path": "M78.6 162.7C78.6 79.4 146.1 11.4 230 11.4 313.8 11.4 381.4 78.9 381.4 162.7 381.4 244.7 316.8 311.1 235.8 314.1 233.9 314.1 232.1 314.1 230.2 313.8 228.4 314.1 226.5 314.1 224.7 314.1 143.6 311.1 79.2 244.7 78.6 163L78.6 162.7ZM146.8 162.6C147.2 207.2 181.5 243 224.7 245.8 228.4 245.5 232.1 245.5 235.7 245.8 279 243 313.2 207.2 313.2 162.7 313.2 116.6 276.2 79.5 230 79.5 184 79.5 146.9 116.9 146.8 162.6ZM685.5 162.7C685.5 116.6 722.5 79.5 768.6 79.5 814.7 79.5 851.7 116.9 851.8 162.6 851.4 207.2 817.1 243 773.9 245.8 770.3 245.5 766.5 245.5 762.9 245.8 719.6 243 685.5 207.2 685.5 162.7ZM768.6 11.4C684.8 11.4 617.3 78.9 617.3 162.7 617.3 244.7 681.8 311.1 762.9 314.1 764.7 314.1 766.6 314.1 768.4 313.8 770.2 314.1 772.1 314.1 774 314.1 855 311.1 919.4 244.7 920 163H920V162.7C920 79.4 852.5 11.4 768.6 11.4ZM923.8 394.3C866.6 356.3 787.8 344.8 718.7 356.9 700.1 360.1 687.7 377.8 691 396.3 694.2 414.9 711.9 427.3 730.4 424 785.9 414.3 846.1 424.6 886.1 451.1 911 467.7 919 486.3 919 500.5 919 514.6 911 533.2 886.1 549.8L886 549.9C846.5 576.3 787.1 586.6 731.6 577.3 713 574.2 695.4 586.7 692.3 605.3 689.2 623.8 701.7 641.4 720.3 644.5 789.2 656.1 867 644.6 923.9 606.5 963.1 580.4 987.2 542.6 987.2 500.5 987.2 458.3 963.1 420.5 923.9 394.4L923.8 394.3ZM268.2 424C212.8 414.3 152.5 424.6 112.5 451.1 87.6 467.7 79.7 486.3 79.7 500.5 79.7 514.6 87.6 533.2 112.5 549.8L112.6 549.9C152.1 576.3 211.5 586.6 267.1 577.3 285.6 574.2 303.2 586.7 306.3 605.3 309.5 623.8 296.9 641.4 278.4 644.5 209.4 656.1 131.6 644.6 74.7 606.5 35.6 580.4 11.5 542.6 11.5 500.5 11.5 458.3 35.6 420.5 74.7 394.4L74.8 394.3C132.1 356.3 210.9 344.8 280 356.9 298.5 360.1 310.9 377.8 307.7 396.3 304.4 414.9 286.8 427.3 268.2 424ZM495.9 419.1C449.7 419.1 412.7 456.1 412.7 502.3 412.7 546.7 446.9 582.5 490.2 585.4 493.9 585 497.6 585 501.3 585.4 544.2 582.9 578.7 547 579.1 502.1 579 456.4 542 419.1 495.9 419.1ZM344.5 502.3C344.5 418.4 412.1 350.9 495.9 350.9 579.8 350.9 647.3 419 647.3 502.3V502.5H647.3C646.7 584.1 582.5 651.3 501 653.6 499.2 653.7 497.4 653.6 495.7 653.4 493.8 653.6 492 653.7 490.1 653.6 409.1 650.7 344.5 584.3 344.5 502.3ZM651.2 734.4C608.2 705.7 553.3 692.5 500.2 692.5 447 692.5 392 705.7 348.9 734.3L348.8 734.4C309.7 760.5 285.6 798.3 285.6 840.5 285.6 882.6 309.7 920.4 348.8 946.5 391.9 975.4 446.9 988.8 500 988.8 553.1 988.8 608.1 975.4 651.2 946.5 690.3 920.4 714.4 882.6 714.4 840.5 714.4 798.3 690.3 760.5 651.2 734.4ZM353.7 840.5C353.7 826.3 361.7 807.7 386.6 791.1 416.2 771.5 457.3 760.7 500.2 760.7 543.1 760.7 584 771.5 613.4 791.1 638.3 807.7 646.3 826.3 646.3 840.5 646.3 854.6 638.3 873.2 613.4 889.8L613.3 889.8C583.7 909.6 542.8 920.6 500 920.6 457.2 920.6 416.3 909.6 386.7 889.8L386.6 889.8C361.7 873.2 353.7 854.6 353.7 840.5Z",
"width": 1000
},
- "search": ["settings"]
+ "search": ["players"]
},
{
"uid": "dd62c27b488715bc9c53b0d0eb62e70f",
diff --git a/src/i18n/interfaces/common.interface.ts b/src/i18n/interfaces/common.interface.ts
index bf4d769..5863b4e 100644
--- a/src/i18n/interfaces/common.interface.ts
+++ b/src/i18n/interfaces/common.interface.ts
@@ -5,4 +5,13 @@ interface Validation {
export interface Common {
validate: Validation
shareMessage: string
+ notFillPlayerTitle: string
+ notFillPlayerMessage: string
+ helpAlertTitle: string
+ helpAlertDesc: string
+ writeUsBtn: string
+ limitTitle: string
+ limitDesc: string
+ buyAfterBtn: string
+ no: string
}
diff --git a/src/i18n/interfaces/custom-pack.interface.ts b/src/i18n/interfaces/custom-pack.interface.ts
index 01aed58..6d68b6b 100644
--- a/src/i18n/interfaces/custom-pack.interface.ts
+++ b/src/i18n/interfaces/custom-pack.interface.ts
@@ -19,4 +19,6 @@ export interface CustomPack {
alertEmptyTitle: string
alertEmptyTruthDesc: string
alertEmptyDaresDesc: string
+ addCustomTruth: string
+ addCustomDare: string
}
diff --git a/src/i18n/interfaces/page-titles.interface.ts b/src/i18n/interfaces/page-titles.interface.ts
index 488f3b1..5746d39 100644
--- a/src/i18n/interfaces/page-titles.interface.ts
+++ b/src/i18n/interfaces/page-titles.interface.ts
@@ -2,4 +2,5 @@ export interface PageTitles {
settings: string,
privacy: string,
terms: string,
+ players: string
}
\ No newline at end of file
diff --git a/src/i18n/locales/en/common.translation.ts b/src/i18n/locales/en/common.translation.ts
index 297552b..8dc864e 100644
--- a/src/i18n/locales/en/common.translation.ts
+++ b/src/i18n/locales/en/common.translation.ts
@@ -8,4 +8,16 @@ const Validation = {
export const common: Common = {
validate: Validation,
shareMessage: 'Share this app with your friends',
+ notFillPlayerTitle: 'Oops',
+ notFillPlayerMessage:
+ 'It seems that you did not fill in all the players name. Please fill it!',
+ helpAlertTitle: 'Well!',
+ helpAlertDesc:
+ 'We will consider your question and give you an answer as soon as possible.',
+ writeUsBtn: 'Send',
+ limitTitle: 'Limit exhausted',
+ limitDesc:
+ 'You have reached the limit of questions for this set. You need the full version to continue, but you can use “Under18” and “Light” packages. They are always open for you.',
+ buyAfterBtn: 'Buy',
+ no: 'Back',
}
diff --git a/src/i18n/locales/en/custom-pack.translation.ts b/src/i18n/locales/en/custom-pack.translation.ts
index 25bf192..77586d9 100644
--- a/src/i18n/locales/en/custom-pack.translation.ts
+++ b/src/i18n/locales/en/custom-pack.translation.ts
@@ -1,4 +1,4 @@
-import { CustomPack } from "~i18n/interfaces/custom-pack.interface";
+import { CustomPack } from '~i18n/interfaces/custom-pack.interface'
export const customPack: CustomPack = {
label: 'Custom package',
@@ -7,21 +7,23 @@ export const customPack: CustomPack = {
'Create your own custom pack with questions and task. It all depends on your imagination!',
editor: 'Editor',
placeholder: 'Write here...',
- addTruth: 'Add a truth',
+ addTruth: 'Add a question',
addDare: 'Add a dare',
- viewTruths: 'View truths',
+ viewTruths: 'View questions',
viewDares: 'View dares',
- alertCreateTitle: 'Gratefully!',
+ alertCreateTitle: 'Gratefully! 🎉',
alertCreateDesc: 'You can play your custom package now!',
- alertSaveTitle: 'You have unsaved changes',
+ alertSaveTitle: 'You have unsaved changes.',
alertSaveDesc: 'Save changes?',
alertSaveNo: 'No',
alertSaveYes: 'Save',
- alertEmptyTitle: 'Oops!',
+ alertEmptyTitle: 'Oops! 👀',
alertEmptyTruthDesc:
- 'Your truths list is empty. You need have at least 1 truth',
+ 'Your questions list is empty. You need have at least 1 question.',
alertEmptyDaresDesc:
- 'Your dares list is empty. You need have at least 1 dare',
+ 'Your dares list is empty. You need have at least 1 dare.',
editorBtn: 'Tasks and questions editor',
play: 'Play',
+ addCustomTruth: 'Add this question to Custom pack?',
+ addCustomDare: 'Add this question to Custom pack?',
}
diff --git a/src/i18n/locales/en/onBoardingButton.translation.ts b/src/i18n/locales/en/onBoardingButton.translation.ts
index ba5c025..3157dfc 100644
--- a/src/i18n/locales/en/onBoardingButton.translation.ts
+++ b/src/i18n/locales/en/onBoardingButton.translation.ts
@@ -1,6 +1,6 @@
export const buttonsTranslation = {
skip: 'Skip',
- priceButton: 'Open now / $4.99',
+ priceButton: 'Open now / $1.99',
later: 'Later',
truth: '-TRUTH-',
random: 'RANDOM CHANCE',
diff --git a/src/i18n/locales/en/page-title.translation.ts b/src/i18n/locales/en/page-title.translation.ts
index 0d6b208..469ec37 100644
--- a/src/i18n/locales/en/page-title.translation.ts
+++ b/src/i18n/locales/en/page-title.translation.ts
@@ -4,4 +4,5 @@ export const pageTitles = {
privacy: 'Privacy Policy',
terms: 'Terms and conditions',
writeToUs: 'Write to us',
+ players: 'Players'
}
diff --git a/src/i18n/locales/en/steps.translation.ts b/src/i18n/locales/en/steps.translation.ts
index 23f1139..38aa801 100644
--- a/src/i18n/locales/en/steps.translation.ts
+++ b/src/i18n/locales/en/steps.translation.ts
@@ -8,11 +8,11 @@ export const onBoardingTranslation: OnBoardingLocale.OnboardingSteps = {
step2: {
title: 'Relax and enjoy \n the game!',
description:
- 'This game features 5 levels of "spiciness",\n some of which are divided into games for a \n couple or a company. All you have to do is \n add players and you can start playing.\n P.S. You can always create your own \n questions and tasks.',
+ 'This game features 3 levels of "spiciness",\n some of which are divided into games for a \n couple or a company. All you have to do is \n add players and you can start playing.\n P.S. You can always create your own \n questions and tasks.',
},
step3: {
title: 'Premium version!',
description:
- 'Provides unlimited access to Hard and \n Extreme packages. Enjoy intriguing questions \n and exciting action.',
+ 'Provides unlimited access to Crazy package. Enjoy intriguing questions \n and exciting action.',
},
}
diff --git a/src/i18n/locales/hi/onBoardingButton.translation.ts b/src/i18n/locales/hi/onBoardingButton.translation.ts
index 2e19c53..2103dfe 100644
--- a/src/i18n/locales/hi/onBoardingButton.translation.ts
+++ b/src/i18n/locales/hi/onBoardingButton.translation.ts
@@ -1,6 +1,6 @@
export const buttonsTranslation = {
skip: 'जानकारी',
- priceButton: 'जानकारी/ $4.99',
+ priceButton: 'जानकारी/ $1.99',
later: 'जानकारी',
truth: '-सच-',
random: 'यादृच्छिक मौका',
diff --git a/src/i18n/locales/ua/common.translation.ts b/src/i18n/locales/ua/common.translation.ts
index f3a4094..3aa4a46 100644
--- a/src/i18n/locales/ua/common.translation.ts
+++ b/src/i18n/locales/ua/common.translation.ts
@@ -8,4 +8,13 @@ const Validation = {
export const common: Common = {
validate: Validation,
shareMessage: 'Поділіться цим додатком зі своїми друзями',
+ notFillPlayerTitle: 'Ой',
+ notFillPlayerMessage: 'Якесь поле не заповнене. Перевір будь ласка!',
+ helpAlertTitle: 'Добре!',
+ helpAlertDesc: 'Ми розглянемо питання і якнайшвидше дамо відповідь.',
+ writeUsBtn: 'Відправити',
+ limitTitle: 'Ліміт вичерпано',
+ limitDesc: 'Ліміт питань для пакету "Crazy" вичерпано. Щоб продовжити, потрібна повна версія. Але ти можеш використовувати пакети «До 18» та «Легкий». Вони завжди відкриті для тебе.',
+ buyAfterBtn: 'До покупок',
+ no: 'Назад'
}
diff --git a/src/i18n/locales/ua/custom-pack.translation.ts b/src/i18n/locales/ua/custom-pack.translation.ts
index c28e5f8..c5930a2 100644
--- a/src/i18n/locales/ua/custom-pack.translation.ts
+++ b/src/i18n/locales/ua/custom-pack.translation.ts
@@ -1,27 +1,29 @@
import { CustomPack } from '~i18n/interfaces/custom-pack.interface'
export const customPack: CustomPack = {
- label: 'Власний пакет',
- title: 'Створити власний пакет',
+ label: 'Мій пакет',
+ title: 'Створити свій пакет',
description:
- 'Створіть свій власний пакет з правд та дій. Все залежить від вашої уяви!',
+ 'Створи свій пакет з питань та дій. Все залежить від твоєї уяви!',
editor: 'Редактор',
- placeholder: 'Пишіть тут...',
+ placeholder: 'Писати тут...',
addTruth: 'Додати питання',
addDare: 'Додати дію',
viewTruths: 'Питання',
viewDares: 'Дії',
alertCreateTitle: 'Чудово! 🎉',
- alertCreateDesc: 'Зіграйте прямо зараз!',
- alertSaveTitle: 'Ви маєте незбережені зміни',
+ alertCreateDesc: 'Зіграй прямо зараз!',
+ alertSaveTitle: 'У тебе незбережені зміни',
alertSaveDesc: 'Зберегти зміни?',
alertSaveNo: 'Ні',
alertSaveYes: 'Так',
alertEmptyTitle: 'Ой! 👀',
alertEmptyTruthDesc:
- 'Ваш список правд порожній. Вам потрібно мати хоча б 1 правду',
+ 'Твій список питань порожній. Потрібно мати хоча б 1 питання.',
alertEmptyDaresDesc:
- 'Ваш список викликів порожній. Вам потрібно мати хоча б 1 виклик',
+ 'Твій список дій порожній. Потрібно мати хоча б 1 дії.',
editorBtn: 'Редактор правд та дій',
play: 'Грати',
+ addCustomTruth: 'Додати це питання до твого пакету?',
+ addCustomDare: 'Додати цю дію до твого пакету?',
}
diff --git a/src/i18n/locales/ua/onBoardingButton.translation.ts b/src/i18n/locales/ua/onBoardingButton.translation.ts
index 487c99f..cb34888 100644
--- a/src/i18n/locales/ua/onBoardingButton.translation.ts
+++ b/src/i18n/locales/ua/onBoardingButton.translation.ts
@@ -1,6 +1,6 @@
export const buttonsTranslation = {
skip: 'Далі',
- priceButton: 'Придбати за / $4.99',
+ priceButton: 'Придбати за / $1.99',
later: 'Пізніше',
truth: '-ПРАВДА-',
random: 'ВИПАДКОВО',
diff --git a/src/i18n/locales/ua/page-title.translation.ts b/src/i18n/locales/ua/page-title.translation.ts
index 24c412d..2bea762 100644
--- a/src/i18n/locales/ua/page-title.translation.ts
+++ b/src/i18n/locales/ua/page-title.translation.ts
@@ -4,4 +4,5 @@ export const pageTitles = {
privacy: 'Політика \n конфіденційності',
terms: 'Правила та умови',
writeToUs: 'Напишіть нам',
+ players: 'Гравці',
}
diff --git a/src/i18n/locales/ua/purchases.translation.ts b/src/i18n/locales/ua/purchases.translation.ts
index 66f3fd6..f8f74c0 100644
--- a/src/i18n/locales/ua/purchases.translation.ts
+++ b/src/i18n/locales/ua/purchases.translation.ts
@@ -5,7 +5,7 @@ export const purchases: PurchasesTranslate = {
descSuccess: 'Тепер зіграйте з друзями! Насолоджуйтеся грою 😊',
alertError: 'Упс, щось не так 😢',
descError:
- 'Виникла помилка обробки вашої покупки. Будь ласка, спробуйте пізніше.',
+ 'Виникла помилка при обробці покупки. Будь ласка, спробуйте пізніше.',
allPackage: 'Відкрити всі пакети',
crazy: 'Відкрити пакет "Божевільний"',
under18: 'Відкрити пакет "До 18"',
diff --git a/src/i18n/locales/ua/settings.translation.ts b/src/i18n/locales/ua/settings.translation.ts
index 6aef4b7..0faef88 100644
--- a/src/i18n/locales/ua/settings.translation.ts
+++ b/src/i18n/locales/ua/settings.translation.ts
@@ -6,7 +6,7 @@ export const settingTranslation: SettingLocale.Core = {
notifications: 'Сповіщення',
write: 'Напишіть нам',
rate: 'Оцініть нас',
- share: 'Поділитися програмою',
+ share: 'Поділитися додатком',
policy: 'Політика конфіденційності',
label: 'Чим ми можемо допомогти?',
}
diff --git a/src/i18n/locales/ua/step.translation.ts b/src/i18n/locales/ua/step.translation.ts
index bbefa0b..0b57f34 100644
--- a/src/i18n/locales/ua/step.translation.ts
+++ b/src/i18n/locales/ua/step.translation.ts
@@ -1,21 +1,18 @@
-
-
export const onBoardingTranslationUa = {
- step1: {
- title: 'Ласкаво просимо!',
- description:
- 'Дякуємо за завантаження. Тепер ви \n в найкращій грі для компанії або \n пограти з коханою людиною',
- },
-
- step2: {
- title: 'Розслабтеся та насолоджуйтеся грою',
- description:
- 'У цій грі є 5 рівнів "пікантності", деякі з яких розділені на ігри для пари або компанії. Все, що вам потрібно зробити, це додати гравців, і ви можете почати грати.\n P.S. Ви завжди можете створити власні питання та завдання',
- },
- step3: {
- title: 'Преміум версія!',
- description:
- 'Надає необмежений доступ до пакетів Hard та режиму Extreme \nНасолоджуйтеся інтригуючими запитаннями та захоплюючими діями',
- },
-};
+ step1: {
+ title: 'Ласкаво просимо!',
+ description:
+ 'Дякуємо за завантаження. Тепер ти \n в найкращій грі для компанії або \n пограти з коханою людиною',
+ },
+ step2: {
+ title: 'Розслабся та насолоджуйся грою',
+ description:
+ 'У цій грі є 3 рівня "пікантності". Все, що потрібно - це додати гравців.\n P.S. Ти завжди можеш створити власні питання та завдання',
+ },
+ step3: {
+ title: 'Преміум версія!',
+ description:
+ 'Надає необмежений доступ до пакету "Сrazy". \nНасолоджуйся інтригуючими запитаннями та захоплюючими діями',
+ },
+}
diff --git a/src/module/common/components/buttons/button-primary.component.tsx b/src/module/common/components/buttons/button-primary.component.tsx
index d379e39..e456b81 100755
--- a/src/module/common/components/buttons/button-primary.component.tsx
+++ b/src/module/common/components/buttons/button-primary.component.tsx
@@ -17,7 +17,7 @@ type ButtonStyleMod = 'filled' | 'outline' | 'danger'
interface IButtonPrimaryProps {
mod?: ButtonStyleMod
- style?: ViewStyle
+ style?: ViewStyle | ViewStyle[]
onPress: () => void
isLoading?: boolean
diff --git a/src/module/common/components/form/form-controll-wrap.component.tsx b/src/module/common/components/form/form-controll-wrap.component.tsx
index 92005e5..03aad40 100644
--- a/src/module/common/components/form/form-controll-wrap.component.tsx
+++ b/src/module/common/components/form/form-controll-wrap.component.tsx
@@ -44,7 +44,6 @@ const styles = StyleSheet.create({
labelWrap: {
flexDirection: 'row',
justifyContent: 'space-between',
- marginBottom: 5,
},
label: {
color: colors.secondaryText,
diff --git a/src/module/common/components/form/form-text-controll.component.tsx b/src/module/common/components/form/form-text-controll.component.tsx
index f81e79e..982ffa6 100644
--- a/src/module/common/components/form/form-text-controll.component.tsx
+++ b/src/module/common/components/form/form-text-controll.component.tsx
@@ -19,7 +19,9 @@ interface FormTextControllProps {
label?: string
error?: string
- renderClearPostfix?: () => React.JSX.Element
+ renderPostfix?: () => React.JSX.Element
+ renderPrefix?: () => React.JSX.Element
+
subtext?: string
inputStyle?: ViewStyle
@@ -35,7 +37,8 @@ export const FormTextControll: FC = ({
label,
error,
- renderClearPostfix,
+ renderPostfix,
+ renderPrefix,
inputStyle,
style,
@@ -43,6 +46,7 @@ export const FormTextControll: FC = ({
return (
+ {renderPrefix && renderPrefix()}
= ({
placeholderTextColor="#A0A3BD"
{...inputProps}
/>
- {renderClearPostfix && renderClearPostfix()}
+ {renderPostfix && renderPostfix()}
)
@@ -65,7 +69,7 @@ const styles = StyleSheet.create({
borderColor: '#FB5450',
},
inputContainer: {
- paddingRight: 1,
+ flexDirection: 'row',
},
input: {
borderColor: colors.secondaryText,
@@ -76,6 +80,7 @@ const styles = StyleSheet.create({
color: colors.textPrimary,
fontFamily: Font.Roboto400,
fontSize: 16,
+ width: '100%',
},
inputActive: {
borderColor: '#FB5450',
diff --git a/src/module/common/components/header/header.component.tsx b/src/module/common/components/header/header.component.tsx
index a0ce092..ebb3e70 100644
--- a/src/module/common/components/header/header.component.tsx
+++ b/src/module/common/components/header/header.component.tsx
@@ -32,10 +32,10 @@ export const Header: FC = ({
return (
-
+
{leftIcon && (
= ({
)}
-
- {title}
+
+
+ {title}
+
-
+
{rightIcon && (
-
+
useDispatch()
diff --git a/src/module/common/hooks/use-selector.hook.ts b/src/module/common/hooks/use-selector.hook.ts
deleted file mode 100644
index 9bbb4ee..0000000
--- a/src/module/common/hooks/use-selector.hook.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { useSelector } from 'react-redux'
-import { TypedUseSelectorHook } from 'react-redux'
-import { RootState } from '../../../store/store'
-
-export const useAppSelector: TypedUseSelectorHook = useSelector
diff --git a/src/module/common/index.ts b/src/module/common/index.ts
index 8736204..a0578b8 100644
--- a/src/module/common/index.ts
+++ b/src/module/common/index.ts
@@ -7,3 +7,4 @@ export * from './events'
export * from './tools'
export * from './widgets'
export * from './svg-icons'
+export * from './services';
diff --git a/src/module/common/questions-dares-list/questions-dares-list.ts b/src/module/common/questions-dares-list/questions-dares-list.ts
new file mode 100644
index 0000000..932d64a
--- /dev/null
+++ b/src/module/common/questions-dares-list/questions-dares-list.ts
@@ -0,0 +1,746 @@
+export const under18 = [
+ {
+ id: 1,
+ isDare: false,
+ en: 'Tell about your first fight?',
+ ua: 'Розкажи про свою першу бійку?',
+ },
+ {
+ id: 2,
+ isDare: true,
+ en: 'Do your best dance moves for 20 seconds.',
+ ua: 'Покажи свої найкращі танцювальні рухи протягом 20 секунд.',
+ },
+ {
+ id: 3,
+ isDare: false,
+ en: 'Which superpower would you choose?',
+ ua: 'Яку б суперсилу ти обрав(ла)?',
+ },
+ {
+ id: 4,
+ isDare: true,
+ en: 'Take a funny selfie and share it with the any group.',
+ ua: 'Зроби веселе селфі та кинь його в якийсь чат.',
+ },
+ {
+ id: 5,
+ isDare: false,
+ en: 'What do you dream of doing by 18?',
+ ua: 'Що ти мрієш зробити до 18?',
+ },
+ {
+ id: 6,
+ isDare: true,
+ en: 'Tell a funny joke.',
+ ua: 'Розкажи смішний анекдот/прікол.',
+ },
+ {
+ id: 7,
+ isDare: false,
+ en: 'If you could visit any place in the world, where would you go?',
+ ua: 'Якщо б ти міг(могла) відвідати будь-яке місце у світі, куди б ти поїхав(ла)?',
+ },
+ {
+ id: 8,
+ isDare: true,
+ en: 'Make a scarf out of toilet paper and sit like that until the end of the game.',
+ ua: 'Зроби шарф з туалетного паперу і сиди так до кінця гри.',
+ },
+ {
+ id: 9,
+ isDare: false,
+ en: 'Name a song that you are uncomfortable listening to in front of others',
+ ua: 'Назви пісню, яку тобі некомфортно слухати при інших',
+ },
+ {
+ id: 10,
+ isDare: true,
+ en: "Write 'Where's my beer' to your president on the social network ",
+ ua: 'Напиши "Де моє пиво" своєму президентові в соціальній мережі',
+ },
+ {
+ id: 11,
+ isDare: false,
+ en: ' If you had to delete one person from your life permanently, who would it be and why?',
+ ua: 'Якщо б тобі довелося видалити одну особу зі свого життя назавжди, хто б це був і чому?',
+ },
+ {
+ id: 12,
+ isDare: true,
+ en: 'Call someone on video, be silent for 10 seconds and knock out',
+ ua: 'Подзвони комусь по відео мовчи 10 секунд і вибий',
+ },
+ {
+ id: 13,
+ isDare: false,
+ en: "What's the most disgusting thing you've ever tried?",
+ ua: 'Що найогидніше ти коли-небудь пробував(ла)?',
+ },
+ {
+ id: 14,
+ isDare: true,
+ en: 'Sing the chorus of any song loudly.',
+ ua: 'Голосно заспівай приспів будь-якої пісні.',
+ },
+ {
+ id: 15,
+ isDare: false,
+ en: 'You can travel through time. Where and why would you go?',
+ ua: 'Ти вмієш подорожувати в часі. Куди і чому б ти поїхав(ла)?',
+ },
+ {
+ id: 16,
+ isDare: true,
+ en: 'Imitate your favorite character for 20 seconds.',
+ ua: 'Імітуй свого улюбленого персонажа протягом 20 секунд.',
+ },
+ {
+ id: 17,
+ isDare: false,
+ en: 'You can kiss any celebrity. Who would it be and why?',
+ ua: 'Ти можеш поцілувати будь-яку знаменитість. Хто б це був і чому?',
+ },
+ {
+ id: 18,
+ isDare: true,
+ en: 'Send a heartfelt message to the fifth person in your contact list, expressing gratitude for something',
+ ua: "Відправ сердечне повідомлення п'ятій людині у своєму списку контактів, висловлюючи вдячність за щось",
+ },
+ {
+ id: 19,
+ isDare: false,
+ en: 'If you had a pet dragon, what would you name it?',
+ ua: 'Якщо б у тебе був домашній дракон, як ти б його назвав(ла)?',
+ },
+ {
+ id: 20,
+ isDare: true,
+ en: 'Show your scary photo.',
+ ua: 'Покажи своє страшне фото.',
+ },
+ {
+ id: 21,
+ isDare: false,
+ en: 'What is your most embarrassing moment from childhood?',
+ ua: "Який твій найбільш сором'язливий момент з дитинства?",
+ },
+ {
+ id: 22,
+ isDare: true,
+ en: 'Dance like nobody is watching for 10 seconds.',
+ ua: 'Танцюй так, наче тебе ніхто не бачить, протягом 10 секунд.',
+ },
+ {
+ id: 23,
+ isDare: false,
+ en: 'If you could expose one secret about someone in this room, what would it be?',
+ ua: 'Якби тобі довелося викрити один секрет про когось у цій кімнаті, який би це був?',
+ },
+ {
+ id: 24,
+ isDare: true,
+ en: 'Write an message with some hint to the person you like.',
+ ua: 'Напишіть повідомлення з натяком людині, яка вам подобається.',
+ },
+ {
+ id: 25,
+ isDare: false,
+ en: "What's the wildest thing you've done when you thought no one was watching?",
+ ua: 'Яка найбільш дика річ, яку ти робив, коли думав, що тебе ніхто не бачить?',
+ },
+ {
+ id: 26,
+ isDare: true,
+ en: 'Take a silly selfie and post it on your social media.',
+ ua: 'Зроби дурницю селфі і опублікуй його у своїй соціальній мережі.',
+ },
+ {
+ id: 27,
+ isDare: false,
+ en: 'If you could swap lives with someone for a day, who would it be?',
+ ua: 'Якщо б ти міг(могла) помінятися життям з кимось на один день, хто б це був?',
+ },
+ {
+ id: 28,
+ isDare: true,
+ en: 'Take a screenshot of your recommendations on Instagram.',
+ ua: 'Зроби скріншот своїх рекомендацій в інстаграмі.',
+ },
+ {
+ id: 29,
+ isDare: false,
+ en: 'Tell a fact about yourself that none of the participants knows.',
+ ua: 'Розкажи про себе факт, який не знає ніхто з учасників.',
+ },
+ {
+ id: 30,
+ isDare: true,
+ en: 'Call a friend and wish him a happy birthday.',
+ ua: 'Подзвони другові(подрузі) і привітай з днем народження.',
+ },
+ {
+ id: 31,
+ isDare: false,
+ en: "If you had the power to erase one person's memory of you, who would it be and why?",
+ ua: "Якби у тебе була сила стерти пам'ять одній людини про тебе, хто б це був і чому?",
+ },
+ {
+ id: 32,
+ isDare: true,
+ en: 'Share a funny photo from your childhood with the participants.',
+ ua: 'Поділись з учасниками смішною фоткою свого дитинства.',
+ },
+ {
+ id: 33,
+ isDare: false,
+ en: "What is the most brave thing you've ever done?",
+ ua: 'Яка найсміливіша річ, яку ти коли-небудь робив(ла)?',
+ },
+ {
+ id: 34,
+ isDare: true,
+ en: "Change your phone's language settings to Chinese and use it that way for the rest of the day.",
+ ua: 'Зміни мовні налаштування телефону на китайську мову, і використовуй його так до кінця дня.',
+ },
+ {
+ id: 35,
+ isDare: false,
+ en: 'That you would eat one thing all your life?',
+ ua: 'Що б ти їв(ла) щось одне все життя?',
+ },
+ {
+ id: 36,
+ isDare: true,
+ en: 'Go live with a funny mask.',
+ ua: 'Почни трансляцію у прямому ефірі з смішною маскою.',
+ },
+ {
+ id: 37,
+ isDare: false,
+ en: 'What is the most useless talent you have?',
+ ua: 'Який найбільш безглуздий талант у тебе є?',
+ },
+ {
+ id: 38,
+ isDare: true,
+ en: 'Picture yourself as a dove.',
+ ua: 'Зобразити себе у вигляді голуба.',
+ },
+ {
+ id: 39,
+ isDare: false,
+ en: 'You can choose a slave from among the participants. Who would it be?',
+ ua: 'Ти можеш вибрати собі раба з учасників. Хто б це був?',
+ },
+ {
+ id: 40,
+ isDare: true,
+ en: 'Do your best dance moves for the next minute.',
+ ua: 'Станцюй свій найкрутіший танець протягом 20 секунд під музику.',
+ },
+ {
+ id: 41,
+ isDare: false,
+ en: 'What’s the most unusual job you can think of?',
+ ua: 'Найдурніша робота, яку б ти робив(ла) за хороші гроші?',
+ },
+]
+
+export const light = [
+ {
+ id: 1,
+ isDare: false,
+ en: 'Tell me about a deception that benefited you.',
+ ua: 'Розкажи про обман, який приніс тобі користь.',
+ },
+ {
+ id: 2,
+ isDare: true,
+ en: 'Одягни на вуха носки і сиди так 3 раунда.',
+ ua: 'Put socks on your ears and sit like that for 3 rounds.',
+ },
+ {
+ id: 3,
+ isDare: false,
+ en: 'What is the most unethical thing you have done in public?',
+ ua: 'Яка найбільш неетична річ, яку ти зробив(ла) на людях?',
+ },
+ {
+ id: 4,
+ isDare: true,
+ en: 'Take a funny selfie and post it on your social media.',
+ ua: 'Зроби смішне селфі і запости його у одну з соц. мереж.',
+ },
+ {
+ id: 5,
+ isDare: false,
+ en: 'Найекстремальніше, що ти робив(ла), щоб комусь сподобатись?',
+ ua: "What's the most extreme thing you've done to please someone?",
+ },
+ {
+ id: 6,
+ isDare: true,
+ en: 'Dance a funny and energetic dance to sad and slow music.',
+ ua: 'Танцюй смішний та енергічний танець під сумну та повільну музику.',
+ },
+ {
+ id: 7,
+ isDare: false,
+ en: 'If you could be invisible for a day, what would you do?',
+ ua: 'Якщо б ви могли бути невидимими на один день, Що б ти зробив(ла), якб?',
+ },
+ {
+ id: 8,
+ isDare: true,
+ en: 'The participant to your right must draw you any picture with a pen anywhere.',
+ ua: 'Учасник справа від тебе має намалювати тобі будь який малюнок ручкою в любому місці.',
+ },
+ {
+ id: 9,
+ isDare: false,
+ en: 'What is the weirdest talent you have?',
+ ua: 'Що ти вмієш робити найдивніше?',
+ },
+ {
+ id: 10,
+ isDare: true,
+ en: `Change your relationship status to "It's complicated" and leave it for 24 hours.`,
+ ua: 'Зміни свій статус відносин на "Складно" і залиш його протягом 24 годин.',
+ },
+ {
+ id: 11,
+ isDare: false,
+ en: 'What’s the most unusual place you’ve ever visited?',
+ ua: 'Яке найстрашніше місце, в якому ти був(ла)',
+ },
+ {
+ id: 12,
+ isDare: true,
+ en: '"Write to your parents that you love them.',
+ ua: 'Напиши батькам, що ти їх любиш.',
+ },
+ {
+ id: 13,
+ isDare: false,
+ en: 'If you could time travel, which era would you visit and why?',
+ ua: 'Якщо б ти міг подорожувати в часі, яку епоху та місце ти б відвідав(ла) і чому?',
+ },
+ {
+ id: 14,
+ isDare: true,
+ en: 'Roar when others laugh. The desire is valid until you choose another action.',
+ ua: 'Каркай, коли інші сміються. Бажання дійсне поки не вибереш іншу дію.',
+ },
+ {
+ id: 15,
+ isDare: false,
+ en: 'Tell about your dumbest act.',
+ ua: 'Розкажи про свій найтупійший вчинок.',
+ },
+ {
+ id: 16,
+ isDare: true,
+ en: 'Show a photo of yourself in your underwear.',
+ ua: 'Покажи своє фото в нижній білизні.',
+ },
+ {
+ id: 17,
+ isDare: false,
+ en: 'What do you often look at on the Internet?',
+ ua: 'Про що ти часто дивишся в інтернеті?',
+ },
+ {
+ id: 18,
+ isDare: true,
+ en: 'Everyone has to give you a new hairstyle.',
+ ua: 'Всі мають зробити тобі нову зачіску.',
+ },
+ {
+ id: 19,
+ isDare: false,
+ en: 'What do you often look at on the Internet?',
+ ua: 'Про що ти часто дивишся в інтернеті?',
+ },
+ {
+ id: 20,
+ isDare: true,
+ en: 'Voice the emotions of your stomach when tomato juice and diesel get there.',
+ ua: 'Озвуч емоції свого шлунку, коли туди попадає томатний сік і дизель.',
+ },
+ {
+ id: 21,
+ isDare: false,
+ en: 'Tell the funniest story about how you threw up.',
+ ua: 'Розкажи про якусь ситуацію, яку ти бачив на власні очі.',
+ },
+ {
+ id: 22,
+ isDare: true,
+ en: 'You are a tarot reader. Give a forecast for the future to the participant opposite you.',
+ ua: 'Ти таролог. Дай прогноз на майбутне учаснику навпроти тебе.',
+ },
+ {
+ id: 23,
+ isDare: false,
+ en: 'Tell about your worst dream.',
+ ua: 'Розкажи про свій найгірший сон.',
+ },
+ {
+ id: 24,
+ isDare: true,
+ en: 'Stand on a chair and say your favorite Chinese-style toast.',
+ ua: 'Стань на стільчик та скажи любий тост у китайському стилі.',
+ },
+ {
+ id: 25,
+ isDare: false,
+ en: 'Describe your character in 5 words.',
+ ua: 'Опиши свій характер 5-ма словами.',
+ },
+ {
+ id: 26,
+ isDare: true,
+ en: 'Show your hobby with facial expressions and movements. Everyone must guess it. Whoever guessed should get a slap on the cheek.',
+ ua: 'Показати своє хобі мімікою і рухами. Всі повинні його вгадати. Хто вгадав, має отримати по щоці.',
+ },
+ {
+ id: 27,
+ isDare: false,
+ en: 'Have you ever followed someone?',
+ ua: 'Ти колись слідкував за кимось?',
+ },
+ {
+ id: 28,
+ isDare: true,
+ en: 'Tell about a time when you successfully took revenge on someone.',
+ ua: 'Розкажи про випадок, коли ти комусь успішно відімстив.',
+ },
+ {
+ id: 27,
+ isDare: false,
+ en: 'Tell about the channel that you immediately open when something new appears there.',
+ ua: 'Розкажи про канал, який ти одразу відкриваєш, коли там з являється щось нове.',
+ },
+ {
+ id: 28,
+ isDare: true,
+ en: 'Take any item and try to sell it to others, praising it.',
+ ua: 'Візьми будь-який предмет і спробуй продати іншим, нахвалюючи його.',
+ },
+ {
+ id: 29,
+ isDare: false,
+ en: 'Tell about the channel that you immediately open when something new appears there.',
+ ua: 'Розкажи про канал, який ти одразу відкриваєш, коли там з являється щось нове.',
+ },
+ {
+ id: 30,
+ isDare: true,
+ en: 'Lick your lips sexily and look at the participant across from you.',
+ ua: 'Сексуально оближ губи і подивись на учасника навпроти тебе.',
+ },
+ {
+ id: 31,
+ isDare: false,
+ en: 'Have you ever been dumped by a person you liked?',
+ ua: 'Тебе колись кидала людина, яка тобі подобалась?',
+ },
+ {
+ id: 32,
+ isDare: true,
+ en: 'Sit with an angry and sad face until the next round.',
+ ua: 'Сиди зі злою та сумною міною до наступного раунда.',
+ },
+ {
+ id: 33,
+ isDare: false,
+ en: 'Have you ever been dumped by a person you liked?',
+ ua: 'Тебе колись кидала людина, яка тобі подобалась?',
+ },
+ {
+ id: 34,
+ isDare: true,
+ en: 'Sit with an angry and sad face until the next round.',
+ ua: 'Сидіть зі злою та сумною міною до наступного раунда.',
+ },
+ {
+ id: 35,
+ isDare: false,
+ en: 'When was the last time you cried and why?',
+ ua: 'Коли ти востаннє плакав(ла) і чому?',
+ },
+ {
+ id: 36,
+ isDare: true,
+ en: 'Picture a popular person so that others will remember him.',
+ ua: 'Зобрази популярну людину, щоб інші її відгадали.',
+ },
+ {
+ id: 37,
+ isDare: false,
+ en: 'You are invited on a date. You really like this person. For what reasons can you not go on a date?',
+ ua: 'Тебе запрошують на побачення. Ця людина тобі дуже подобається. По яким причинам ти можеш не піти на побачення?',
+ },
+ {
+ id: 38,
+ isDare: true,
+ en: 'Picture a hen that suddenly laid an egg.',
+ ua: 'Зобрази курку, яка раптом знесла яєчко.',
+ },
+ {
+ id: 39,
+ isDare: false,
+ en: 'Tell the whole story of how you quarreled with someone.',
+ ua: 'Розкажи всю історію, як ти з кимось сварився(лась).',
+ },
+ {
+ id: 40,
+ isDare: true,
+ en: 'Ask your partner for advice on how to please a guy/girl as realistically as possible.',
+ ua: 'Максимально реалістично попроси у своєї половинки поради як сподобатись хлопцю/дівчині.',
+ },
+]
+
+export const crazy = [
+ {
+ id: 1,
+ isDare: false,
+ en: 'Would you sacrifice a loved one to earn 100 times more than you do now?',
+ ua: 'Ти б пожертував(ла) близькою людиною, щоб заробляти в 100 разів більше, ніж зараз?',
+ },
+ {
+ id: 2,
+ isDare: true,
+ en: 'Dance for the next 20 seconds with any song.',
+ ua: 'Танцюй протягом 20 секунд під музику.',
+ },
+ {
+ id: 3,
+ isDare: false,
+ en: "What's the most embarrassing thing you've Googled?",
+ ua: "Найсором'язливіше, що ти шукав в Google?",
+ },
+ {
+ id: 4,
+ isDare: true,
+ en: "Call a friend and sing 'Happy Birthday' to them, regardless of whether it's their birthday or not.",
+ ua: "Подзвони другові і заспівай 'З днем народження' незалежно від його дати народження.",
+ },
+ {
+ id: 5,
+ isDare: false,
+ en: "Have you ever intentionally ruined someone else's relationship, and if so, why?",
+ ua: 'Ти коли-небудь умисно руйнував відносини інших людей, і якщо так, чому?',
+ },
+ {
+ id: 6,
+ isDare: true,
+ en: 'Say "Koo-koo" to the player on your right after your turn is over.',
+ ua: 'Скажи "Ку-ку" учаснику справа від тебе після кожного завершення твого ходу.',
+ },
+ {
+ id: 7,
+ isDare: true,
+ en: "Record a dramatic monologue confessing to a fake crime and send it to a friend without telling them it's a joke.",
+ ua: 'Запиши драматичний монолог, визнаючись у фіктивному злочині, і відправ його другові, не вказавши, що це жарт.',
+ },
+ {
+ id: 8,
+ isDare: false,
+ en: 'How, why and whom you cruelly offended?',
+ ua: 'Як, чому і кого ти жорстоко образив?',
+ },
+ {
+ id: 9,
+ isDare: true,
+ en: "Send a text to your crush confessing your feelings (even if it's just for fun).",
+ ua: 'Напиши в особисті 10-му своєму підписнику "В мене погані новини для тебе" і не відповідай 24 години.',
+ },
+ {
+ id: 10,
+ isDare: false,
+ en: 'Did you cheat on someone? If so, does anyone know about it?',
+ ua: 'Ти комусь зраджував(ла)? Якщо так, чи знає хтось про це?',
+ },
+ {
+ id: 11,
+ isDare: true,
+ en: 'Wrap your socks around with the participant on the left to greet you.',
+ ua: 'Обіняйся носками з учасником зліва віт тебе.',
+ },
+ {
+ id: 12,
+ isDare: false,
+ en: 'Є людина, яку ти ненавидиш, але вона про це не знає?',
+ ua: "Is there a person you hate, but they don't know it?",
+ },
+ {
+ id: 13,
+ isDare: true,
+ en: 'Grunt every 30 seconds until the end of the game.',
+ ua: 'Хрюкай до кінця гри кожні 30 секунд.',
+ },
+ {
+ id: 14,
+ isDare: false,
+ en: "What's the most rebellious thing you did as a teenager?",
+ ua: 'Що найбільш хуліганське ти зробив(ла) в дитинстві?',
+ },
+ {
+ id: 15,
+ isDare: true,
+ en: 'Create a silly rap about the person to your right.',
+ ua: 'Заспівай дурний реп про особу справа від тебе.',
+ },
+ {
+ id: 16,
+ isDare: false,
+ en: 'Do you have a romantic or sexual fantasy about one of the participants?',
+ ua: 'Моєш романтичну чи сексуальну фантазію про когось з учасників?',
+ },
+ {
+ id: 17,
+ isDare: true,
+ en: 'Act like a certain animal until your next turn. Others have to guess the animal.',
+ ua: 'Ведіть себе як собака до свого наступного ходу.',
+ },
+ {
+ id: 18,
+ isDare: false,
+ en: 'You became invisible for a day. What will you do?',
+ ua: 'Ти невидимка на один день. Що будеш зробили?',
+ },
+ {
+ id: 19,
+ isDare: true,
+ en: 'Send a strange sound to the third person on your social media friends list.',
+ ua: 'Відправ дивний звук третій людині, на яку ти підписаний(на)',
+ },
+ {
+ id: 20,
+ isDare: false,
+ en: 'Picture your dream job.',
+ ua: 'Зобрази роботи мрії.',
+ },
+ {
+ id: 21,
+ isDare: true,
+ en: 'Post something embarrassing on your social media for the next 30 minutes.',
+ ua: 'Добав в сторіз щось сором’язливе на 1 хв.',
+ },
+ {
+ id: 22,
+ isDare: false,
+ en: 'What’s the most embarrassing thing you’ve said in the heat of the moment?',
+ ua: 'Що ти "ляпав(ла)" не те в пориві емоцій?',
+ },
+ {
+ id: 23,
+ isDare: true,
+ en: 'Sing a song loudly and out of tune.',
+ ua: 'Співай що завгодно наступні 10 секунд.',
+ },
+ {
+ id: 24,
+ isDare: false,
+ en: "There were times when you were hinted at sex, but you didn't understand the hint?",
+ ua: 'Були моменти, коли тобі натякали на секс, али ти не зрозумів(ла) натяк?',
+ },
+ {
+ id: 25,
+ isDare: true,
+ en: 'Take a goofy selfie and set it as your profile picture for the next hour.',
+ ua: 'Зроби невдале селфі і постав на аву на 1 годину.',
+ },
+ {
+ id: 26,
+ isDare: false,
+ en: 'Was there a time when you wanted sex and were refused?',
+ ua: 'Чи був момент, коли ти хотів(ла) сексу, а тобі не дали?',
+ },
+ {
+ id: 27,
+ isDare: true,
+ en: 'Send a message "I want it, and you?" 5th in your contact list.',
+ ua: 'Відправ повідомлення "Я хочу це, а ти?" 5-му в своєму списку контактів.',
+ },
+ {
+ id: 28,
+ isDare: false,
+ en: 'Would you go naked for a week for 100K hryvnias?',
+ ua: 'Ти б ходив ходив(ла) на протязі тижня голим(голою) за 100К гривень?',
+ },
+ {
+ id: 29,
+ isDare: true,
+ en: 'Take a selfie with a taxi driver, bus driver, cashier or a random passerby. Send the proof in your chat or group later.',
+ ua: 'Зроби селфі з таксистом, водієм маршрутки, касиркою або з випадковим перехожим. Потім покажеш доказ.',
+ },
+ {
+ id: 30,
+ isDare: false,
+ en: 'What is the most unethical thing you have seen in your life?',
+ ua: 'Назви найбільш неетична річ, яку ти бачив(ла) в своєму житті.',
+ },
+ {
+ id: 31,
+ isDare: true,
+ en: 'Add to any social media something that makes you feel ashamed for 10 minutes',
+ ua: 'Добав в любу соц. мережу щось, що викликає в тобі сором на 10 хв.',
+ },
+ {
+ id: 32,
+ isDare: false,
+ en: 'Was there a one-night stand? If so, how was it?',
+ ua: 'Був роман на одну ніч? Якщо так, то як це було?',
+ },
+ {
+ id: 33,
+ isDare: false,
+ en: 'Have you ever been punched in the face?',
+ ua: 'Ти колись отримував(ла) в лице?',
+ },
+ {
+ id: 34,
+ isDare: false,
+ en: 'When was the last time you shaved your anus?',
+ ua: 'Коли ти останній раз брив(ла) в ділянці анального отвору?',
+ },
+ {
+ id: 35,
+ isDare: true,
+ en: 'Fulfill the wish made by the youngest participant.',
+ ua: 'Виконай бажання, яке тобі загадає наймолодший учасник.',
+ },
+ {
+ id: 36,
+ isDare: false,
+ en: 'Tell about the strangest act that a person has done in a drunken state in your memory.',
+ ua: "Розкажи найдивніший вчинок, який зробила людина в нетверезому стані на твоїй пам'яті.",
+ },
+ {
+ id: 37,
+ isDare: true,
+ en: 'Go live with a funny mask.',
+ ua: 'Почни трансляцію у прямому ефірі з смішною маскою.',
+ },
+ {
+ id: 38,
+ isDare: false,
+ en: 'Now you can be asked any one question.',
+ ua: 'Зараз тобі можуть задати любе одне питання.',
+ },
+ {
+ id: 39,
+ isDare: true,
+ en: 'Roar when others laugh. The desire is valid until you choose another action.',
+ ua: 'Каркай, коли інші сміються. Бажання дійсне поки не вибереш іншу дію.',
+ },
+ {
+ id: 40,
+ isDare: false,
+ en: 'Name an unusual place you had sex.',
+ ua: 'Назви незвичне місце, в якому у тебе був секс.',
+ },
+]
diff --git a/src/module/common/services/index.ts b/src/module/common/services/index.ts
new file mode 100644
index 0000000..4047195
--- /dev/null
+++ b/src/module/common/services/index.ts
@@ -0,0 +1 @@
+export * from './storage.service';
diff --git a/src/module/common/services/storage.service.ts b/src/module/common/services/storage.service.ts
new file mode 100755
index 0000000..c39f451
--- /dev/null
+++ b/src/module/common/services/storage.service.ts
@@ -0,0 +1,34 @@
+import AsyncStorage from '@react-native-async-storage/async-storage'
+import { StorageKey } from '../typing'
+
+export class StorageService {
+ constructor() {
+ this.init()
+ }
+
+ private init() {}
+
+ public async get(key: StorageKey) {
+ try {
+ const encode = await AsyncStorage.getItem(key)
+ if (encode) {
+ return JSON.parse(encode)
+ } else {
+ return null
+ }
+ } catch (error) {
+ console.error('error get from async storage', error)
+ }
+ }
+
+ public async set(key: StorageKey, data: any) {
+ try {
+ const encode = JSON.stringify(data)
+ await AsyncStorage.setItem(key, encode)
+ } catch (error) {
+ console.error('error set to async storage', error)
+ }
+ }
+}
+
+export const storageService = new StorageService()
diff --git a/src/module/common/typing/enums/choice-type.enum.ts b/src/module/common/typing/enums/choice-type.enum.ts
new file mode 100644
index 0000000..17f6642
--- /dev/null
+++ b/src/module/common/typing/enums/choice-type.enum.ts
@@ -0,0 +1,4 @@
+export enum ChoiceType {
+ Truth = 'question',
+ Dare = 'dare',
+}
diff --git a/src/module/common/typing/enums/type-custom.enum.ts b/src/module/common/typing/enums/custom-type.enum.ts
similarity index 64%
rename from src/module/common/typing/enums/type-custom.enum.ts
rename to src/module/common/typing/enums/custom-type.enum.ts
index d66292e..43fd5ed 100644
--- a/src/module/common/typing/enums/type-custom.enum.ts
+++ b/src/module/common/typing/enums/custom-type.enum.ts
@@ -1,4 +1,4 @@
-export enum TypeCustom {
+export enum CustomType {
Questions = 'questions',
Dares = 'dares',
}
diff --git a/src/module/common/typing/enums/guest-route-keys.enum.ts b/src/module/common/typing/enums/guest-route-keys.enum.ts
new file mode 100644
index 0000000..a1de5dc
--- /dev/null
+++ b/src/module/common/typing/enums/guest-route-keys.enum.ts
@@ -0,0 +1,5 @@
+export enum GuestRouteKey {
+ Onboarding = 'Onboarding',
+ LanguageSelect = 'LanguageSelect',
+ Loading = 'Loading',
+}
diff --git a/src/module/common/typing/enums/index.ts b/src/module/common/typing/enums/index.ts
index 7a1bf59..c245129 100644
--- a/src/module/common/typing/enums/index.ts
+++ b/src/module/common/typing/enums/index.ts
@@ -1,6 +1,11 @@
-export * from './route-keys.enum'
+export * from './guest-route-keys.enum'
export * from './fonts.enum'
export * from './storage-key.enum'
export * from './language.enum'
-export * from './products.enum';
-export * from './type-custom.enum';
+export * from './products.enum'
+export * from './custom-type.enum'
+export * from './guest-route-keys.enum'
+export * from './nav-group.enum'
+export * from './user-route-keys.enum'
+export * from './package-type.enum'
+export * from './choice-type.enum';
diff --git a/src/module/common/typing/enums/nav-group.enum.ts b/src/module/common/typing/enums/nav-group.enum.ts
new file mode 100644
index 0000000..059d7d4
--- /dev/null
+++ b/src/module/common/typing/enums/nav-group.enum.ts
@@ -0,0 +1,4 @@
+export enum NavGroup {
+ User = 'u',
+ Guest = 'g'
+}
\ No newline at end of file
diff --git a/src/module/common/typing/enums/package-type.enum.ts b/src/module/common/typing/enums/package-type.enum.ts
new file mode 100644
index 0000000..97e0e42
--- /dev/null
+++ b/src/module/common/typing/enums/package-type.enum.ts
@@ -0,0 +1,6 @@
+export enum PackageType {
+ Under18 = 'under18',
+ Light = 'light',
+ Crazy = 'crazy',
+ Custom = 'custom',
+}
diff --git a/src/module/common/typing/enums/products.enum.ts b/src/module/common/typing/enums/products.enum.ts
index a38c56b..5254ae6 100644
--- a/src/module/common/typing/enums/products.enum.ts
+++ b/src/module/common/typing/enums/products.enum.ts
@@ -1,5 +1,3 @@
export enum ProductsEnum {
- All = 'ALL',
- Under18 = 'un18',
Crazy = 'Crz',
}
diff --git a/src/module/common/typing/enums/storage-key.enum.ts b/src/module/common/typing/enums/storage-key.enum.ts
index ee0c898..abdb6f8 100644
--- a/src/module/common/typing/enums/storage-key.enum.ts
+++ b/src/module/common/typing/enums/storage-key.enum.ts
@@ -1,7 +1,11 @@
export enum StorageKey {
- OnBoarding = 'ONBOARDING_END',
- Language = 'LANG_SELECTED',
+ FinishOnBoarding = 'FinishOnBoarding',
+ Language = 'Language',
Purchases = 'Purchases',
Products = 'Products',
CustomPackage = 'CustomPackage',
+ ShuffleCustomPackage = 'ShuffleCustomPackage',
+ Players = 'Players',
+ LimitForCrazy = 'limit',
+ SavedSteps = 'SavedSteps',
}
diff --git a/src/module/common/typing/enums/route-keys.enum.ts b/src/module/common/typing/enums/user-route-keys.enum.ts
similarity index 69%
rename from src/module/common/typing/enums/route-keys.enum.ts
rename to src/module/common/typing/enums/user-route-keys.enum.ts
index 6b66b89..4593fe7 100644
--- a/src/module/common/typing/enums/route-keys.enum.ts
+++ b/src/module/common/typing/enums/user-route-keys.enum.ts
@@ -1,8 +1,6 @@
-export enum RouteKey {
- Onboarding = 'Onboarding',
- LanguageSelect = 'LanguageSelect',
+export enum UserRouteKey {
Game = 'Game',
- Loading = 'Loading',
+ Players = 'Players',
Packages = 'Packages',
TruthOrDare = 'TruthOrDare',
CustomPackage = 'CustomPackage',
diff --git a/src/module/common/typing/interfaces/game-item.ts b/src/module/common/typing/interfaces/game-item.ts
index 7016150..5c910bc 100644
--- a/src/module/common/typing/interfaces/game-item.ts
+++ b/src/module/common/typing/interfaces/game-item.ts
@@ -1,9 +1,9 @@
-import { Language } from "../enums";
+import { Language } from '../enums'
export interface GameItem {
- id: number;
- isDare: boolean;
- en: Language;
- ua: Language;
- hi: Language;
-}
\ No newline at end of file
+ id: number
+ isDare: boolean
+ en: Language
+ ua: Language
+ hi?: Language
+}
diff --git a/src/module/custom-package/animation/index.ts b/src/module/custom-package/animation/index.ts
new file mode 100644
index 0000000..af4a353
--- /dev/null
+++ b/src/module/custom-package/animation/index.ts
@@ -0,0 +1 @@
+export * from './use-animation-block.hook';
diff --git a/src/module/custom-package/animation/use-animation-block.hook.tsx b/src/module/custom-package/animation/use-animation-block.hook.tsx
new file mode 100644
index 0000000..a4133b1
--- /dev/null
+++ b/src/module/custom-package/animation/use-animation-block.hook.tsx
@@ -0,0 +1,53 @@
+import { useEffect, useRef } from 'react'
+import { Animated } from 'react-native'
+
+export const useAnimationBlock = (onDelete: any) => {
+ const deleteBlockAnim = useRef(new Animated.Value(0)).current
+ const viewBlockAnim = useRef(new Animated.Value(0)).current
+
+ const onPressDelete = () => {
+ Animated.timing(deleteBlockAnim, {
+ toValue: 1,
+ duration: 200,
+ useNativeDriver: true,
+ }).start(() => deleteBlockAnim.setValue(0))
+
+ setTimeout(onDelete, 200)
+ }
+
+ useEffect(() => {
+ Animated.timing(viewBlockAnim, {
+ toValue: 1,
+ duration: 0,
+ useNativeDriver: true,
+ }).start()
+ }, [])
+
+ const animStyle = {
+ transform: [
+ {
+ translateX: deleteBlockAnim.interpolate({
+ inputRange: [0, 1],
+ outputRange: [0, 400],
+ }),
+ },
+ {
+ translateY: viewBlockAnim.interpolate({
+ inputRange: [0, 1],
+ outputRange: [-50, 0],
+ }),
+ },
+ ],
+ opacity:
+ viewBlockAnim ||
+ deleteBlockAnim.interpolate({
+ inputRange: [0, 1],
+ outputRange: [1, 0],
+ }),
+ }
+
+ return {
+ onPressDelete,
+ animStyle,
+ }
+}
diff --git a/src/module/custom-package/atoms/custom-block.atom.tsx b/src/module/custom-package/atoms/custom-block.atom.tsx
index 40fd348..d14dfe2 100644
--- a/src/module/custom-package/atoms/custom-block.atom.tsx
+++ b/src/module/custom-package/atoms/custom-block.atom.tsx
@@ -1,64 +1,19 @@
-import React, { FC, useEffect, useRef } from 'react'
-import { Animated, LayoutAnimation, StyleSheet } from 'react-native'
+import React, { FC } from 'react'
+import { Animated, StyleSheet } from 'react-native'
import { TouchableOpacity } from 'react-native-gesture-handler'
import { Icon, Txt, colors } from '~module/common'
+import { useAnimationBlock } from '../animation'
interface IProps {
text: string
onDelete: () => void
- delay?: number
}
-export const CustomBlock: FC = ({ text, onDelete, delay }) => {
- const deleteAnim = useRef(new Animated.Value(0)).current
- const renderAnim = useRef(new Animated.Value(0)).current
-
- const onPressDelete = () => {
- Animated.spring(deleteAnim, {
- toValue: 1,
- useNativeDriver: true,
- }).start()
-
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
-
- setTimeout(onDelete, 200)
- }
-
- useEffect(() => {
- Animated.spring(renderAnim, {
- toValue: 1,
- useNativeDriver: true,
- delay,
- }).start()
- }, [])
+export const CustomBlock: FC = ({ text, onDelete }) => {
+ const { onPressDelete, animStyle } = useAnimationBlock(onDelete)
return (
-
+
{text}
{
- const dispatch = useAppDispatch()
+ const dispatch = useDispatch()
const { t } = useTranslation()
const nav = useNav()
const customPackage = useSelector(selectCustomPackage)
const customPackageFromStore = useSelector(selectCustomPackageFromStore)
+
const isHaveNewChanges = useMemo(
() => _.isEqual(customPackageFromStore, customPackage),
[customPackageFromStore, customPackage],
)
const [value, setValue] = useState('')
- const [activeMod, setActiveMod] = useState(TypeCustom.Questions)
+ const [activeMod, setActiveMod] = useState(CustomType.Questions)
- const onView = (mod: TypeCustom) => {
+ const onViewListByType = (mod: CustomType) => {
setActiveMod(mod)
}
@@ -52,40 +52,22 @@ export const CustomPackageEditorScreen: FC = () => {
setValue('')
}
- const OnAddQuestion = () => {
+ const onAddCustomGameItem = (customType: CustomType) => {
if (!value) return
- dispatch(setQuestions([...customPackage.questions, value]))
- setActiveMod(TypeCustom.Questions)
- clearValue()
- }
-
- const OnAddDare = () => {
- if (!value) return
+ dispatch(addCustomItem({ customType, value }))
- dispatch(setDares([...customPackage.dares, value]))
- setActiveMod(TypeCustom.Dares)
+ setActiveMod(customType)
clearValue()
}
const onDeleteItem = (indexItem: number) => {
- const newCustomItems = customPackage[activeMod].filter(
- (it, index) => index !== indexItem,
- )
-
- activeMod === TypeCustom.Questions
- ? dispatch(setQuestions(newCustomItems))
- : dispatch(setDares(newCustomItems))
+ dispatch(deleteCustomItem({ customType: activeMod, id: indexItem }))
}
const saveCustomPackage = async () => {
try {
- const newCustomPackage = JSON.stringify(customPackage)
-
- await AsyncStorage.setItem(
- StorageKey.CustomPackage,
- newCustomPackage,
- )
+ await storageService.set(StorageKey.CustomPackage, customPackage)
dispatch(updateCustomPackageFromStore(customPackage))
} catch (error) {
@@ -98,7 +80,7 @@ export const CustomPackageEditorScreen: FC = () => {
saveCustomPackage()
- nav.navigate(RouteKey.CustomPackage)
+ nav.navigate(UserRouteKey.CustomPackage)
}
const goBack = () => {
@@ -159,7 +141,7 @@ export const CustomPackageEditorScreen: FC = () => {
placeholderTextColor: colors.darkPurple,
}}
inputStyle={styles.input}
- renderClearPostfix={renderClear}
+ renderPostfix={renderClear}
/>
@@ -168,10 +150,13 @@ export const CustomPackageEditorScreen: FC = () => {
+ onPress={() => onAddCustomGameItem(CustomType.Questions)}>
{t('customPack.addTruth')}
-
+ onAddCustomGameItem(CustomType.Dares)}>
{t('customPack.addDare')}
@@ -179,24 +164,40 @@ export const CustomPackageEditorScreen: FC = () => {
onView(TypeCustom.Questions)}>
+ onPress={() => onViewListByType(CustomType.Questions)}>
{t('customPack.viewTruths')}
onView(TypeCustom.Dares)}>
+ onPress={() => onViewListByType(CustomType.Dares)}>
{t('customPack.viewDares')}
@@ -208,9 +209,8 @@ export const CustomPackageEditorScreen: FC = () => {
{customPackage[activeMod].map((it, index) => (
onDeleteItem(index)}
/>
))}
@@ -246,7 +246,7 @@ const styles = StyleSheet.create({
btnTxt: {
backgroundColor: null,
flex: 1,
- borderWidth: 2,
+ borderWidth: 1,
borderColor: colors.darkPurple,
},
txt: {
diff --git a/src/module/custom-package/screens/custom-package-play.screen.tsx b/src/module/custom-package/screens/custom-package-play.screen.tsx
index 2c8ef62..e006a1d 100644
--- a/src/module/custom-package/screens/custom-package-play.screen.tsx
+++ b/src/module/custom-package/screens/custom-package-play.screen.tsx
@@ -6,14 +6,13 @@ import { useSelector } from 'react-redux'
import {
ButtonPrimary,
Header,
- ProductsEnum,
- RouteKey,
+ UserRouteKey,
ScreenLayout,
appEvents,
colors,
useNav,
+ PackageType,
} from '~module/common'
-import { purchasesService } from '~module/settings'
import { selectCustomPackage } from '~store/slices'
export const CustomPackagePreviewScreen: FC = () => {
@@ -22,33 +21,20 @@ export const CustomPackagePreviewScreen: FC = () => {
const customPackage = useSelector(selectCustomPackage)
- const goToSettings = () => {
- nav.navigate(RouteKey.Settings)
- }
-
const goToCustomEditor = () => {
- nav.navigate(RouteKey.CustomEditor)
+ nav.navigate(UserRouteKey.CustomEditor)
}
const goToGame = () => {
- const isPurchased = checkIsPurchasedCustomPack()
-
- if (!isPurchased) return nav.navigate(RouteKey.Purchases)
-
const isFullCustomPack = checkIsFullCustomPack()
if (!isFullCustomPack) return
- nav.navigate(RouteKey.Game, {
- packageName: 'My package',
- isCustom: true,
+ nav.navigate(UserRouteKey.Game, {
+ packageType: PackageType.Custom,
})
}
- const checkIsPurchasedCustomPack = () => {
- return purchasesService.purchasedProducts.includes(ProductsEnum.All)
- }
-
const checkIsFullCustomPack = () => {
const isEmptyTruths = _.isEmpty(customPackage.questions)
const isEmptyDares = _.isEmpty(customPackage.dares)
@@ -76,23 +62,14 @@ export const CustomPackagePreviewScreen: FC = () => {
return (
- }>
+ headerComponent={}>
{t('customPack.editorBtn')}
-
+
{t('customPack.play')}
@@ -109,10 +86,6 @@ const styles = StyleSheet.create({
paddingBottom: 50,
},
- playBtn: {
- flexDirection: 'row',
- columnGap: 8,
- },
editorBtn: {
backgroundColor: colors.darkPurple,
},
diff --git a/src/module/game/animations/use-animation-button.ts b/src/module/game/animations/use-animation-button.ts
index 856ecab..7028f77 100644
--- a/src/module/game/animations/use-animation-button.ts
+++ b/src/module/game/animations/use-animation-button.ts
@@ -3,37 +3,44 @@ import { Animated, Easing } from 'react-native'
import { colors } from '~module/common'
export const useAnimationButton = () => {
- const buttonConfigs = [
- { delay: 400, ref: useRef(new Animated.Value(0)) },
- { delay: 1200, ref: useRef(new Animated.Value(0)) },
- { delay: 800, ref: useRef(new Animated.Value(0)) },
+ const animationsConfig = [
+ { delay: 400, value: useRef(new Animated.Value(0)).current },
+ { delay: 1200, value: useRef(new Animated.Value(0)).current },
+ { delay: 800, value: useRef(new Animated.Value(0)).current },
]
- const startAnimationsBorder = buttonConfigs.map(
- ({ delay, ref }) =>
+ const startAnimationsBorder = animationsConfig.map(
+ ({ delay, value }) =>
() =>
- Animated.timing(ref.current, {
+ Animated.timing(value, {
toValue: 1,
- duration: 600,
delay,
easing: Easing.linear,
useNativeDriver: true,
- }).start(() => ref.current.setValue(0)),
+ }).start(() => value.setValue(0)),
)
- const interpolatedColors = buttonConfigs.map(({ ref }) =>
- ref.current.interpolate({
+ const interpolatedColors = animationsConfig.map(({ value }) =>
+ value.interpolate({
inputRange: [0, 0.5, 1],
outputRange: [colors.darkPurple, colors.blue, colors.darkPurple],
}),
)
- const animBorderStyles = interpolatedColors.map(color => ({
- borderColor: color,
+ const interpolatedScale = animationsConfig.map(({ value }) =>
+ value.interpolate({
+ inputRange: [0, 0.5, 1],
+ outputRange: [1, 1.03, 1],
+ }),
+ )
+
+ const animStyle = interpolatedColors.map((it, index) => ({
+ borderColor: interpolatedColors[index],
+ transform: [{ scale: interpolatedScale[index] }],
}))
return {
- animBorderStyles,
+ animStyle,
startAnimationsBorder,
}
}
diff --git a/src/module/game/animations/use-animation-truth-or-dare.hook.ts b/src/module/game/animations/use-animation-truth-or-dare.hook.ts
index 866cf3c..a7ce3b3 100644
--- a/src/module/game/animations/use-animation-truth-or-dare.hook.ts
+++ b/src/module/game/animations/use-animation-truth-or-dare.hook.ts
@@ -2,73 +2,26 @@ import { useRef } from 'react'
import { Animated } from 'react-native'
export const useAnimationTruthOrDare = () => {
- const animValue = useRef(new Animated.Value(0)).current
- const animText = useRef(new Animated.Value(1)).current
+ const animContainer = useRef(new Animated.Value(400)).current
const startAnimation = () => {
- Animated.sequence([
- Animated.timing(animText, {
- toValue: 0,
- duration: 200,
- useNativeDriver: true,
- }),
- Animated.timing(animText, {
- toValue: 1,
- delay: 400,
- useNativeDriver: true,
- }),
- ]).start()
-
- Animated.sequence([
- Animated.timing(animValue, {
- toValue: 1,
- useNativeDriver: true,
- }),
- Animated.timing(animValue, {
- toValue: 0,
- useNativeDriver: true,
- }),
- ]).start()
+ Animated.timing(animContainer, {
+ toValue: 0,
+ duration: 400,
+ useNativeDriver: true,
+ }).start()
}
const animStyleContainer = {
transform: [
{
- translateY: animValue.interpolate({
- inputRange: [0, 1],
- outputRange: [0, 20],
- }),
- },
- {
- rotateX: animValue.interpolate({
- inputRange: [0, 1],
- outputRange: ['0deg', '180deg'],
- }),
- },
- ],
- }
- const animStyleText = {
- transform: [
- {
- scale: animText.interpolate({
- inputRange: [0, 0.5, 0.75, 1],
- outputRange: [0, 0.1, 0.5, 1],
- }),
- },
- {
- translateY: animValue.interpolate({
- inputRange: [0, 1],
- outputRange: [0, 250],
- }),
+ translateX: animContainer,
},
],
}
return {
startAnimation,
- animStyle: {
- text: animStyleText,
- container: animStyleContainer,
- },
+ animStyle: animStyleContainer,
}
}
diff --git a/src/module/game/components/index.ts b/src/module/game/components/index.ts
index 4981929..6ffa9b6 100644
--- a/src/module/game/components/index.ts
+++ b/src/module/game/components/index.ts
@@ -1 +1,2 @@
export * from './truth-or-dare-view'
+export * from './player-field.component';
diff --git a/src/module/game/components/player-field.component.tsx b/src/module/game/components/player-field.component.tsx
new file mode 100644
index 0000000..ed19195
--- /dev/null
+++ b/src/module/game/components/player-field.component.tsx
@@ -0,0 +1,49 @@
+import React, { FC } from 'react'
+import { useTranslation } from 'react-i18next'
+import { StyleSheet, TouchableOpacity } from 'react-native'
+import { FormTextControll, Icon, colors } from '~module/common'
+
+interface IProps {
+ value: string
+ onChange: (val: string) => void
+ onDelete: () => void
+}
+
+export const PlayerField: FC = ({ value, onChange, onDelete }) => {
+ const { t } = useTranslation()
+
+ const renderClear = () => (
+
+
+
+ )
+
+ return (
+
+ )
+}
+
+const styles = StyleSheet.create({
+ input: {
+ borderRadius: 60,
+ backgroundColor: colors.lightPurple,
+ borderWidth: 0,
+ fontSize: 18,
+ color: colors.purple,
+ },
+ clearIcon: {
+ position: 'absolute',
+ top: 3,
+ right: 10,
+ padding: 10,
+ },
+})
diff --git a/src/module/game/components/player-name.component.tsx b/src/module/game/components/player-name.component.tsx
new file mode 100644
index 0000000..93ef049
--- /dev/null
+++ b/src/module/game/components/player-name.component.tsx
@@ -0,0 +1,22 @@
+import React, { FC } from 'react'
+import { StyleSheet } from 'react-native'
+import { useSelector } from 'react-redux'
+import { Font, Txt } from '~module/common'
+import { selectCurrentPlayer } from '~store/slices'
+
+interface IProps {}
+
+export const PlayerName: FC = () => {
+ const playerName = useSelector(selectCurrentPlayer)
+
+ return {playerName}
+}
+
+const styles = StyleSheet.create({
+ playerName: {
+ fontFamily: Font.Roboto700,
+ textAlign: 'center',
+ fontSize: 24,
+ lineHeight: 34,
+ },
+})
diff --git a/src/module/game/components/truth-or-dare-view.tsx b/src/module/game/components/truth-or-dare-view.tsx
index 016f9d9..03c297f 100644
--- a/src/module/game/components/truth-or-dare-view.tsx
+++ b/src/module/game/components/truth-or-dare-view.tsx
@@ -1,65 +1,27 @@
-import React, { useEffect, useMemo } from 'react'
-import { useTranslation } from 'react-i18next'
-import {
- Font,
- Icon,
- Language,
- TypeCustom,
- colors,
- useAppDispatch,
- useAppSelector,
-} from '../../common'
-import {
- getStep,
- resetSteps,
- shuffleCustom,
- shuffleItems,
-} from '../../../store/slices'
+import React, { useEffect } from 'react'
+import { Font, Icon, colors } from '../../common'
import { Animated, StyleSheet } from 'react-native'
import { useAnimationTruthOrDare } from '../animations'
interface IProps {
- items: any[]
- isCustom?: TypeCustom | undefined
+ item: string
}
-export const TruthOrDareView: React.FC = ({ items, isCustom }) => {
- const dispatch = useAppDispatch()
- const { i18n } = useTranslation()
- const currentStep = useAppSelector(getStep)
- const memoItems = useMemo(() => items, [items])
-
- const { startAnimation, animStyle } = useAnimationTruthOrDare()
+export const TruthOrDareView: React.FC = ({ item }) => {
+ const { animStyle, startAnimation } = useAnimationTruthOrDare()
useEffect(() => {
- if (currentStep == memoItems.length) {
- dispatch(shuffleItems())
- dispatch(resetSteps())
- isCustom && dispatch(shuffleCustom())
- }
-
- startAnimation()
- }, [currentStep])
-
- if (currentStep === 0) {
startAnimation()
- }
-
- const content = isCustom
- ? memoItems?.[currentStep]
- : memoItems?.[currentStep]?.[i18n.language as Language]
-
+ }, [])
return (
-
+
-
- {content}
-
+ {item}
)
}
@@ -71,7 +33,12 @@ const styles = StyleSheet.create({
backgroundColor: colors.darkPurple,
borderRadius: 20,
alignItems: 'center',
- marginTop: '50%',
+ shadowColor: '#190f42',
+ shadowOffset: { width: 0, height: 2 },
+ shadowOpacity: 1,
+ shadowRadius: 4,
+ elevation: 5,
+ marginTop: 88,
},
starIcon: {
marginBottom: 14,
diff --git a/src/module/game/config/index.ts b/src/module/game/config/index.ts
new file mode 100644
index 0000000..c5e6cc5
--- /dev/null
+++ b/src/module/game/config/index.ts
@@ -0,0 +1 @@
+export * from './package-name.config';
diff --git a/src/module/game/config/package-name.config.ts b/src/module/game/config/package-name.config.ts
new file mode 100644
index 0000000..bae109a
--- /dev/null
+++ b/src/module/game/config/package-name.config.ts
@@ -0,0 +1,12 @@
+import { PackageType } from '~module/common'
+
+export const packageNameConfig: any = {
+ [PackageType.Under18]: {
+ en: 'Under 18',
+ ua: 'До 18 років',
+ hi: '18 से नीचे',
+ },
+ [PackageType.Light]: { en: 'Light', ua: 'Легкий', hi: 'रोशनी' },
+ [PackageType.Crazy]: { en: 'Crazy', ua: 'Божевільний', hi: 'पागल' },
+ [PackageType.Custom]: { en: 'Custom Pack', ua: 'Мій пакет' },
+}
diff --git a/src/module/game/helper/get-current-truth-dares.helper.ts b/src/module/game/helper/get-current-truth-dares.helper.ts
deleted file mode 100644
index cea983f..0000000
--- a/src/module/game/helper/get-current-truth-dares.helper.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { selectShuffled, selectShuffledCustom } from '../../../store/slices'
-import { TypeCustom, useAppSelector } from '../../common'
-
-interface UseTruthOrDareProps {
- isTruth: boolean
- customType: TypeCustom
-}
-
-export const getCurrentTruthOrDare = ({
- isTruth,
- customType,
-}: UseTruthOrDareProps) => {
- const gameItems = useAppSelector(selectShuffled)
- const customPackage = useAppSelector(selectShuffledCustom)
- const dares = gameItems.filter(dare => dare.isDare)
- const questions = gameItems.filter(question => !question.isDare)
- const packageTruthOrDare = isTruth ? questions : dares
-
- const truthOrDareItems = customType
- ? customPackage[customType]
- : packageTruthOrDare
-
- return truthOrDareItems
-}
diff --git a/src/module/game/helper/index.ts b/src/module/game/helper/index.ts
deleted file mode 100644
index 24e7f84..0000000
--- a/src/module/game/helper/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './get-current-truth-dares.helper'
diff --git a/src/module/game/hooks/get-current-truth-dares.hook.tsx b/src/module/game/hooks/get-current-truth-dares.hook.tsx
new file mode 100644
index 0000000..b6f019d
--- /dev/null
+++ b/src/module/game/hooks/get-current-truth-dares.hook.tsx
@@ -0,0 +1,126 @@
+import { useEffect } from 'react'
+import {
+ resetStepsByTruthOrDare,
+ selectCustomPackage,
+ selectPackage,
+ selectShuffleCustomPackage,
+ selectStep,
+ shuffleCustomPackage,
+ shufflePackage,
+} from '../../../store/slices'
+import {
+ ChoiceType,
+ CustomType,
+ Language,
+ PackageType,
+ StorageKey,
+ storageService,
+} from '../../common'
+import { useTranslation } from 'react-i18next'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '~store/store'
+import firestore from '@react-native-firebase/firestore'
+import _ from 'lodash'
+
+interface UseTruthOrDareProps {
+ choiceType: ChoiceType
+ customType: CustomType
+ packageType: PackageType
+}
+
+export const useGetCurrentTruthOrDare = ({
+ choiceType,
+ customType,
+ packageType,
+}: UseTruthOrDareProps) => {
+ const dispatch = useDispatch()
+ const { i18n } = useTranslation()
+ const { stepTruth, stepDare } = useSelector(selectStep)
+ const customPackageShuffle = useSelector(selectShuffleCustomPackage)
+ const customPackage = useSelector(selectCustomPackage)
+ const gameItems = useSelector((state: RootState) =>
+ selectPackage(state, packageType),
+ )
+ const currentStep = choiceType === ChoiceType.Truth ? stepTruth : stepDare
+
+ const getGameItemsByPackage = () => {
+ if (packageType === PackageType.Custom) return
+
+ const dares = gameItems.filter(dare => dare.isDare)
+ const questions = gameItems.filter(question => !question.isDare)
+ return choiceType === ChoiceType.Truth ? questions : dares
+ }
+
+ const getGameItemsByCustomPackage = () => {
+ if (_.isEmpty(customPackageShuffle.questions))
+ return customPackage[customType]
+
+ return customPackageShuffle[customType]
+ }
+
+ const getCurrentItem = () => {
+ if (packageType === PackageType.Custom) {
+ return customTruthsOrDares?.[currentStep]
+ }
+
+ return packageTruthsOrDares?.[currentStep]?.[i18n.language as Language]
+ }
+ const customTruthsOrDares = getGameItemsByCustomPackage()
+ const packageTruthsOrDares = getGameItemsByPackage()
+ const currentItem = getCurrentItem()
+
+ console.log('currentItem', currentItem)
+ console.log('customTruthsOrDares', customTruthsOrDares)
+
+ const shuffleAndSavePackage = async () => {
+ const shufflePackages = _.shuffle(packageTruthsOrDares)
+ await firestore()
+ .collection('content')
+ .doc(packageType)
+ .update(shufflePackages)
+
+ dispatch(resetStepsByTruthOrDare(choiceType))
+ dispatch(shufflePackage(packageType))
+ }
+
+ const shuffleAndSaveCustomPackage = async () => {
+ if (_.isEmpty(customTruthsOrDares)) return
+
+ const shuffleCustom = _.shuffle(customTruthsOrDares)
+
+ dispatch(shuffleCustomPackage({ customType, shuffleCustom }))
+ dispatch(resetStepsByTruthOrDare(choiceType))
+
+ const savedShuffleCustom = await storageService.get(
+ StorageKey.ShuffleCustomPackage,
+ )
+
+ const newShuffled = {
+ ...savedShuffleCustom,
+ [customType]: shuffleCustom,
+ }
+ await storageService.set(StorageKey.ShuffleCustomPackage, newShuffled)
+ }
+
+ const checkIsNeedShuffle = () => {
+ if (
+ packageType === PackageType.Custom &&
+ currentStep === customTruthsOrDares.length
+ ) {
+ return shuffleAndSaveCustomPackage()
+ }
+
+ if (
+ (packageType !== PackageType.Custom && currentStep) ===
+ packageTruthsOrDares?.length
+ ) {
+ shuffleAndSavePackage()
+ }
+ }
+
+ useEffect(() => {
+ checkIsNeedShuffle()
+ }, [currentStep])
+
+ return currentItem
+}
diff --git a/src/module/game/hooks/index.ts b/src/module/game/hooks/index.ts
new file mode 100644
index 0000000..438ce0a
--- /dev/null
+++ b/src/module/game/hooks/index.ts
@@ -0,0 +1,2 @@
+export * from './get-current-truth-dares.hook'
+export * from './use-set-steps-by-package';
diff --git a/src/module/game/hooks/use-set-steps-by-package.tsx b/src/module/game/hooks/use-set-steps-by-package.tsx
new file mode 100644
index 0000000..ff83d11
--- /dev/null
+++ b/src/module/game/hooks/use-set-steps-by-package.tsx
@@ -0,0 +1,24 @@
+import { useEffect } from 'react'
+import { useDispatch } from 'react-redux'
+import { PackageType, StorageKey, storageService } from '~module/common'
+import { resetSteps, setStep } from '~store/slices'
+
+export const useSetStepsByPackage = (packageType: PackageType) => {
+ const dispatch = useDispatch()
+
+ const setStepsByPackage = async () => {
+ const lastSteps = await storageService.get(StorageKey.SavedSteps)
+
+ const stepsByPackage = lastSteps?.[packageType]
+
+ console.log('stepsByPackage', stepsByPackage)
+
+ if (!stepsByPackage) return dispatch(resetSteps())
+
+ dispatch(setStep(stepsByPackage))
+ }
+
+ useEffect(() => {
+ setStepsByPackage()
+ }, [])
+}
diff --git a/src/module/game/index.ts b/src/module/game/index.ts
index a2ff41a..38e27b2 100644
--- a/src/module/game/index.ts
+++ b/src/module/game/index.ts
@@ -1,4 +1,5 @@
export * from './screens'
export * from './components'
-export * from './animations';
-export * from './helper';
+export * from './animations'
+export * from './config'
+export * from './hooks'
diff --git a/src/module/game/screens/game.screen.tsx b/src/module/game/screens/game.screen.tsx
index 1ba93a4..8c5158a 100644
--- a/src/module/game/screens/game.screen.tsx
+++ b/src/module/game/screens/game.screen.tsx
@@ -5,80 +5,100 @@ import {
colors,
Font,
Header,
- RouteKey,
+ UserRouteKey,
ScreenLayout,
- TypeCustom,
+ CustomType,
useNav,
+ PackageType,
+ ChoiceType,
} from '../../common'
import { useTranslation } from 'react-i18next'
import { useIsFocused, useRoute } from '@react-navigation/native'
import { useAnimationButton } from '../animations'
+import { PlayerName } from '../components/player-name.component'
+import { packageNameConfig } from '../config'
+import { useSetStepsByPackage } from '../hooks'
+
+interface IRouteParams {
+ packageType?: PackageType
+}
export const GameScreen: FC = () => {
- const { t } = useTranslation()
+ const { t, i18n } = useTranslation()
const nav = useNav()
- const { params }: any = useRoute()
- const { packageName, isCustom } = params
+ const { params } = useRoute()
+ const { packageType }: IRouteParams = params
const isFocused = useIsFocused()
- const { animBorderStyles, startAnimationsBorder } = useAnimationButton()
+ const { animStyle, startAnimationsBorder } = useAnimationButton()
+
+ useSetStepsByPackage(packageType)
const randomGame = () => {
const isTruthRandom = Math.random() < 0.5
const customRandom = isTruthRandom
- ? TypeCustom.Questions
- : TypeCustom.Dares
+ ? CustomType.Questions
+ : CustomType.Dares
- nav.navigate(RouteKey.TruthOrDare, {
- isTruth: isTruthRandom,
- packageName,
- customType: isCustom ? customRandom : null,
+ nav.navigate(UserRouteKey.TruthOrDare, {
+ choiceType: isTruthRandom ? ChoiceType.Truth : ChoiceType.Dare,
+ packageType,
+ customType: PackageType.Custom ? customRandom : null,
})
}
const onChooseTruth = () => {
- nav.navigate(RouteKey.TruthOrDare, {
- isTruth: true,
- packageName,
- customType: isCustom && TypeCustom.Questions,
+ nav.navigate(UserRouteKey.TruthOrDare, {
+ choiceType: ChoiceType.Truth,
+ packageType,
+ customType: PackageType.Custom && CustomType.Questions,
})
}
const onChooseDare = () => {
- nav.navigate(RouteKey.TruthOrDare, {
- packageName,
- customType: isCustom && TypeCustom.Dares,
+ nav.navigate(UserRouteKey.TruthOrDare, {
+ packageType,
+ customType: PackageType.Custom && CustomType.Dares,
})
}
return (
- }>
+ nav.navigate(UserRouteKey.Players)}
+ gamer
+ />
+ }>
+
{t('buttonsTranslation.truth')}
{t('buttonsTranslation.random')}
{t('buttonsTranslation.dare')}
@@ -89,32 +109,23 @@ export const GameScreen: FC = () => {
}
const styles = StyleSheet.create({
- playerName: {
- fontFamily: Font.Roboto700,
- textAlign: 'center',
- marginBottom: 122,
- },
wrapButtons: {
alignItems: 'center',
justifyContent: 'center',
- rowGap: 40,
- marginTop: '50%',
+ rowGap: 20,
+ marginTop: '45%',
},
gameButton: {
- height: 66,
- width: 188,
borderRadius: 40,
backgroundColor: colors.primaryColor,
borderWidth: 2,
borderColor: colors.darkPurple,
+ height: 66,
},
randomButton: {
- height: 66,
- width: 188,
borderRadius: 40,
backgroundColor: 'transparent',
- borderWidth: 2,
- borderColor: colors.darkPurple,
+ height: 66,
},
styleTxtBtn: {
color: colors.red,
@@ -122,5 +133,4 @@ const styles = StyleSheet.create({
fontSize: 36,
lineHeight: 46,
},
- txt: {},
})
diff --git a/src/module/game/screens/index.ts b/src/module/game/screens/index.ts
index 8d55c90..609b5e1 100644
--- a/src/module/game/screens/index.ts
+++ b/src/module/game/screens/index.ts
@@ -1,2 +1,3 @@
export * from './game.screen'
export * from './truth-or-dare.screen'
+export * from './players.screen';
diff --git a/src/module/game/screens/players.screen.tsx b/src/module/game/screens/players.screen.tsx
new file mode 100644
index 0000000..7bb853d
--- /dev/null
+++ b/src/module/game/screens/players.screen.tsx
@@ -0,0 +1,122 @@
+import React, { FC } from 'react'
+import { StyleSheet, View } from 'react-native'
+import {
+ ButtonPrimary,
+ colors,
+ Font,
+ Header,
+ UserRouteKey,
+ ScreenLayout,
+ useNav,
+ ButtonWithIcon,
+ appEvents,
+ StorageKey,
+ storageService,
+} from '../../common'
+import { useTranslation } from 'react-i18next'
+import { PlayerField } from '../components'
+import { selectPlayers, setPlayers } from '~store/slices'
+import { useDispatch, useSelector } from 'react-redux'
+
+export const PlayersScreen: FC = () => {
+ const { t } = useTranslation()
+ const nav = useNav()
+ const dispatch = useDispatch()
+ const players = useSelector(selectPlayers)
+
+ const onAddField = () => {
+ dispatch(setPlayers([...players, '']))
+ }
+
+ const onChangePlayer = (index: number, value: string) => {
+ const updatedPlayers = [...players]
+ updatedPlayers[index] = value
+ dispatch(setPlayers(updatedPlayers))
+ }
+
+ const onDeletePlayer = (index: number) => {
+ const updatedPlayers = [...players]
+
+ if (updatedPlayers.length === 1) return
+
+ updatedPlayers.splice(index, 1)
+ dispatch(setPlayers(updatedPlayers))
+ }
+
+ const checkIsFullName = () => {
+ return players.some(playerName => !playerName)
+ }
+
+ const onSavePlayers = async () => {
+ const hasEmptyName = checkIsFullName()
+
+ if (hasEmptyName) {
+ return appEvents.emit('alert', {
+ title: t('common.notFillPlayerTitle'),
+ subtitle: t('common.notFillPlayerMessage'),
+ })
+ }
+
+ await storageService.set(StorageKey.Players, players)
+
+ nav.navigate(UserRouteKey.Packages)
+ }
+
+ return (
+
+ }>
+
+ {players.map((player, index) => (
+ onChangePlayer(index, value)}
+ onDelete={() => onDeletePlayer(index)}
+ />
+ ))}
+
+
+
+
+
+ {t('customPack.play')}
+
+
+ )
+}
+
+const styles = StyleSheet.create({
+ playerName: {
+ fontFamily: Font.Roboto700,
+ textAlign: 'center',
+ marginBottom: 122,
+ },
+ plusBtn: {
+ marginTop: 24,
+ borderRadius: 50,
+ width: 50,
+ height: 50,
+ backgroundColor: colors.purple,
+ marginLeft: 'auto',
+ },
+ playBtn: {
+ marginTop: 'auto',
+ },
+})
diff --git a/src/module/game/screens/truth-or-dare.screen.tsx b/src/module/game/screens/truth-or-dare.screen.tsx
index ff4d7fc..9c7f1d6 100644
--- a/src/module/game/screens/truth-or-dare.screen.tsx
+++ b/src/module/game/screens/truth-or-dare.screen.tsx
@@ -1,55 +1,148 @@
-import React, { useRef } from 'react'
-import { Animated, StyleSheet, View } from 'react-native'
+import React, { useEffect } from 'react'
+import { StyleSheet, View } from 'react-native'
import { useRoute } from '@react-navigation/native'
import {
ButtonWithIcon,
Header,
- RouteKey,
+ UserRouteKey,
ScreenLayout,
- TypeCustom,
- useAppDispatch,
- useAppSelector,
+ CustomType,
useNav,
+ PackageType,
+ StorageKey,
+ appEvents,
+ storageService,
+ ChoiceType,
} from '../../common'
import {
+ addCustomItem,
nextStep,
- resetSteps,
- selectShuffled,
- selectShuffledCustom,
- shuffleCustom,
- shuffleItems,
+ onNextPlayer,
+ selectStep,
} from '../../../store/slices'
import { TruthOrDareView } from '../components'
import { useAnimationIconsButton } from '../animations'
-import { getCurrentTruthOrDare } from '../helper'
+import { useGetCurrentTruthOrDare } from '../hooks'
+import { PlayerName } from '../components/player-name.component'
+import { packageNameConfig } from '../config'
+import { useTranslation } from 'react-i18next'
+import { useDispatch, useSelector } from 'react-redux'
interface IRouteParams {
- packageName?: string
- isTruth?: boolean
- customType?: TypeCustom
+ packageType?: PackageType
+ customType?: CustomType
+ currentPlayer?: string
+ choiceType?: ChoiceType
}
export const TruthOrDareScreen: React.FC = () => {
const nav = useNav()
- const dispatch = useAppDispatch()
+ const { t, i18n } = useTranslation()
+ const dispatch = useDispatch()
const { params } = useRoute()
- const { packageName, isTruth, customType }: IRouteParams = params
-
- const truthOrDareItems = getCurrentTruthOrDare({ isTruth, customType })
+ const currentStep = useSelector(selectStep)
const { animRotate, animScale } = useAnimationIconsButton()
+ const { packageType, choiceType, customType }: IRouteParams = params
+
+ const currentItem = useGetCurrentTruthOrDare({
+ choiceType,
+ customType,
+ packageType,
+ })
- const goBack = () => {
- nav.navigate(RouteKey.Game, { packageName })
+ const onNextTruthOrDare = () => {
+ nav.navigate(UserRouteKey.Game, { packageType })
+ dispatch(onNextPlayer())
+ dispatch(nextStep(choiceType))
+ saveLastStep()
}
- const onNext = () => {
- dispatch(nextStep())
+ const onAddGameItemToCustomPackage = () => {
+ const customType =
+ choiceType === ChoiceType.Truth
+ ? CustomType.Questions
+ : CustomType.Dares
+
+ dispatch(addCustomItem({ customType, value: currentItem }))
}
- const refreshList = () => {
- !customType && dispatch(shuffleItems())
- customType && dispatch(shuffleCustom())
- dispatch(resetSteps())
+ const onPressAddPlus = () => {
+ const subtitleByChoice =
+ choiceType === ChoiceType.Truth
+ ? t('customPack.addCustomTruth')
+ : t('customPack.addCustomDare')
+
+ appEvents.emit('confirm', {
+ title: t('customPack.label'),
+ subtitle: subtitleByChoice,
+ cancelBtnText: 'No',
+ confirmBtnText: 'Yes',
+ buttons: [
+ {
+ onPress: () => null,
+ },
+ {
+ onPress: onAddGameItemToCustomPackage,
+ },
+ ],
+ })
+ }
+
+ const saveLastStep = async () => {
+ const savedStepsAllPackages = await storageService.get(
+ StorageKey.SavedSteps,
+ )
+
+ const key = choiceType === ChoiceType.Truth ? 'stepTruth' : 'stepDare'
+
+ const updateSteps = { ...currentStep, [key]: currentStep[key] + 1 }
+
+ const stepsByCurrentPackage = {
+ [packageType]: updateSteps,
+ }
+
+ const saveStepsByPackage = {
+ ...savedStepsAllPackages,
+ ...stepsByCurrentPackage,
+ }
+
+ storageService.set(StorageKey.SavedSteps, saveStepsByPackage)
+ }
+
+ const handleLimitCrazy = async () => {
+ const isPurchasedCrazy = await storageService.get(StorageKey.Purchases)
+
+ if (isPurchasedCrazy) return
+
+ const limit = await storageService.get(StorageKey.LimitForCrazy)
+
+ if (!limit) return storageService.set(StorageKey.LimitForCrazy, 1)
+
+ if (limit >= 5) {
+ return appEvents.emit('confirm', {
+ title: t('common.limitTitle'),
+ subtitle: t('common.limitDesc'),
+ confirmBtnText: t('common.buyAfterBtn'),
+ cancelBtnText: t('common.no'),
+ isRedButton: true,
+ buttons: [
+ { onPress: () => nav.navigate(UserRouteKey.Packages) },
+ {
+ onPress: () => nav.navigate(UserRouteKey.Purchases),
+ },
+ ],
+ })
+ }
+
+ storageService.set(StorageKey.LimitForCrazy, limit + 1)
+ }
+
+ useEffect(() => {
+ if (packageType === PackageType.Crazy) handleLimitCrazy()
+ }, [currentItem])
+
+ const onNextSameItem = () => {
+ dispatch(nextStep(choiceType))
}
return (
@@ -57,21 +150,20 @@ export const TruthOrDareScreen: React.FC = () => {
headerComponent={
goBack()}
- title={packageName}
+ onPressLeft={onNextTruthOrDare}
+ title={packageNameConfig?.[packageType]?.[i18n.language]}
/>
}>
-
+
+
+
@@ -79,7 +171,15 @@ export const TruthOrDareScreen: React.FC = () => {
+
+
diff --git a/src/module/packages/animation/use-animation-list.hook.ts b/src/module/packages/animation/use-animation-list.hook.ts
index 46e74b9..c16b1b7 100644
--- a/src/module/packages/animation/use-animation-list.hook.ts
+++ b/src/module/packages/animation/use-animation-list.hook.ts
@@ -1,5 +1,5 @@
import React, { useEffect, useRef } from 'react'
-import { Animated, Easing } from 'react-native'
+import { Animated } from 'react-native'
import { useIsFocused } from '@react-navigation/native'
export const useAnimationList = (delay: number) => {
@@ -22,14 +22,12 @@ export const useAnimationList = (delay: number) => {
duration: 2000,
delay,
useNativeDriver: true,
- easing: Easing.linear,
}),
Animated.timing(animTransformY, {
toValue: 0,
duration: 2000,
delay,
useNativeDriver: true,
- easing: Easing.linear,
}),
]),
),
diff --git a/src/module/packages/atoms/animated-diamond-icon.atom.tsx b/src/module/packages/atoms/animated-diamond-icon.atom.tsx
index 1cc0892..b1b4b94 100644
--- a/src/module/packages/atoms/animated-diamond-icon.atom.tsx
+++ b/src/module/packages/atoms/animated-diamond-icon.atom.tsx
@@ -11,13 +11,11 @@ export const AnimatedDiamondIcon: FC = ({}) => {
useEffect(() => {
const loopAnimation = Animated.loop(
- Animated.sequence([
- Animated.spring(rotateIcon, {
- toValue: 1,
- useNativeDriver: true,
- stiffness: 5,
- }),
- ]),
+ Animated.spring(rotateIcon, {
+ toValue: 1,
+ useNativeDriver: true,
+ stiffness: 5,
+ }),
)
if (!isFocus) {
diff --git a/src/module/packages/atoms/create-custom-package.atom.tsx b/src/module/packages/atoms/create-custom-package.atom.tsx
index 1dd980e..59e943e 100644
--- a/src/module/packages/atoms/create-custom-package.atom.tsx
+++ b/src/module/packages/atoms/create-custom-package.atom.tsx
@@ -1,7 +1,7 @@
import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { Animated, StyleSheet, TouchableOpacity, View } from 'react-native'
-import { colors, Font, RouteKey, Txt, useNav } from '../../common'
+import { colors, Font, UserRouteKey, Txt, useNav } from '../../common'
import { AnimatedDiamondIcon } from './animated-diamond-icon.atom'
import { useAnimationCustomItem } from '../animation'
@@ -14,7 +14,7 @@ export const CustomPackage: FC = ({}) => {
const onPressCustomPackage = () => {
startAnimation()
- nav.navigate(RouteKey.CustomPackage)
+ nav.navigate(UserRouteKey.CustomPackage)
}
return (
diff --git a/src/module/packages/components/packages-item.component.tsx b/src/module/packages/components/packages-item.component.tsx
index ab14332..13c0efa 100644
--- a/src/module/packages/components/packages-item.component.tsx
+++ b/src/module/packages/components/packages-item.component.tsx
@@ -1,18 +1,21 @@
import React, { FC } from 'react'
import { Animated, StyleSheet, View } from 'react-native'
-import { ButtonWithIcon, RouteKey, Txt, colors, useNav } from '../../common'
+import {
+ ButtonWithIcon,
+ UserRouteKey,
+ Txt,
+ colors,
+ useNav,
+ PackageType,
+} from '../../common'
import { useAnimationList } from '../animation'
-interface IType {
- [key: string]: string
-}
interface IPackage {
packageName: string
description: string
image: JSX.Element
- questions: IType[]
- actions: IType[]
delay: number
+ packageType: PackageType
}
export const PackageItem: FC = ({
@@ -20,13 +23,14 @@ export const PackageItem: FC = ({
description,
image,
delay,
+ packageType,
}) => {
const nav = useNav()
const { animationStyleItem } = useAnimationList(delay)
const onPlay = () => {
- nav.navigate(RouteKey.Game, { packageName })
+ nav.navigate(UserRouteKey.Game, { packageType })
}
return (
@@ -68,7 +72,6 @@ const styles = StyleSheet.create({
marginBottom: 5,
},
description: {
- marginBottom: 5,
color: colors.secondaryText,
fontSize: 16,
lineHeight: 24,
diff --git a/src/module/packages/config/packages-list.config.tsx b/src/module/packages/config/packages-list.config.tsx
index f519d02..08a1b65 100644
--- a/src/module/packages/config/packages-list.config.tsx
+++ b/src/module/packages/config/packages-list.config.tsx
@@ -1,9 +1,11 @@
import React from 'react'
import { Image } from 'react-native'
+import { PackageType } from '~module/common'
export const packageListConfig = [
{
title: { en: 'Under 18', ua: 'До 18 років', hi: '18 से नीचे' },
+ packageType: PackageType.Under18,
image: (
),
description: {
- en: 'Sharp questions and tasks for young people and of courseno alcohol.',
- ua: 'Гострі питання і завдання для молоді і звичайно без алкоголю.',
- hi: 'युवा लोगों के लिए तीखे प्रश्न और कार्य और निश्चित रूप सेशराब नहीं।',
+ en: 'Sharp and interesting questions and tasks. An ideal choice for teenagers and young people.',
+ ua: 'Гострі та цікаві питання і завдання. Ідеальний вибір для підлітків та молоді, щоб відпочити та посміятись.',
},
- questions: [
- {
- en: 'Under truth',
- ua: 'до 18 років правда',
- hi: '18 से नीचे परीक्षण',
- },
- {
- en: 'Under truth2',
- ua: 'до 18 років правда2',
- hi: '18 से नीचे परीक्षण2',
- },
- {
- en: 'Under truth3',
- ua: 'до 18 років правда3',
- hi: '18 से नीचे परीक्षण3',
- },
- ],
- actions: [
- {
- en: 'Light dare',
- ua: 'до 18 років дія',
- hi: '18 से नीचे परीक्षण',
- },
- {
- en: 'Light dare2',
- ua: 'до 18 років дія2',
- hi: '18 से नीचे परीक्षण2',
- },
- {
- en: 'Light dare3',
- ua: 'до 18 років дія3',
- hi: '18 से नीचे परीक्षण3',
- },
- ],
},
{
title: { en: 'Light', ua: 'Легкий', hi: 'रोशनी' },
+ packageType: PackageType.Light,
image: (
),
description: {
- en: 'Challenge your friends or your significant other and see how far they can go!',
- ua: 'Киньте виклик своїм друзям або своїй другій половинці та подивіться, як далеко вони можуть зайти!',
- hi: 'अपने दोस्तों या अपने महत्वपूर्ण दूसरे को चुनौती दें और देखें कि वे कितनी दूर जा सकते हैं!',
+ ua: 'Challenge your friends or your significant other and see how far they can go!',
+ en: 'Fun and unexpected tasks are guaranteed to make you laugh and discover new facts from the life of the participants.',
},
- questions: [
- {
- en: 'Light truth',
- ua: 'легка правда',
- hi: 'रोशनी परीक्षण',
- },
- {
- en: 'Light truth2',
- ua: 'легка правда2',
- hi: 'रोशनी परीक्षण',
- },
- {
- en: 'Light truth3',
- ua: 'легка правда3',
- hi: 'रोशनी परीक्षण3',
- },
- ],
- actions: [
- {
- en: 'Light dare',
- ua: 'легка дія',
- hi: 'रोशनी परीक्षण',
- },
- {
- en: 'Light dare2',
- ua: 'легка дія2',
- hi: 'रोशनी परीक्षण2',
- },
- {
- en: 'Light dare3',
- ua: 'легка дія3',
- hi: 'रोशनी परीक्षण3',
- },
- ],
},
{
title: { en: 'Crazy', ua: 'Божевільний', hi: 'पागल' },
+ packageType: PackageType.Crazy,
image: (
{
const nav = useNav()
const { i18n } = useTranslation()
- const isFocus = useIsFocused()
-
return (
nav.navigate(RouteKey.Settings)}
+ onPressLeft={() => nav.navigate(UserRouteKey.Players)}
+ onPressRight={() => nav.navigate(UserRouteKey.Settings)}
/>
}>
{packageListConfig.map((item: any, index) => (
= ({ isLastBlock, onPressSkip }) => {
- const nav = useNav()
const { t } = useTranslation()
+ const dispatch = useDispatch()
const onBoardFinish = async () => {
- await AsyncStorage.setItem(StorageKey.OnBoarding, 'true')
- nav.navigate(RouteKey.Packages)
+ await storageService.set(StorageKey.FinishOnBoarding, true)
+ dispatch(setNavGroup(NavGroup.User))
}
return (
diff --git a/src/module/root/index.tsx b/src/module/root/index.tsx
index b8e6911..edc1b0e 100644
--- a/src/module/root/index.tsx
+++ b/src/module/root/index.tsx
@@ -1,16 +1,24 @@
import React, { FC, useEffect, useMemo } from 'react'
-import { AlertConfirmWidget, AlertWidget, gcService } from '../common'
+import { AlertConfirmWidget, AlertWidget, NavGroup, gcService } from '../common'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
-import { UserNavigationGroup } from './navigations-groups'
+import { GuestNavigationGroup, UserNavigationGroup } from './navigations-groups'
+import { useSelector } from 'react-redux'
+import { selectNavGroup } from '~store/slices'
export const Root: FC = () => {
const insets = useSafeAreaInsets()
+ const activeGroup = useSelector(selectNavGroup)
+
+ const navGroups = {
+ [NavGroup.Guest]: ,
+ [NavGroup.User]: ,
+ }
useEffect(() => {
gcService.set('insetsTop', insets.top)
}, [insets.top])
- const navigation = useMemo(() => , [])
+ const navigation = useMemo(() => navGroups[activeGroup], [activeGroup])
return (
<>
diff --git a/src/module/root/navigations-groups/index.tsx b/src/module/root/navigations-groups/index.tsx
index 4f6ac6f..71e0723 100644
--- a/src/module/root/navigations-groups/index.tsx
+++ b/src/module/root/navigations-groups/index.tsx
@@ -1 +1,2 @@
export * from './user.group';
+export * from './quest.group';
diff --git a/src/module/root/navigations-groups/quest.group.tsx b/src/module/root/navigations-groups/quest.group.tsx
new file mode 100644
index 0000000..3104330
--- /dev/null
+++ b/src/module/root/navigations-groups/quest.group.tsx
@@ -0,0 +1,34 @@
+import React, { FC } from 'react'
+import { createNativeStackNavigator } from '@react-navigation/native-stack'
+import { Platform } from 'react-native'
+import { GuestRouteKey } from '~module/common'
+import { LanguageSelectScreen, OnboardingScreen } from '../screens'
+import { LoadingScreen } from '../screens/loading-screen'
+
+const GuestStack = createNativeStackNavigator()
+
+export const GuestNavigationGroup: FC = () => {
+ return (
+
+
+
+
+
+ )
+}
diff --git a/src/module/root/navigations-groups/user.group.tsx b/src/module/root/navigations-groups/user.group.tsx
index 544a19b..41d0a52 100644
--- a/src/module/root/navigations-groups/user.group.tsx
+++ b/src/module/root/navigations-groups/user.group.tsx
@@ -1,17 +1,11 @@
import React, { FC } from 'react'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
-import { RouteKey } from '../../common'
-import { GameScreen, TruthOrDareScreen } from '../../game'
+import { GameScreen, PlayersScreen, TruthOrDareScreen } from '../../game'
import { PackagesListScreen } from '../../packages'
-import {
- LanguageSelectScreen,
- OnboardingScreen,
- SettingsScreen,
-} from '../screens'
-import { LoadingScreen } from '../screens/loading-screen'
import {
PrivacyPolicyScreen,
PurchasesScreen,
+ SettingsScreen,
WriteToUsScreen,
} from '../../settings'
import {
@@ -19,66 +13,65 @@ import {
CustomPackagePreviewScreen,
} from '~module/custom-package'
import { Platform } from 'react-native'
+import { UserRouteKey } from '~module/common'
-const Stack = createNativeStackNavigator()
-
-const SettingsStack = createNativeStackNavigator()
+const UserStack = createNativeStackNavigator()
export const UserNavigationGroup: FC = () => {
return (
-
-
-
+
-
-
-
-
-
+
+
-
-
-
-
-
-
+
)
}
diff --git a/src/module/root/screens/index.tsx b/src/module/root/screens/index.tsx
index 07b6f76..24152a0 100644
--- a/src/module/root/screens/index.tsx
+++ b/src/module/root/screens/index.tsx
@@ -1,3 +1,3 @@
export * from './language-select.screen'
export * from './on-boarding.screen'
-export * from '../../settings/screens/settings.screen'
+export * from './loading-screen';
diff --git a/src/module/root/screens/language-select.screen.tsx b/src/module/root/screens/language-select.screen.tsx
index d2841ef..3284abd 100644
--- a/src/module/root/screens/language-select.screen.tsx
+++ b/src/module/root/screens/language-select.screen.tsx
@@ -1,9 +1,7 @@
-import AsyncStorage from '@react-native-async-storage/async-storage'
import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, View } from 'react-native'
import {
- RouteKey,
colors,
ScreenLayout,
useNav,
@@ -13,6 +11,8 @@ import {
EngSvg,
UaSvg,
Font,
+ GuestRouteKey,
+ storageService,
} from '../../common'
import { LanguageItem } from '../components'
@@ -33,9 +33,9 @@ export const LanguageSelectScreen: FC = () => {
const nav = useNav()
const onSelectLanguage = async (language: Language) => {
- nav.navigate(RouteKey.Onboarding)
+ nav.navigate(GuestRouteKey.Onboarding)
i18n.changeLanguage(language)
- await AsyncStorage.setItem(StorageKey.Language, language)
+ await storageService.set(StorageKey.Language, language)
}
return (
diff --git a/src/module/root/screens/loading-screen.tsx b/src/module/root/screens/loading-screen.tsx
index e00e95b..69a6200 100644
--- a/src/module/root/screens/loading-screen.tsx
+++ b/src/module/root/screens/loading-screen.tsx
@@ -2,37 +2,43 @@ import { ActivityIndicator, StyleSheet, View } from 'react-native'
import React, { FC, useEffect } from 'react'
import {
ScreenLayout,
- RouteKey,
useNav,
- useAppDispatch,
StorageKey,
+ NavGroup,
+ GuestRouteKey,
+ storageService,
} from '../../common'
-import AsyncStorage from '@react-native-async-storage/async-storage'
import { useTranslation } from 'react-i18next'
import { purchasesService } from '../../settings'
-import { fetchPostsAsync, getCustomPackage } from '../../../store/slices'
+import {
+ getGameItemsFromFirestore,
+ getCustomPackage,
+ setNavGroup,
+ getPlayersAsync,
+} from '../../../store/slices'
+import { useDispatch } from 'react-redux'
export const LoadingScreen: FC = () => {
const { i18n } = useTranslation()
const nav = useNav()
-
- const dispatch = useAppDispatch()
+ const dispatch = useDispatch()
const getLanguage = async () => {
- const response = await AsyncStorage.getItem(StorageKey.Language)
- return response
+ return await storageService.get(StorageKey.Language)
}
const getOnboardEnd = async () => {
- const response = await AsyncStorage.getItem(StorageKey.OnBoarding)
- return response
+ return await storageService.get(StorageKey.FinishOnBoarding)
}
const init = async () => {
- let language = await getLanguage()
+ const language = await getLanguage()
const isOnBoard = await getOnboardEnd()
- dispatch(fetchPostsAsync())
+
+ dispatch(getGameItemsFromFirestore())
dispatch(getCustomPackage())
+ dispatch(getPlayersAsync())
+
purchasesService.init()
if (language) {
@@ -40,11 +46,11 @@ export const LoadingScreen: FC = () => {
}
if (isOnBoard && language) {
- nav.navigate(RouteKey.Packages)
+ dispatch(setNavGroup(NavGroup.User))
} else if (language && !isOnBoard) {
- nav.navigate(RouteKey.Onboarding)
+ nav.navigate(GuestRouteKey.Onboarding)
} else if (!language) {
- nav.navigate(RouteKey.LanguageSelect)
+ nav.navigate(GuestRouteKey.LanguageSelect)
}
}
@@ -65,5 +71,6 @@ const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
+ alignItems: 'center',
},
})
diff --git a/src/module/root/screens/on-boarding.screen.tsx b/src/module/root/screens/on-boarding.screen.tsx
index 91e7762..65af378 100644
--- a/src/module/root/screens/on-boarding.screen.tsx
+++ b/src/module/root/screens/on-boarding.screen.tsx
@@ -1,20 +1,11 @@
import React, { FC, useState } from 'react'
-import {
- Font,
- Header,
- RouteKey,
- ScreenLayout,
- Txt,
- colors,
- useNav,
-} from '../../common'
+import { Font, Header, ScreenLayout, Txt, colors } from '../../common'
import { StyleSheet, View } from 'react-native'
import { onBoardingConfig } from '../config'
import { DotsAtom, OnBoardingBottom } from '../atoms'
import { useTranslation } from 'react-i18next'
export const OnboardingScreen: FC = () => {
- const nav = useNav()
const { t } = useTranslation()
const [currentIndex, setCurrentIndex] = useState(0)
@@ -26,14 +17,6 @@ export const OnboardingScreen: FC = () => {
}
}
- const goBack = () => {
- if (currentIndex < 1) {
- nav.navigate(RouteKey.LanguageSelect)
- } else {
- setCurrentIndex(currentIndex - 1)
- }
- }
-
const Picture = onBoardingConfig[currentIndex].image
const isLastBlock = onBoardingConfig.length - 1 === currentIndex
diff --git a/src/module/settings/atoms/purchases.atom.tsx b/src/module/settings/atoms/purchases.atom.tsx
index 9d66fe0..8240a75 100644
--- a/src/module/settings/atoms/purchases.atom.tsx
+++ b/src/module/settings/atoms/purchases.atom.tsx
@@ -7,7 +7,6 @@ interface IProps {
title: string
price: string
iconName: string
- hasDiscount: boolean
isPurchased: boolean
onPress: () => void
}
@@ -15,25 +14,15 @@ interface IProps {
export const PurchaseAtom: FC = ({
title,
price,
- hasDiscount,
iconName,
isPurchased,
onPress,
}) => {
- const renderDiscountAtom = () => {
- return (
-
- -30%
-
- )
- }
-
return (
{title}
- {hasDiscount && renderDiscountAtom()}
{isPurchased ? (
{
key={it.productId}
title={t(it.name)}
price={it.price}
- hasDiscount={it.productId === ProductsEnum.All}
iconName={it.icon}
isPurchased={it.isPurchased}
onPress={() =>
it.isPurchased
- ? nav.navigate(RouteKey.Packages)
+ ? nav.navigate(UserRouteKey.Packages)
: purchaseProduct(it.productId)
}
/>
diff --git a/src/module/settings/screens/settings.screen.tsx b/src/module/settings/screens/settings.screen.tsx
index 6e0f821..58021a8 100644
--- a/src/module/settings/screens/settings.screen.tsx
+++ b/src/module/settings/screens/settings.screen.tsx
@@ -7,10 +7,12 @@ import {
EngSvg,
Header,
Language,
- RouteKey,
+ UserRouteKey,
ScreenLayout,
+ StorageKey,
UaSvg,
useNav,
+ storageService,
} from '../../common'
import { SheetManager } from 'react-native-actions-sheet'
@@ -43,8 +45,9 @@ export const SettingsScreen: FC = () => {
}
}
- const onChangeLanguage = (language: Language) => {
+ const onChangeLanguage = async (language: Language) => {
SheetManager.hide('bottom-sheet')
+ await storageService.set(StorageKey.Language, language)
return i18n.changeLanguage(language)
}
@@ -57,7 +60,7 @@ export const SettingsScreen: FC = () => {
const onPressSettingItem = (key: string) => {
switch (key) {
case 'purchases':
- nav.navigate(RouteKey.Purchases)
+ nav.navigate(UserRouteKey.Purchases)
break
case 'lang':
openBottomSheetForChangeLanguage()
@@ -65,10 +68,10 @@ export const SettingsScreen: FC = () => {
case 'notification':
break
case 'message':
- nav.navigate(RouteKey.WriteToUs)
+ nav.navigate(UserRouteKey.WriteToUs)
break
case 'privacy-policy':
- nav.navigate(RouteKey.PrivacyPolicy)
+ nav.navigate(UserRouteKey.PrivacyPolicy)
break
case 'rate':
break
diff --git a/src/module/settings/screens/write-to-us.screen.tsx b/src/module/settings/screens/write-to-us.screen.tsx
index fc78454..3db9c4d 100644
--- a/src/module/settings/screens/write-to-us.screen.tsx
+++ b/src/module/settings/screens/write-to-us.screen.tsx
@@ -24,8 +24,8 @@ export const WriteToUsScreen: FC = () => {
const onSendText = () => {
appEvents.emit('alert', {
- title: 'Aga, thanks',
- subtitle: 'We rozberemosya',
+ title: t('common.helpAlertTitle'),
+ subtitle: t('common.helpAlertDesc'),
onClose: () => nav.goBack(),
})
}
@@ -46,7 +46,7 @@ export const WriteToUsScreen: FC = () => {
style={styles.button}
disabled={!form.values.message}
onPress={() => form.onSubmit(onSendText)}>
- Send to us
+ {t('common.writeUsBtn')}
)
@@ -55,6 +55,6 @@ export const WriteToUsScreen: FC = () => {
const styles = StyleSheet.create({
button: {
marginTop: 20,
- backgroundColor: colors.lightPurple,
+ backgroundColor: colors.purple,
},
})
diff --git a/src/module/settings/services/purchases.service.ts b/src/module/settings/services/purchases.service.ts
index 442b0bd..062dcac 100644
--- a/src/module/settings/services/purchases.service.ts
+++ b/src/module/settings/services/purchases.service.ts
@@ -6,11 +6,10 @@ import {
purchaseUpdatedListener,
finishTransaction,
} from 'react-native-iap'
-import { ProductsEnum, StorageKey } from '../../common'
+import { ProductsEnum, StorageKey, storageService } from '../../common'
import { purchasesConfig } from '../config'
-import AsyncStorage from '@react-native-async-storage/async-storage'
-const ID_PRODUCTS = [ProductsEnum.All, ProductsEnum.Crazy, ProductsEnum.Under18]
+const ID_PRODUCTS = [ProductsEnum.Crazy]
interface ProductItem {
productId: ProductsEnum
@@ -70,16 +69,15 @@ export class PurchasesService {
private async savePurchase(productId: ProductsEnum) {
const newProductsId = [...this.purchasedProducts, productId]
- const newProducts = JSON.stringify(newProductsId)
this.purchasedProducts = newProductsId
- await AsyncStorage.setItem(StorageKey.Purchases, newProducts)
+ await storageService.set(StorageKey.Purchases, newProductsId)
}
private async getPurchasedProducts() {
- const response = await AsyncStorage.getItem(StorageKey.Purchases)
- this.purchasedProducts = response ? JSON.parse(response) : []
+ const response = await storageService.get(StorageKey.Purchases)
+ this.purchasedProducts = response ? response : []
}
private purchaseListener() {
diff --git a/src/store/slices/current-step-slice.tsx b/src/store/slices/current-step-slice.tsx
deleted file mode 100644
index 21077f4..0000000
--- a/src/store/slices/current-step-slice.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { createSlice } from '@reduxjs/toolkit'
-import { RootState } from '../store'
-
-interface CurrentStepState {
- step: number
-}
-
-const initialState: CurrentStepState = {
- step: 0,
-}
-
-export const CurrentStepSlice = createSlice({
- name: 'currentStep',
- initialState,
- reducers: {
- nextStep: state => {
- state.step = state.step + 1
- },
- resetSteps: state => {
- state.step = 0
- },
- },
-})
-
-export const { nextStep, resetSteps } = CurrentStepSlice.actions
-
-export const getStep = (state: RootState) => state.currentStep.step
-
-export default CurrentStepSlice.reducer
diff --git a/src/store/slices/current-step.slice.ts b/src/store/slices/current-step.slice.ts
new file mode 100644
index 0000000..4bf8d07
--- /dev/null
+++ b/src/store/slices/current-step.slice.ts
@@ -0,0 +1,56 @@
+import { PayloadAction, createSlice } from '@reduxjs/toolkit'
+import { RootState } from '../store'
+import { ChoiceType } from '~module/common'
+
+interface IStep {
+ stepTruth: number
+ stepDare: number
+}
+
+interface CurrentStepState {
+ step: IStep
+}
+
+const initialState: CurrentStepState = {
+ step: {
+ stepDare: 0,
+ stepTruth: 0,
+ },
+}
+
+export const CurrentStepSlice = createSlice({
+ name: 'currentStep',
+ initialState,
+ reducers: {
+ nextStep: (state, action: PayloadAction) => {
+ const isTruthStep = action.payload === ChoiceType.Truth
+
+ isTruthStep
+ ? (state.step.stepTruth = state.step.stepTruth + 1)
+ : (state.step.stepDare = state.step.stepDare + 1)
+ },
+ setStep: (state, action: PayloadAction) => {
+ state.step = action.payload
+ },
+ resetStepsByTruthOrDare: (state, action: PayloadAction) => {
+ const isResetForTruth = action.payload === ChoiceType.Truth
+
+ isResetForTruth
+ ? (state.step.stepTruth = 0)
+ : (state.step.stepDare = 0)
+ },
+ resetSteps: state => {
+ state.step = {
+ stepDare: 0,
+ stepTruth: 0,
+ }
+ },
+ },
+})
+
+export const { nextStep, resetStepsByTruthOrDare, setStep, resetSteps } =
+ CurrentStepSlice.actions
+
+export const selectStep = (state: RootState) => state.currentStep.step
+
+export default CurrentStepSlice.reducer
diff --git a/src/store/slices/custom-package.slice.ts b/src/store/slices/custom-package.slice.ts
index d543332..da739a9 100644
--- a/src/store/slices/custom-package.slice.ts
+++ b/src/store/slices/custom-package.slice.ts
@@ -1,43 +1,45 @@
import { PayloadAction, createAsyncThunk, createSlice } from '@reduxjs/toolkit'
-import { StorageKey, TypeCustom } from '../../module/common'
+import { StorageKey, CustomType, storageService } from '../../module/common'
import { RootState } from '../store'
import _ from 'lodash'
-import AsyncStorage from '@react-native-async-storage/async-storage'
interface ICustomPackage {
- [TypeCustom.Questions]: string[]
- [TypeCustom.Dares]: string[]
+ [CustomType.Questions]: string[]
+ [CustomType.Dares]: string[]
}
const defaultCustomPackage: ICustomPackage = {
- [TypeCustom.Questions]: [],
- [TypeCustom.Dares]: [],
+ [CustomType.Questions]: [],
+ [CustomType.Dares]: [],
}
export interface CustomPackageState {
customPackageFromStore: ICustomPackage
customPackage: ICustomPackage
- shuffleCustomPackage: ICustomPackage
- shuffled: ICustomPackage
- loaded: boolean
- hasError: boolean
+ shuffleCustom: ICustomPackage
}
const initialState: CustomPackageState = {
customPackage: defaultCustomPackage,
- shuffleCustomPackage: defaultCustomPackage,
customPackageFromStore: defaultCustomPackage,
- shuffled: defaultCustomPackage,
- loaded: false,
- hasError: false,
+ shuffleCustom: defaultCustomPackage,
}
export const getCustomPackage = createAsyncThunk(
'get-custom-package',
async () => {
- const response = await AsyncStorage.getItem(StorageKey.CustomPackage)
+ const customPackageFromStore = await storageService.get(
+ StorageKey.CustomPackage,
+ )
- return response ? JSON.parse(response) : defaultCustomPackage
+ const shuffleCustom = await storageService.get(
+ StorageKey.ShuffleCustomPackage,
+ )
+
+ const customPackage = customPackageFromStore || defaultCustomPackage
+ const customPackageShuffle = shuffleCustom || customPackage
+
+ return [customPackage, customPackageShuffle]
},
)
@@ -45,21 +47,43 @@ export const customPackageSlice = createSlice({
name: 'customPackage',
initialState,
reducers: {
- shuffleCustom: state => {
- const shuffleTruths = _.shuffle(state.customPackage.questions)
- const shuffleDares = _.shuffle(state.customPackage.dares)
+ shuffleCustomPackage: (
+ state,
+ action: PayloadAction<{
+ shuffleCustom: string[]
+ customType: CustomType
+ }>,
+ ) => {
+ const shuffleItems = action.payload.shuffleCustom
+ const customType = action.payload.customType
- state.shuffleCustomPackage = {
- dares: shuffleDares,
- questions: shuffleTruths,
- }
+ state.shuffleCustom[customType] = shuffleItems
},
- setQuestions: (state, action: PayloadAction) => {
- const updateCustomPackage = {
- ...state.customPackage,
- questions: action.payload,
- }
- state.customPackage = updateCustomPackage
+ addCustomItem: (
+ state,
+ action: PayloadAction<{ customType: CustomType; value: string }>,
+ ) => {
+ const customType = action.payload.customType
+ const newGameItem = action.payload.value
+
+ const newGameItems = [
+ ...state.customPackage[customType],
+ newGameItem,
+ ]
+
+ state.customPackage[customType] = newGameItems
+ },
+ deleteCustomItem: (
+ state,
+ action: PayloadAction<{ customType: CustomType; id: number }>,
+ ) => {
+ const customType = action.payload.customType
+ const id = action.payload.id
+
+ const newCustomItems = state.customPackage[customType].filter(
+ (it, index) => index !== id,
+ )
+ state.customPackage[customType] = newCustomItems
},
setDares: (state, action: PayloadAction) => {
const updateCustomPackage = {
@@ -79,37 +103,27 @@ export const customPackageSlice = createSlice({
},
},
extraReducers(builder) {
- builder
- .addCase(getCustomPackage.fulfilled, (state, action) => {
- state.customPackage = action.payload
- state.customPackageFromStore = action.payload
- state.hasError = false
- state.loaded = true
- })
- .addCase(getCustomPackage.pending, state => {
- state.loaded = false
- })
- .addCase(getCustomPackage.rejected, state => {
- state.hasError = true
- })
+ builder.addCase(getCustomPackage.fulfilled, (state, action) => {
+ state.customPackage = action.payload[0]
+ state.customPackageFromStore = action.payload[0]
+ state.shuffleCustom = action.payload[1]
+ })
},
})
export const {
- setQuestions,
- setDares,
+ deleteCustomItem,
+ addCustomItem,
updateCustomPackageFromStore,
updateCustomPackage,
- shuffleCustom,
+ shuffleCustomPackage,
} = customPackageSlice.actions
export const selectCustomPackage = (state: RootState) =>
state.customPackage.customPackage
+export const selectShuffleCustomPackage = (state: RootState) =>
+ state.customPackage.shuffleCustom
export const selectCustomPackageFromStore = (state: RootState) =>
state.customPackage.customPackageFromStore
-export const selectCustomLoaded = (state: RootState) =>
- state.customPackage.loaded
-export const selectShuffledCustom = (state: RootState) =>
- state.customPackage.shuffleCustomPackage
export default customPackageSlice.reducer
diff --git a/src/store/slices/game-items.slice.ts b/src/store/slices/game-items.slice.ts
new file mode 100644
index 0000000..99c8bf4
--- /dev/null
+++ b/src/store/slices/game-items.slice.ts
@@ -0,0 +1,74 @@
+import { PayloadAction, createAsyncThunk, createSlice } from '@reduxjs/toolkit'
+import firestore from '@react-native-firebase/firestore'
+import { GameItem, PackageType } from '../../module/common'
+import { RootState } from '../store'
+import _ from 'lodash'
+
+export interface GameItemsState {
+ [PackageType.Under18]: GameItem[]
+ [PackageType.Light]: GameItem[]
+ [PackageType.Crazy]: GameItem[]
+ [PackageType.Custom]: GameItem[]
+ loaded: boolean
+ hasError: boolean
+}
+
+const initialState: GameItemsState = {
+ under18: [],
+ light: [],
+ crazy: [],
+ custom: [],
+ loaded: false,
+ hasError: false,
+}
+
+export const getGameItemsFromFirestore = createAsyncThunk(
+ 'game-items/get-from-firestore',
+ async () => {
+ const jsonResponse = await firestore().collection('content').get()
+ const data = jsonResponse.docs.map(it => it.data())
+
+ const allPackages = data.reduce((acc, it) => {
+ const packageKey = _.keys(it)[0]
+ acc[packageKey] = it[packageKey]
+ return acc
+ }, {})
+
+ return allPackages
+ },
+)
+
+export const gameItemsSlice = createSlice({
+ name: 'gameItems',
+ initialState,
+ reducers: {
+ shufflePackage: (state, action: PayloadAction) => {
+ const packageType = action.payload
+ state[packageType] = _.shuffle(state[packageType])
+ },
+ },
+ extraReducers(builder) {
+ builder
+ .addCase(getGameItemsFromFirestore.fulfilled, (state, action) => {
+ const allPackages = action.payload
+ state.under18 = allPackages[PackageType.Under18]
+ state.light = allPackages[PackageType.Light]
+ state.crazy = allPackages[PackageType.Crazy]
+ state.hasError = false
+ state.loaded = true
+ })
+ .addCase(getGameItemsFromFirestore.pending, state => {
+ state.loaded = false
+ })
+ .addCase(getGameItemsFromFirestore.rejected, state => {
+ state.hasError = true
+ })
+ },
+})
+
+export const { shufflePackage } = gameItemsSlice.actions
+
+export const selectPackage = (state: RootState, packageType: PackageType) =>
+ state.gameItems[packageType]
+
+export default gameItemsSlice.reducer
diff --git a/src/store/slices/index.ts b/src/store/slices/index.ts
index 34b2497..a2ce801 100644
--- a/src/store/slices/index.ts
+++ b/src/store/slices/index.ts
@@ -1,3 +1,5 @@
-export * from './current-step-slice'
-export * from './posts.slice'
-export * from './custom-package.slice';
+export * from './current-step.slice'
+export * from './game-items.slice'
+export * from './custom-package.slice'
+export * from './navigation.slice'
+export * from './players.slice'
diff --git a/src/store/slices/navigation.slice.ts b/src/store/slices/navigation.slice.ts
new file mode 100644
index 0000000..724c569
--- /dev/null
+++ b/src/store/slices/navigation.slice.ts
@@ -0,0 +1,27 @@
+import { PayloadAction, createSlice } from '@reduxjs/toolkit'
+import { RootState } from '../store'
+import { NavGroup } from '~module/common'
+
+interface NavGroupState {
+ navGroup: NavGroup
+}
+
+const initialState: NavGroupState = {
+ navGroup: NavGroup.Guest,
+}
+
+export const NavGroupSlice = createSlice({
+ name: 'navGroup',
+ initialState,
+ reducers: {
+ setNavGroup: (state, action: PayloadAction) => {
+ state.navGroup = action.payload
+ },
+ },
+})
+
+export const { setNavGroup } = NavGroupSlice.actions
+
+export const selectNavGroup = (state: RootState) => state.navGroup.navGroup
+
+export default NavGroupSlice.reducer
diff --git a/src/store/slices/players.slice.ts b/src/store/slices/players.slice.ts
new file mode 100644
index 0000000..0b51e48
--- /dev/null
+++ b/src/store/slices/players.slice.ts
@@ -0,0 +1,70 @@
+import { PayloadAction, createAsyncThunk, createSlice } from '@reduxjs/toolkit'
+import { StorageKey, storageService } from '../../module/common'
+import { RootState } from '../store'
+import _ from 'lodash'
+
+export interface PlayersState {
+ players: string[]
+ playerIndex: number
+ currentPlayer: string
+ loaded: boolean
+ hasError: boolean
+}
+
+const initialState: PlayersState = {
+ players: [],
+ playerIndex: 0,
+ currentPlayer: '',
+ loaded: false,
+ hasError: false,
+}
+
+export const getPlayersAsync = createAsyncThunk('get-players', async () => {
+ const savedPlayers = await storageService.get(StorageKey.Players)
+
+ return savedPlayers ? savedPlayers : ['']
+})
+
+export const playersSlice = createSlice({
+ name: 'players',
+ initialState,
+ reducers: {
+ setPlayers: (state, action: PayloadAction) => {
+ state.players = action.payload
+ state.currentPlayer = action.payload[0]
+ },
+ onNextPlayer: state => {
+ state.playerIndex = state.playerIndex + 1
+ const player = state.players[state.playerIndex]
+
+ if (!player) {
+ state.currentPlayer = state.players[0]
+ state.playerIndex = 0
+ return
+ }
+
+ state.currentPlayer = player
+ },
+ },
+ extraReducers(builder) {
+ builder
+ .addCase(getPlayersAsync.fulfilled, (state, action) => {
+ state.players = action.payload
+ state.currentPlayer = state.players[0]
+ })
+ .addCase(getPlayersAsync.pending, state => {
+ state.loaded = false
+ })
+ .addCase(getPlayersAsync.rejected, state => {
+ state.hasError = true
+ })
+ },
+})
+
+export const { setPlayers, onNextPlayer } = playersSlice.actions
+
+export const selectPlayers = (state: RootState) => state.players.players
+export const selectCurrentPlayer = (state: RootState) =>
+ state.players.currentPlayer
+
+export default playersSlice.reducer
diff --git a/src/store/slices/posts.slice.ts b/src/store/slices/posts.slice.ts
deleted file mode 100644
index 3528592..0000000
--- a/src/store/slices/posts.slice.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'
-import firestore from '@react-native-firebase/firestore'
-import { GameItem } from '../../module/common'
-import { RootState } from '../store'
-import _ from 'lodash'
-
-export interface PostsState {
- posts: GameItem[]
- shuffled: GameItem[]
- loaded: boolean
- hasError: boolean
-}
-
-const initialState: PostsState = {
- posts: [],
- shuffled: [],
- loaded: false,
- hasError: false,
-}
-
-export const fetchPostsAsync = createAsyncThunk(
- 'posts/fetchPosts',
- async () => {
- const querySnapshot = await firestore().collection('GameItems').get()
-
- const data: GameItem[] = querySnapshot.docs.map(
- doc => doc.data() as GameItem,
- )
-
- return data
- },
-)
-
-export const postsSlice = createSlice({
- name: 'posts',
- initialState,
- reducers: {
- shuffleItems: state => {
- state.shuffled = _.shuffle(state.posts)
- },
- },
- extraReducers(builder) {
- builder
- .addCase(fetchPostsAsync.fulfilled, (state, action) => {
- state.posts = action.payload
- state.hasError = false
- state.loaded = true
- })
- .addCase(fetchPostsAsync.pending, state => {
- state.loaded = false
- })
- .addCase(fetchPostsAsync.rejected, state => {
- state.hasError = true
- })
- },
-})
-
-export const { shuffleItems } = postsSlice.actions
-
-export const selectPosts = (state: RootState) => state.gameItems.posts
-export const selectHasError = (state: RootState) => state.gameItems.hasError
-export const selectLoaded = (state: RootState) => state.gameItems.loaded
-export const selectShuffled = (state: RootState) => state.gameItems.shuffled
-
-export default postsSlice.reducer
diff --git a/src/store/store.ts b/src/store/store.ts
index 686aba5..585ece9 100644
--- a/src/store/store.ts
+++ b/src/store/store.ts
@@ -1,13 +1,17 @@
-import { Action, configureStore, ThunkAction } from '@reduxjs/toolkit'
-import currentStepSlice from './slices/current-step-slice'
-import postsSlice from './slices/posts.slice'
+import { configureStore } from '@reduxjs/toolkit'
+import currentStep from './slices/current-step.slice'
+import gameItems from './slices/game-items.slice'
import customPackage from './slices/custom-package.slice'
+import navGroup from './slices/navigation.slice'
+import players from './slices/players.slice'
export const store = configureStore({
reducer: {
- currentStep: currentStepSlice,
- gameItems: postsSlice,
+ currentStep,
+ gameItems,
customPackage,
+ navGroup,
+ players,
},
})