-
Notifications
You must be signed in to change notification settings - Fork 4
FEAT: facebook sign in #51
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
Open
MateuszRostkowski
wants to merge
6
commits into
main
Choose a base branch
from
feat/facebook-sign-in
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9ad1874
add facebook button and logic
micbaumr 76d616f
add back button on not found screen
micbaumr 3eae330
add privacy policy screen
micbaumr 80bcecd
fix typo in docs
micbaumr 09247aa
Merge branch 'feat/google-sign-in-logic' into feat/facebook-sign-in
micbaumr dba739c
Merge branch 'feat/google-sign-in-logic' into feat/facebook-sign-in
micbaumr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/components/molecules/SocialButtons/FacebookButton/NativeFacebookButton.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
src/components/molecules/SocialButtons/FacebookButton/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 /> | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './GoogleButton' | ||
export * from './FacebookButton' | ||
export * from './SocialButton' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?