Skip to content
Open
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
9 changes: 9 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
"useFrameworks": "static"
}
}
],
[
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This values should be added to .env

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally we could hide facebook button when developer will not pass this values, what do you think?

"react-native-fbsdk-next",
{
"appID": "974812100702878",
"clientToken": "434baaffa008eb537185c49ff516e3a8",
"displayName": "BACA",
"scheme": "fb974812100702878"
}
]
],
"web": {
Expand Down
4 changes: 2 additions & 2 deletions app/(app)/(common)/privacy-policy.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { BlogScreen } from '@baca/screens/BlogScreen'
import { PrivacyPolicyScreen } from '@baca/screens'

export default BlogScreen
export default PrivacyPolicyScreen
2 changes: 1 addition & 1 deletion docs/src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const FeatureList: FeatureItem[] = [
title: 'Powered by React Native and Expo',
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
description: (
<>We are using the newest tools to acheive the best performance and developer experience.</>
<>We are using the newest tools to achieve the best performance and developer experience.</>
),
},
]
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@
"react-dom": "18.2.0",
"react-hook-form": "^7.49.3",
"react-i18next": "^14.0.1",
"react-native": "0.73.5",
"react-native": "0.73.6",
"react-native-fbsdk-next": "^12.1.4",
"react-native-gesture-handler": "~2.14.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-notificated": "^0.0.1-beta.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { useAuthFacebookControllerLogin } from '@baca/api/query/auth-social/auth-social'
import { isExpoGo, isWeb } from '@baca/constants'
import { assignPushToken, setToken } from '@baca/services'
import { isSignedInAtom, store } from '@baca/store'

import { SocialButton } from '../SocialButton'

export const NativeFacebookButton = () => {
const { mutate: loginWithFacebook } = useAuthFacebookControllerLogin()

if (isExpoGo || isWeb) return null

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { AccessToken, LoginManager } = require('react-native-fbsdk-next')

const handleLogin = async () => {
await LoginManager.logInWithPermissions(['email', 'public_profile'], 'enabled')

const { accessToken } = (await AccessToken.getCurrentAccessToken()) || {}

accessToken &&
loginWithFacebook(
{ data: { accessToken } },
{
onSuccess: async (response) => {
const { user, ...token } = response
if (token) {
await setToken(token)
}
store.set(isSignedInAtom, true)

// Send push token to backend
await assignPushToken()
},
}
)
}

// eslint-disable-next-line react/jsx-no-bind
return <SocialButton type="facebook" onPress={handleLogin} />
}
10 changes: 10 additions & 0 deletions src/components/molecules/SocialButtons/FacebookButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { isExpoGo, isWeb } from '@baca/constants'

import { NativeFacebookButton } from './NativeFacebookButton'

export const FacebookButton = () => {
//TODO: Add facebook button for web
if (isExpoGo || isWeb) return null

return <NativeFacebookButton />
}
1 change: 1 addition & 0 deletions src/components/molecules/SocialButtons/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './GoogleButton'
export * from './FacebookButton'
export * from './SocialButton'
22 changes: 18 additions & 4 deletions src/screens/NotFoundScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { Center, Text } from '@baca/design-system'
import { Box, Button, Text } from '@baca/design-system'
import { useScreenOptions, useTranslation } from '@baca/hooks'
import { router } from 'expo-router'
import { StyleSheet } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'

const navigateToLogin = () => {
router.navigate('/sign-in')
}

export const NotFoundScreen = (): JSX.Element => {
const { t } = useTranslation()
Expand All @@ -9,8 +16,15 @@ export const NotFoundScreen = (): JSX.Element => {
})

return (
<Center>
<Text>{t('errors.screen_not_found')}</Text>
</Center>
<SafeAreaView style={styles.safeArea}>
<Box alignItems="center" flexGrow={1} gap={8} p={8}>
<Text>{t('errors.screen_not_found')}</Text>
<Button maxW={360} onPress={navigateToLogin} title={t('common.continue')} w="full" />
</Box>
</SafeAreaView>
)
}

const styles = StyleSheet.create({
safeArea: { flexGrow: 1 },
})
51 changes: 51 additions & 0 deletions src/screens/PrivacyPolicyScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { LandingHeader } from '@baca/components'
import { ScrollView, Text } from '@baca/design-system'
import { SafeAreaView } from 'react-native-safe-area-context'

export const PrivacyPolicyScreen = () => {
return (
<SafeAreaView>
<LandingHeader />
<ScrollView pb={20} px={4}>
<Text textAlign="justify">
{`
Privacy Policy
Last Updated: April 11, 2024

This Privacy Policy applies to the website binarapps.online ("BACA") and governs the privacy of its users who choose to use it.

BACA is a React Native code boilerplate designed to assist entrepreneurs in launching their startups more efficiently.

Data Collection:

BACA collects and processes the following user data:

Name
Email
Additionally, BACA may collect non-personal data through web cookies.

Purpose of Data Collection:

The collected data is used for order processing purposes only.

Data Sharing:

BACA does not share user data with any third parties.

Children's Privacy:

BACA does not knowingly collect any data from children.

Updates to the Privacy Policy:

Users will be notified of any updates to this Privacy Policy via email.

Contact Information:

For any inquiries or concerns regarding this Privacy Policy, please contact us at [email protected]
`}
</Text>
</ScrollView>
</SafeAreaView>
)
}
2 changes: 2 additions & 0 deletions src/screens/auth/SignInScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
CompanyLogo,
ControlledField,
FacebookButton,
FormWrapper,
GoogleButton,
LanguagePicker,
Expand Down Expand Up @@ -107,6 +108,7 @@ export const SignInScreen = (): JSX.Element => {
</Button>
<Box gap={3} w="full">
<GoogleButton />
<FacebookButton />
</Box>
<Row alignItems="center" mt={8}>
<Text.SmRegular color="text.tertiary">
Expand Down
1 change: 1 addition & 0 deletions src/screens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export * from './DetailsScreen'
export * from './ExamplesScreen'
export * from './HomeScreen'
export * from './NotFoundScreen'
export * from './PrivacyPolicyScreen'
export * from './ProfileScreen'
export * from './PushNotificationsHelpersScreen'
export * from './SettingsScreen'
Expand Down
13 changes: 9 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11485,6 +11485,11 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-native-fbsdk-next@^12.1.4:
version "12.1.4"
resolved "https://registry.yarnpkg.com/react-native-fbsdk-next/-/react-native-fbsdk-next-12.1.4.tgz#b5525df79ca3181f3e1868eb3c7fa316c6297a8d"
integrity sha512-6fC+RTG0kwkZkjO/FYNvva1O60EmmvK/8+ifLmLf+eOHybkjKdcSsnbEk7iODyjZALhyAvDaYYyq27yyJo1X5Q==

react-native-flipper@^0.164.0:
version "0.164.0"
resolved "https://registry.yarnpkg.com/react-native-flipper/-/react-native-flipper-0.164.0.tgz#64f6269a86a13a72e30f53ba9f5281d2073a7697"
Expand Down Expand Up @@ -11576,10 +11581,10 @@ react-native-web@~0.19.6:
postcss-value-parser "^4.2.0"
styleq "^0.1.3"

[email protected].5:
version "0.73.5"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.73.5.tgz#724fd1ae8ec8fee1dcf619c82bdd1695d3cff463"
integrity sha512-iHgDArmF4CrhL0qTj+Rn+CBN5pZWUL9lUGl8ub+V9Hwu/vnzQQh8rTMVSwVd2sV6N76KjpE5a4TfIAHkpIHhKg==
[email protected].6:
version "0.73.6"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.73.6.tgz#ed4c675e205a34bd62c4ce8b9bd1ca5c85126d5b"
integrity sha512-oqmZe8D2/VolIzSPZw+oUd6j/bEmeRHwsLn1xLA5wllEYsZ5zNuMsDus235ONOnCRwexqof/J3aztyQswSmiaA==
dependencies:
"@jest/create-cache-key-function" "^29.6.3"
"@react-native-community/cli" "12.3.6"
Expand Down