diff --git a/app/_layout.tsx b/app/_layout.tsx
index 7cdc74f2..be4d78d1 100644
--- a/app/_layout.tsx
+++ b/app/_layout.tsx
@@ -25,6 +25,7 @@ import { hasOnboardedKey, useAppStore } from "~/lib/state/appStore";
import { usePathname } from "expo-router";
import { UserInactivityProvider } from "~/context/UserInactivity";
import { PortalHost } from '@rn-primitives/portal';
+import { GestureHandlerRootView } from "react-native-gesture-handler";
import { isBiometricSupported } from "~/lib/isBiometricSupported";
const LIGHT_THEME: Theme = {
@@ -121,11 +122,13 @@ export default function RootLayout() {
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/package.json b/package.json
index d46ab98d..ef13127b 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.5",
+ "react-native-gesture-handler": "~2.16.1",
"react-native-get-random-values": "^1.9.0",
"react-native-qrcode-svg": "^6.3.1",
"react-native-reanimated": "~3.10.1",
diff --git a/pages/Home.tsx b/pages/Home.tsx
index 816663fc..c7467b4d 100644
--- a/pages/Home.tsx
+++ b/pages/Home.tsx
@@ -1,5 +1,5 @@
import { View, Pressable, StyleSheet, TouchableOpacity } from "react-native";
-import React, { useState } from "react";
+import React, { useState, useCallback, useEffect } from "react";
import { useBalance } from "hooks/useBalance";
import { useAppStore } from "lib/state/appStore";
import { WalletConnection } from "~/pages/settings/wallets/WalletConnection";
@@ -22,6 +22,7 @@ import { SvgProps } from "react-native-svg";
import { Button } from "~/components/ui/button";
import Screen from "~/components/Screen";
import { useOnboarding } from "~/hooks/useOnboarding";
+import { GestureDetector, Gesture, Directions } from "react-native-gesture-handler";
dayjs.extend(relativeTime);
@@ -68,77 +69,96 @@ export function Home() {
}
}
+ const [shouldNavigate, setShouldNavigate] = useState(false);
+
+ const handleSwipeUp = useCallback(() => {
+ setShouldNavigate(true);
+ }, []);
+
+ useEffect(() => {
+ if (shouldNavigate) {
+ router.push("/transactions");
+ setShouldNavigate(false);
+ }
+ }, [shouldNavigate]);
+
+ const swipeUpGesture = Gesture.Fling()
+ .direction(Directions.UP)
+ .onEnd(handleSwipeUp);
+
return (
- <>
-
-
-
-
-
-
- }
- />
-
-
-
-
- {balance ? (
- <>
-
+
+
+
+
+
+
+
+
+ }
+ />
+
+
+
+
+ {balance ? (
+ <>
+
+ {balanceState == BalanceState.SATS &&
+ new Intl.NumberFormat().format(
+ Math.floor(balance.balance / 1000),
+ )}
+ {balanceState == BalanceState.FIAT &&
+ getFiatAmount &&
+ getFiatAmount(Math.floor(balance.balance / 1000))}
+ {balanceState == BalanceState.HIDDEN && "****"}
+
+
+ {balanceState == BalanceState.SATS && "sats"}
+
+ >
+ ) : (
+
+ )}
+
+
+ {balance ? (
+
{balanceState == BalanceState.SATS &&
- new Intl.NumberFormat().format(
- Math.floor(balance.balance / 1000),
- )}
- {balanceState == BalanceState.FIAT &&
getFiatAmount &&
getFiatAmount(Math.floor(balance.balance / 1000))}
- {balanceState == BalanceState.HIDDEN && "****"}
-
-
- {balanceState == BalanceState.SATS && "sats"}
+ {balanceState == BalanceState.FIAT &&
+ new Intl.NumberFormat().format(
+ Math.floor(balance.balance / 1000),
+ ) + " sats"}
- >
- ) : (
-
- )}
-
-
- {balance ? (
-
- {balanceState == BalanceState.SATS &&
- getFiatAmount &&
- getFiatAmount(Math.floor(balance.balance / 1000))}
- {balanceState == BalanceState.FIAT &&
- new Intl.NumberFormat().format(
- Math.floor(balance.balance / 1000),
- ) + " sats"}
-
- ) : (
-
- )}
+ ) : (
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- >
+
);
}
diff --git a/yarn.lock b/yarn.lock
index a840dd44..c26a46d0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -843,6 +843,13 @@
"@babel/helper-validator-identifier" "^7.22.20"
to-fast-properties "^2.0.0"
+"@egjs/hammerjs@^2.0.17":
+ version "2.0.17"
+ resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124"
+ integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==
+ dependencies:
+ "@types/hammerjs" "^2.0.36"
+
"@expo/bunyan@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@expo/bunyan/-/bunyan-4.0.0.tgz#be0c1de943c7987a9fbd309ea0b1acd605890c7b"
@@ -2247,6 +2254,11 @@
resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5"
integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==
+"@types/hammerjs@^2.0.36":
+ version "2.0.45"
+ resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.45.tgz#ffa764bb68a66c08db6efb9c816eb7be850577b1"
+ integrity sha512-qkcUlZmX6c4J8q45taBKTL3p+LbITgyx7qhlPYOdOHZB7B31K0mXbP5YA7i7SgDeEGuI9MnumiKPEMrxg8j3KQ==
+
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.6"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7"
@@ -4463,6 +4475,13 @@ hermes-profile-transformer@^0.0.6:
dependencies:
source-map "^0.7.3"
+hoist-non-react-statics@^3.3.0:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
+ integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
+ dependencies:
+ react-is "^16.7.0"
+
hosted-git-info@^3.0.2:
version "3.0.8"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-3.0.8.tgz#6e35d4cc87af2c5f816e4cb9ce350ba87a3f370d"
@@ -5286,7 +5305,7 @@ lodash@4.17.3:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.3.tgz#557ed7d2a9438cac5fd5a43043ca60cb455e01f7"
integrity sha512-H+sg4+uBLOBrw9833P6gCURJjV+puWPbxM8S3H4ORlhVCmQpF5yCE50bc4Exaqm9U5Nhjw83Okq1azyb1U7mxw==
-lodash@^4.17.10, lodash@^4.17.13, lodash@^4.17.4:
+lodash@^4.17.10, lodash@^4.17.13, lodash@^4.17.21, lodash@^4.17.4:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -6386,7 +6405,7 @@ prompts@^2.3.2, prompts@^2.4.2:
kleur "^3.0.3"
sisteransi "^1.0.5"
-prop-types@^15.8.0:
+prop-types@^15.7.2, prop-types@^15.8.0:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@@ -6496,7 +6515,7 @@ react-freeze@^1.0.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
-react-is@^16.13.0, react-is@^16.13.1, react-is@^16.8.4:
+react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.4:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -6517,6 +6536,17 @@ react-native-css-interop@0.0.36:
babel-plugin-tester "^11.0.4"
lightningcss "1.22.0"
+react-native-gesture-handler@~2.16.1:
+ version "2.16.2"
+ resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.16.2.tgz#032bd2a07334292d7f6cff1dc9d1ec928f72e26d"
+ integrity sha512-vGFlrDKlmyI+BT+FemqVxmvO7nqxU33cgXVsn6IKAFishvlG3oV2Ds67D5nPkHMea8T+s1IcuMm0bF8ntZtAyg==
+ dependencies:
+ "@egjs/hammerjs" "^2.0.17"
+ hoist-non-react-statics "^3.3.0"
+ invariant "^2.2.4"
+ lodash "^4.17.21"
+ prop-types "^15.7.2"
+
react-native-get-random-values@^1.9.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/react-native-get-random-values/-/react-native-get-random-values-1.11.0.tgz#1ca70d1271f4b08af92958803b89dccbda78728d"