Vitalik
2 years ago
67 changed files with 2473 additions and 307 deletions
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage' |
||||
import Reactotron from 'reactotron-react-native' |
||||
|
||||
Reactotron |
||||
.setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from
|
||||
.configure() // controls connection & communication settings
|
||||
.useReactNative() // add all built-in react native plugins
|
||||
.connect() // let's connect!
|
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
{ |
||||
"project_info": { |
||||
"project_number": "180425292880", |
||||
"firebase_url": "https://truthordare-6493e-default-rtdb.europe-west1.firebasedatabase.app", |
||||
"project_id": "truthordare-6493e", |
||||
"storage_bucket": "truthordare-6493e.appspot.com" |
||||
}, |
||||
"client": [ |
||||
{ |
||||
"client_info": { |
||||
"mobilesdk_app_id": "1:180425292880:android:8690e5274abb413c7da555", |
||||
"android_client_info": { |
||||
"package_name": "com.truth" |
||||
} |
||||
}, |
||||
"oauth_client": [ |
||||
{ |
||||
"client_id": "180425292880-1pfj1drhgqc9j19jit1ahfu7jouodjej.apps.googleusercontent.com", |
||||
"client_type": 3 |
||||
} |
||||
], |
||||
"api_key": [ |
||||
{ |
||||
"current_key": "AIzaSyBXoidUFjbE84RZ8PqIP0IGAsTYU28PEO8" |
||||
} |
||||
], |
||||
"services": { |
||||
"appinvite_service": { |
||||
"other_platform_oauth_client": [ |
||||
{ |
||||
"client_id": "180425292880-1pfj1drhgqc9j19jit1ahfu7jouodjej.apps.googleusercontent.com", |
||||
"client_type": 3 |
||||
}, |
||||
{ |
||||
"client_id": "180425292880-bfueoq3p0oq0b0lf2qviebio2q338eu8.apps.googleusercontent.com", |
||||
"client_type": 2, |
||||
"ios_info": { |
||||
"bundle_id": "org.reactjs.native.example.Truth" |
||||
} |
||||
} |
||||
] |
||||
} |
||||
} |
||||
} |
||||
], |
||||
"configuration_version": "1" |
||||
} |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CLIENT_ID</key> |
||||
<string>180425292880-bfueoq3p0oq0b0lf2qviebio2q338eu8.apps.googleusercontent.com</string> |
||||
<key>REVERSED_CLIENT_ID</key> |
||||
<string>com.googleusercontent.apps.180425292880-bfueoq3p0oq0b0lf2qviebio2q338eu8</string> |
||||
<key>API_KEY</key> |
||||
<string>AIzaSyDsJWXu0NtusG6fric25R8zN-j-LSHd_tg</string> |
||||
<key>GCM_SENDER_ID</key> |
||||
<string>180425292880</string> |
||||
<key>PLIST_VERSION</key> |
||||
<string>1</string> |
||||
<key>BUNDLE_ID</key> |
||||
<string>org.reactjs.native.example.Truth</string> |
||||
<key>PROJECT_ID</key> |
||||
<string>truthordare-6493e</string> |
||||
<key>STORAGE_BUCKET</key> |
||||
<string>truthordare-6493e.appspot.com</string> |
||||
<key>IS_ADS_ENABLED</key> |
||||
<false></false> |
||||
<key>IS_ANALYTICS_ENABLED</key> |
||||
<false></false> |
||||
<key>IS_APPINVITE_ENABLED</key> |
||||
<true></true> |
||||
<key>IS_GCM_ENABLED</key> |
||||
<true></true> |
||||
<key>IS_SIGNIN_ENABLED</key> |
||||
<true></true> |
||||
<key>GOOGLE_APP_ID</key> |
||||
<string>1:180425292880:ios:7109aea721588b757da555</string> |
||||
<key>DATABASE_URL</key> |
||||
<string>https://truthordare-6493e-default-rtdb.europe-west1.firebasedatabase.app</string> |
||||
</dict> |
||||
</plist> |
File diff suppressed because one or more lines are too long
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<Workspace |
||||
version = "1.0"> |
||||
<FileRef |
||||
location = "group:Truth.xcodeproj"> |
||||
</FileRef> |
||||
<FileRef |
||||
location = "group:Pods/Pods.xcodeproj"> |
||||
</FileRef> |
||||
</Workspace> |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>IDEDidComputeMac32BitWarning</key> |
||||
<true/> |
||||
</dict> |
||||
</plist> |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<Workspace |
||||
version = "1.0"> |
||||
<FileRef |
||||
location = "group:Truth.xcodeproj"> |
||||
</FileRef> |
||||
<FileRef |
||||
location = "group:Pods/Pods.xcodeproj"> |
||||
</FileRef> |
||||
</Workspace> |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
export const customPack = { |
||||
title: 'Create custom pack', |
||||
description: 'Create your own custom pack with questions and task. It all depends on your imagination!', |
||||
} |
@ -1,7 +1,13 @@
@@ -1,7 +1,13 @@
|
||||
import {MainLocaleModule} from '../../types'; |
||||
import {settingTranslation} from './settings.translation'; |
||||
import {onBoardingTranslation} from './steps.translation'; |
||||
import {buttonsTranslation} from './onBoardingButton.translation'; |
||||
import {customPack} from './custom-pack.translation'; |
||||
import {pageTitles} from './page-title.translation'; |
||||
export const en: MainLocaleModule = { |
||||
settingTranslation, |
||||
stepTranslation: onBoardingTranslation, |
||||
buttonsTranslation, |
||||
customPack, |
||||
pageTitles, |
||||
}; |
||||
|
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
export const buttonsTranslation = { |
||||
skip: 'Skip', |
||||
priceButton: 'Open now / $4.99', |
||||
later: 'Later', |
||||
truth: '-TRUTH-', |
||||
random: 'RANDOM CHANCE', |
||||
dare: '-DARE-', |
||||
} |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
export const pageTitles = { |
||||
setting: 'Setting', |
||||
privacy: 'Privacy Policy', |
||||
terms: 'Terms and conditions', |
||||
} |
@ -1,7 +1,14 @@
@@ -1,7 +1,14 @@
|
||||
import {MainLocaleModule} from '../../types'; |
||||
import {settingTranslation} from './settings.translation'; |
||||
import {onBoardingTranslation} from './steps.translation'; |
||||
import { buttonsTranslation } from './onBoardingButton.translation'; |
||||
import {customPack} from './custom-pack.translation'; |
||||
import {pageTitles} from './page-title.translation'; |
||||
|
||||
export const hi: MainLocaleModule = { |
||||
settingTranslation, |
||||
stepTranslation: onBoardingTranslation, |
||||
buttonsTranslation, |
||||
customPack, |
||||
pageTitles, |
||||
}; |
||||
|
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
export const customPack = { |
||||
title: 'Створіть індивідуальний пакет', |
||||
description: 'Створіть свій власний пакет із запитаннями та завданнями. Все залежить від вашої фантазії!', |
||||
} |
@ -1,8 +1,15 @@
@@ -1,8 +1,15 @@
|
||||
import {MainLocaleModule} from '../../types'; |
||||
import {settingTranslation} from './settings.translation'; |
||||
import {onBoardingTranslationUa} from './step.translation'; |
||||
import { buttonsTranslation } from './onBoardingButton.translation'; |
||||
import {customPack} from './custom-pack.translation'; |
||||
import {pageTitles} from './page-title.translation'; |
||||
|
||||
|
||||
export const ua: MainLocaleModule = { |
||||
stepTranslation: onBoardingTranslationUa, |
||||
settingTranslation: settingTranslation, |
||||
}; |
||||
buttonsTranslation, |
||||
customPack, |
||||
pageTitles |
||||
}; |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
export const buttonsTranslation = { |
||||
skip: 'Далі', |
||||
priceButton: 'Придбати за / $4.99', |
||||
later: 'Пізніше', |
||||
truth: '-ПРАВДА-', |
||||
random: 'ВИПАДКОВО', |
||||
dare: '-ДІЯ-', |
||||
} |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
export const pageTitles = { |
||||
setting: 'Налаштування', |
||||
privacy: 'Політика \n конфіденційності', |
||||
terms: 'Правила та умови', |
||||
} |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
export interface Buttons { |
||||
skip: string, |
||||
priceButton: string, |
||||
later: string, |
||||
truth: string, |
||||
random: string, |
||||
dare: string, |
||||
} |
@ -1,6 +1,12 @@
@@ -1,6 +1,12 @@
|
||||
import { CustomPack } from '../../module/shared/interfaces/custom-pack'; |
||||
import { PageTitles } from '../../module/shared/interfaces/page-titles'; |
||||
import { Buttons } from './buttons.types'; |
||||
import {OnBoardingLocale} from './on-boarding.types'; |
||||
import {SettingLocale} from './settings.types'; |
||||
export interface MainLocaleModule { |
||||
stepTranslation: OnBoardingLocale.OnboardingSteps; |
||||
settingTranslation: SettingLocale.Core; |
||||
buttonsTranslation: Buttons; |
||||
customPack: CustomPack; |
||||
pageTitles: PageTitles; |
||||
} |
||||
|
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
import React from 'react'; |
||||
import { useTranslation } from 'react-i18next'; |
||||
import {View} from 'react-native'; |
||||
import { |
||||
colors, |
||||
Header, |
||||
IRouteParams, |
||||
RouteKey, |
||||
ScreenLayout, |
||||
} from '../../shared'; |
||||
import { MainTextContainer } from '../../shared/components/text-containers/main-text-container'; |
||||
import { privacy } from '../config/privacy-texts'; |
||||
|
||||
interface IProps extends IRouteParams {} |
||||
export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => { |
||||
const goBack = () => { |
||||
navigation.navigate(RouteKey.Setting, { |
||||
previous_screen: RouteKey.Game, |
||||
}); |
||||
}; |
||||
|
||||
const {t, i18n} = useTranslation(); |
||||
|
||||
const lang = i18n.language; |
||||
|
||||
return ( |
||||
<ScreenLayout |
||||
backgroundColor={colors.primaryColor} |
||||
backgroundStatusBar={colors.primaryColor} |
||||
paddingHorizontal={20} |
||||
headerComponent={ |
||||
<Header |
||||
leftIcon="arrow" |
||||
title={t('pageTitles.privacy')} |
||||
onPressLeft={() => navigation.goBack()} |
||||
rightIcon="none" |
||||
/> |
||||
}> |
||||
<MainTextContainer text={privacy[lang as keyof typeof privacy]}/> |
||||
</ScreenLayout> |
||||
); |
||||
}; |
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit'; |
||||
import {GameItem} from '../../shared/interfaces/game-item'; |
||||
import firestore from '@react-native-firebase/firestore'; |
||||
import {RootState} from '../../../store/store'; |
||||
import { shuffle } from '../shuffle/shuffle'; |
||||
|
||||
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 data = [] as GameItem[]; |
||||
let querySnapshot = await firestore().collection('GameItems').get(); |
||||
querySnapshot.forEach(doc => { |
||||
const item = doc.data(); |
||||
data.push(item 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; |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
import {StyleSheet, Text, View} from 'react-native'; |
||||
import React from 'react'; |
||||
import { colors } from '../../colors'; |
||||
import { ScrollView } from 'react-native-gesture-handler'; |
||||
|
||||
interface IProps { |
||||
text: string |
||||
} |
||||
|
||||
export const MainTextContainer: React.FC<IProps> = ({text}) => { |
||||
return ( |
||||
<View style={styles.container}> |
||||
<ScrollView contentContainerStyle={{paddingBottom: 0}}> |
||||
<Text style={styles.description}> |
||||
{text} |
||||
</Text> |
||||
</ScrollView> |
||||
</View> |
||||
); |
||||
}; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
backgroundColor: colors.darkPurple, |
||||
borderRadius: 20, |
||||
paddingVertical: 32, |
||||
paddingHorizontal: 20, |
||||
maxHeight: '80%' |
||||
}, |
||||
description: { |
||||
lineHeight: 32, |
||||
fontSize: 22, |
||||
color: colors.purple, |
||||
textAlign: 'auto' |
||||
} |
||||
}); |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
export interface CustomPack { |
||||
title: string; |
||||
description: string; |
||||
} |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
export interface GameItem { |
||||
id: number; |
||||
isDare: boolean; |
||||
en: string; |
||||
ua: string; |
||||
hi: string; |
||||
} |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
export interface PageTitles { |
||||
setting: string, |
||||
privacy: string, |
||||
terms: string, |
||||
} |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
export const TermsText = |
||||
'You agree to use our application for legitimate purposes and not for any illegal or unauthorized purpose, including without limitation, in violation of any intellectual property or privacy law. By agreeing to the Terms, you represent and warrant that you are at least the age of majority in your state or province of residence and are legally capable of entering into a binding contract.'; |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
import React from 'react'; |
||||
import { useTranslation } from 'react-i18next'; |
||||
import {View} from 'react-native'; |
||||
import { |
||||
colors, |
||||
Header, |
||||
IRouteParams, |
||||
RouteKey, |
||||
ScreenLayout, |
||||
} from '../../shared'; |
||||
import { MainTextContainer } from '../../shared/components/text-containers/main-text-container'; |
||||
import { TermsText } from '../config/terms-text'; |
||||
import { terms } from '../config/use-of-terms.translations'; |
||||
|
||||
interface IProps extends IRouteParams {} |
||||
export const UseOfTerms: React.FC<IProps> = ({navigation}) => { |
||||
// const goBack = () => {
|
||||
// navigation.navigate(RouteKey.Setting, {
|
||||
// previous_screen: RouteKey.Game,
|
||||
// });
|
||||
// };
|
||||
|
||||
const {t, i18n} = useTranslation(); |
||||
|
||||
const lang = i18n.language; |
||||
|
||||
return ( |
||||
<ScreenLayout |
||||
backgroundColor={colors.primaryColor} |
||||
backgroundStatusBar={colors.primaryColor} |
||||
paddingHorizontal={20} |
||||
headerComponent={ |
||||
<Header |
||||
leftIcon="arrow" |
||||
title={t('pageTitles.terms')} |
||||
onPressLeft={() => navigation.goBack()} |
||||
rightIcon="none" |
||||
/> |
||||
}> |
||||
<MainTextContainer text={terms[lang as keyof typeof terms]}/> |
||||
</ScreenLayout> |
||||
); |
||||
}; |
Loading…
Reference in new issue