From 5ff7af78f8996189026f4e5d35ac434a4f98dafb Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Mon, 8 Jul 2024 21:17:50 +0200 Subject: [PATCH] Closes #11 Why the weird import order? Because it was the only way to make the linter happy --- env-example | 1 + src/components/PrivacyButton.tsx | 27 +++++++++++++++++++++++++++ src/modules/membership/Membership.tsx | 15 +++++++++++++-- src/modules/register/UserRegister.tsx | 2 ++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/components/PrivacyButton.tsx diff --git a/env-example b/env-example index 55f8f9e..a3050a8 100644 --- a/env-example +++ b/env-example @@ -1,5 +1,6 @@ EXPO_PUBLIC_EVENT_API_URL=https://studentersamfundet.no EXPO_PUBLIC_DUSKEN_API_URL=https://galtinn.neuf.no EXPO_PUBLIC_DUSKEN_FORGOT_PASSWORD_URL=https://galtinn.neuf.no/auth/password_reset/ +EXPO_PUBLIC_DUSKEN_PRIVACY_POLICY_URL=https://galtinn.neuf.no/nb/personvern/ EXPO_PUBLIC_SENTRY_DSN= EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY= diff --git a/src/components/PrivacyButton.tsx b/src/components/PrivacyButton.tsx new file mode 100644 index 0000000..d2e2f8e --- /dev/null +++ b/src/components/PrivacyButton.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import { Linking, StyleSheet, Text, TouchableOpacity } from 'react-native'; + +import theme from 'src/theme'; + +const PrivacyButton = () => ( + Linking.openURL(process.env.EXPO_PUBLIC_DUSKEN_PRIVACY_POLICY_URL)} + > + Personvern + +); + +const styles = StyleSheet.create({ + button: { + margin: 16, + }, + linkText: { + color: theme.colors.neufBlue, + fontSize: 16, + textAlign: 'center', + textDecorationLine: 'underline', + }, +}); + +export default PrivacyButton; diff --git a/src/modules/membership/Membership.tsx b/src/modules/membership/Membership.tsx index 2851941..accd3ef 100644 --- a/src/modules/membership/Membership.tsx +++ b/src/modules/membership/Membership.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { View, StyleSheet, ActivityIndicator } from 'react-native'; +import PrivacyButton from 'src/components/PrivacyButton'; import theme from 'src/theme'; import MembershipInfo from './MembershipInfo'; @@ -20,10 +21,20 @@ const Membership = () => { } if (isAuthenticated) { - return ; + return ( + <> + + + + ); } - return ; + return ( + <> + + + + ); }; export default Membership; diff --git a/src/modules/register/UserRegister.tsx b/src/modules/register/UserRegister.tsx index bb28850..2d35fc7 100644 --- a/src/modules/register/UserRegister.tsx +++ b/src/modules/register/UserRegister.tsx @@ -5,6 +5,7 @@ import { Button, Incubator } from 'react-native-ui-lib'; import FormErrors from 'src/components/FormErrors'; import FormInput from 'src/components/FormInput'; +import PrivacyButton from 'src/components/PrivacyButton'; import theme from 'src/theme'; import useUserRegister from './useUserRegister'; @@ -58,6 +59,7 @@ const UserRegister = () => { Registrer meg {isRegisteringUser && } +