-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤦♂️attempt: to fixed the stupid warning
- Loading branch information
Showing
8 changed files
with
110 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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 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 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,16 +1,66 @@ | ||
import { Text } from 'react-native' | ||
import { SafeAreaView } from 'react-native-safe-area-context' | ||
// import { Text } from 'react-native' | ||
// import { SafeAreaView } from 'react-native-safe-area-context' | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
{/* <Redirect href={'/'} /> */} | ||
{alert('This page does not exist')} | ||
<SafeAreaView> | ||
<Text style={ { textAlign: 'center', padding: 30 }}> | ||
This page does not exist | ||
</Text> | ||
</SafeAreaView> | ||
</> | ||
) | ||
// export default function Page() { | ||
// return ( | ||
// <> | ||
// {/* <Redirect href={'/'} /> */} | ||
// {alert('This page does not exist')} | ||
// <SafeAreaView> | ||
// <Text style={{ textAlign: 'center', padding: 30 }}>This page does not exist</Text> | ||
// </SafeAreaView> | ||
// </> | ||
// ) | ||
// } | ||
|
||
import React, { useEffect, useState } from 'react' | ||
import branch from 'react-native-branch' | ||
import { Unmatched, useFocusEffect, useRouter } from 'expo-router' | ||
|
||
export default function CustomUnmatched() { | ||
const [branchLoading, setBranchLoading] = useState(true) | ||
const [goNext, setGoNext] = useState('') | ||
const router = useRouter() | ||
|
||
useFocusEffect(() => { | ||
branch.subscribe({ | ||
onOpenStart: ({ uri, cachedInitialEvent }) => { | ||
if (uri == null) { | ||
setBranchLoading(false) | ||
return | ||
} | ||
}, | ||
onOpenComplete: ({ error, params, uri }) => { | ||
if (error) { | ||
console.error( | ||
'subscribe onOpenComplete, Error from opening uri: ' + uri + ' error: ' + error, | ||
) | ||
return | ||
} | ||
if (!params?.['+clicked_branch_link']) { | ||
setBranchLoading(false) | ||
return | ||
} else { | ||
let canonicalIdentifier = params.$canonical_identifier as string | ||
if (canonicalIdentifier) { | ||
setGoNext(canonicalIdentifier) | ||
} | ||
// Route based on Branch link data | ||
setBranchLoading(false) | ||
return | ||
} | ||
}, | ||
}) | ||
|
||
return () => { | ||
// branch.unsubscribe(); | ||
} | ||
}) | ||
useEffect(() => { | ||
if (goNext !== undefined) { | ||
router.push(goNext as any) | ||
} | ||
}, [goNext]) | ||
|
||
return branchLoading ? null : <Unmatched /> | ||
} |
This file contains 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 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,7 @@ | ||
import { router } from 'expo-router' | ||
|
||
const Default = () => { | ||
router.push('(dashboard)/') | ||
} | ||
|
||
export default Default |
This file contains 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.