Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub link to Cookie Policy screen #18

Merged
merged 1 commit into from
Feb 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export default function App() {
<CustomStatusBar isRequestingPermissions={isRequestingPermissions} />
{
isRequestingPermissions
? <CookiePolicy setPromptForPermissions={setPromptForPermissions}/>
? <CookiePolicy
promptForPermissions={promptForPermissions}
setPromptForPermissions={setPromptForPermissions}
/>
: <WebView
allowsBackForwardNavigationGestures
cacheEnabled={didPermissionsChange}
Expand Down
43 changes: 27 additions & 16 deletions client/components/CookiePolicy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Constants from 'expo-constants';
import * as Linking from 'expo-linking';
import React from 'react';
import {
Image,
Expand All @@ -7,13 +8,15 @@ import {
ScrollView,
StyleSheet,
Text,
View,
} from 'react-native';

type Props = {
promptForPermissions: boolean;
setPromptForPermissions: React.Dispatch<React.SetStateAction<boolean>>;
}

export default function CookiePolicy({ setPromptForPermissions }: Props) {
export default function CookiePolicy({ promptForPermissions, setPromptForPermissions }: Props) {
return (
<ScrollView style={styles.container}>
<Image
Expand All @@ -22,11 +25,7 @@ export default function CookiePolicy({ setPromptForPermissions }: Props) {
/>
<Text
style={styles.text}>
{"\n"}
{"\n"}
{"\n"}
{"\n"}
{"\n"}
{promptForPermissions && "\n \n \n \n \n \n \n \n"}
Resonate only uses cookies to guarantee core functionalities, such as keeping you logged in for a while, or remembering your theme settings. No other type of activity is tracked.
{"\n"}
</Text>
Expand All @@ -42,14 +41,25 @@ export default function CookiePolicy({ setPromptForPermissions }: Props) {
</Text>
</>
)}
<Pressable
style={styles.button}
onPress={() => setPromptForPermissions(true)}>
<Text
style={[styles.boldText, styles.text]}>
Continue
</Text>
</Pressable>
{!promptForPermissions &&
<>
<Text
style={{ ...styles.linkText, ...styles.text }}
onPress={() => Linking.openURL('https://github.com/resonatecoop')}>
{"\n"}
View Resonate's Open Source Code on GitHub.com (External Link)
{"\n"}
</Text>
<Pressable
style={styles.button}
onPress={() => setPromptForPermissions(true)}>
<Text
style={[styles.boldText, styles.text]}>
Continue
</Text>
</Pressable>
</>
}
</ScrollView>
)
}
Expand Down Expand Up @@ -78,13 +88,14 @@ const styles = StyleSheet.create({
marginTop: Constants.statusBarHeight,
marginHorizontal: '10%',
},
link: {
fontSize: 24,
linkText: {
textDecorationLine: 'underline',
},
image: {
height: 360,
marginHorizontal: '10%',
marginTop: -80,
marginBottom: -10,
width: '80%',
},
text: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@react-native-async-storage/async-storage": "~1.15.0",
"expo": "~44.0.0",
"expo-linking": "~3.0.0",
"expo-system-ui": "~1.1.0",
"expo-tracking-transparency": "~2.1.0",
"expo-updates": "~0.11.6",
Expand Down
31 changes: 31 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2477,6 +2477,16 @@ expo-keep-awake@~10.0.1:
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-10.0.1.tgz#9f1176216c41eee20843c8232acfdca2bc32d334"
integrity sha512-kcBtoDGkm3RRe6BpKDvR7gof/ErajEia38u92pRvNRctdh+p8AFO7GQuiipyg3iMfhcCFVTCIV7h3tuA0g/yDw==

expo-linking@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/expo-linking/-/expo-linking-3.0.0.tgz#67f06b0be4ac1da911c46535a704d24eca34e344"
integrity sha512-TgRB4JTdhMRo79rTu9E9zwzWyBUJxHpSbHFlv0ZfMAwU+qFCsL9zZsL44R/yj7xrvcLOjqbCVmBszLQ0pFOt1g==
dependencies:
expo-constants "~13.0.0"
invariant "^2.2.4"
qs "^6.9.1"
url-parse "^1.4.4"

expo-manifests@~0.2.2:
version "0.2.4"
resolved "https://registry.yarnpkg.com/expo-manifests/-/expo-manifests-0.2.4.tgz#28aa7a0b21d8b932e1a49c836cfc31b5a9cd1f9c"
Expand Down Expand Up @@ -4092,6 +4102,11 @@ object-copy@^0.1.0:
define-property "^0.2.5"
kind-of "^3.0.3"

object-inspect@^1.9.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0"
integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==

object-keys@^1.0.12, object-keys@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
Expand Down Expand Up @@ -4375,6 +4390,13 @@ pump@^3.0.0:
end-of-stream "^1.1.0"
once "^1.3.1"

qs@^6.9.1:
version "6.10.3"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e"
integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==
dependencies:
side-channel "^1.0.4"

query-string@^5.0.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb"
Expand Down Expand Up @@ -4872,6 +4894,15 @@ shelljs@^0.8.4:
interpret "^1.0.0"
rechoir "^0.6.2"

side-channel@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf"
integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==
dependencies:
call-bind "^1.0.0"
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"

signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.6"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af"
Expand Down