Skip to content

Commit

Permalink
Merge branch 'master' into tASK-FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Dec 30, 2024
2 parents 0ca86fa + 8c5c9cd commit e5425b9
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 30 deletions.
19 changes: 12 additions & 7 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "automatic",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "cover",
"backgroundColor": "#0B0930"
},
"newArchEnabled": true,
"assetBundlePatterns": ["**/*"],
"plugins": [
[
"expo-splash-screen",
{
"backgroundColor": "#0B0930",
"image": "./assets/icon.png",
"imageWidth": "150"
}
],
[
"expo-local-authentication",
{
Expand Down Expand Up @@ -50,7 +53,8 @@
},
"infoPlist": {
"LSMinimumSystemVersion": "12.0"
}
},
"userInterfaceStyle": "automatic"
},
"android": {
"package": "com.getalby.mobile",
Expand All @@ -60,7 +64,8 @@
"backgroundImage": "./assets/adaptive-icon-bg.png",
"monochromeImage": "./assets/monochromatic.png"
},
"permissions": ["android.permission.CAMERA"]
"permissions": ["android.permission.CAMERA"],
"userInterfaceStyle": "automatic"
},
"extra": {
"eas": {
Expand Down
13 changes: 9 additions & 4 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
} from "@react-navigation/native";
import { PortalHost } from "@rn-primitives/portal";
import * as Font from "expo-font";
import { Slot, SplashScreen } from "expo-router";
import { Slot } from "expo-router";
import * as SplashScreen from "expo-splash-screen";
import { StatusBar } from "expo-status-bar";
import { swrConfiguration } from "lib/swr";
import * as React from "react";
Expand Down Expand Up @@ -69,18 +70,22 @@ export default function RootLayout() {
const loadTheme = React.useCallback((): Promise<void> => {
return new Promise((resolve) => {
const theme = useAppStore.getState().theme;
setColorScheme(theme);
if (theme) {
setColorScheme(theme);
} else {
useAppStore.getState().setTheme(isDarkColorScheme ? "dark" : "light");
}
resolve();
});
}, [setColorScheme]);
}, [isDarkColorScheme, setColorScheme]);

React.useEffect(() => {
const init = async () => {
try {
await Promise.all([loadTheme(), loadFonts(), checkBiometricStatus()]);
} finally {
setResourcesLoaded(true);
SplashScreen.hideAsync();
SplashScreen.hide();
}
};

Expand Down
Binary file removed assets/splash.png
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/state/appStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface AppState {
readonly addressBookEntries: AddressBookEntry[];
readonly isSecurityEnabled: boolean;
readonly isOnboarded: boolean;
readonly theme: Theme;
readonly theme?: Theme;
readonly balanceDisplayMode: BalanceDisplayMode;
setUnlocked: (unlocked: boolean) => void;
setTheme: (theme: Theme) => void;
Expand Down Expand Up @@ -45,7 +45,7 @@ const isSecurityEnabledKey = "isSecurityEnabled";
export const lastActiveTimeKey = "lastActiveTime";

export type BalanceDisplayMode = "sats" | "fiat" | "hidden";
export type Theme = "system" | "light" | "dark";
export type Theme = "light" | "dark";

type Wallet = {
name?: string;
Expand Down Expand Up @@ -176,7 +176,7 @@ export const useAppStore = create<AppState>()((set, get) => {
const isSecurityEnabled =
secureStorage.getItem(isSecurityEnabledKey) === "true";

const theme = (secureStorage.getItem(themeKey) as Theme) || "system";
const theme = (secureStorage.getItem(themeKey) as Theme) || null;
const balanceDisplayMode =
(secureStorage.getItem(balanceDisplayModeKey) as BalanceDisplayMode) ||
"sats";
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"expo-local-authentication": "~15.0.1",
"expo-router": "~4.0.15",
"expo-secure-store": "~14.0.0",
"expo-splash-screen": "^0.29.18",
"expo-status-bar": "~2.0.0",
"expo-system-ui": "~4.0.6",
"lottie-react-native": "7.1.0",
"message-port-polyfill": "^0.2.0",
"nativewind": "^4.0.1",
Expand Down
26 changes: 15 additions & 11 deletions pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ export function Home() {
<Screen
title=""
right={() => (
<Link href="/settings" asChild>
<TouchableOpacity>
<SettingsIcon className="text-muted-foreground" />
</TouchableOpacity>
</Link>
<TouchableOpacity
onPressIn={() => {
router.push("/settings");
}}
>
<SettingsIcon className="text-muted-foreground" />
</TouchableOpacity>
)}
/>
<View className="h-full flex p-6">
Expand Down Expand Up @@ -148,12 +150,14 @@ export function Home() {
</View>
</ScrollView>
<View className="flex items-center justify-center">
<Link href="/transactions">
<ChevronUpIcon
className="text-muted-foreground"
width={32}
height={32}
/>
<Link href="/transactions" asChild>
<TouchableOpacity>
<ChevronUpIcon
className="text-muted-foreground"
width={32}
height={32}
/>
</TouchableOpacity>
</Link>
</View>
<View className="flex flex-row gap-6 mt-10">
Expand Down
2 changes: 1 addition & 1 deletion pages/Transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function Transactions() {
animation="slide_from_bottom"
right={() => (
<Pressable
onPress={() => {
onPressIn={() => {
router.back();
}}
>
Expand Down
1 change: 1 addition & 0 deletions pages/send/PaymentSuccess.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { openURL } from "expo-linking";
import { router, useLocalSearchParams } from "expo-router";
import { LNURLPaymentSuccessAction } from "lib/lnurl";
import React from "react";
import { ScrollView, View } from "react-native";
import { Tick } from "~/animations/Tick";
import { Receiver } from "~/components/Receiver";
Expand Down
8 changes: 4 additions & 4 deletions pages/settings/wallets/SetupWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as Clipboard from "expo-clipboard";
import { router, useLocalSearchParams } from "expo-router";
import { useAppStore } from "lib/state/appStore";
import React from "react";
import { Pressable, TouchableOpacity, View } from "react-native";
import { TouchableOpacity, View } from "react-native";
import Toast from "react-native-toast-message";
import Alert from "~/components/Alert";
import DismissableKeyboardView from "~/components/DismissableKeyboardView";
Expand Down Expand Up @@ -153,8 +153,8 @@ export function SetupWallet() {
title="Setup Wallet Connection"
right={() =>
walletIdWithConnection !== -1 ? (
<Pressable
onPress={() => {
<TouchableOpacity
onPressIn={() => {
useAppStore
.getState()
.setSelectedWalletId(walletIdWithConnection);
Expand All @@ -165,7 +165,7 @@ export function SetupWallet() {
}}
>
<XIcon className="text-foreground" />
</Pressable>
</TouchableOpacity>
) : (
<Dialog>
<DialogTrigger asChild>
Expand Down
15 changes: 15 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4563,11 +4563,26 @@ expo-secure-store@~14.0.0:
resolved "https://registry.yarnpkg.com/expo-secure-store/-/expo-secure-store-14.0.0.tgz#cf6eb7f73e619f8907d5a073e2f438927b5fc2ab"
integrity sha512-VyhtRFXP+7hQmHhKlHIOWid1Q/IRpM7Uif32tZHLZHvQ6FNz2cUkr26XWGvCa7btYbrR6OL++FBFZYjbIcRZTw==

expo-splash-screen@^0.29.18:
version "0.29.18"
resolved "https://registry.yarnpkg.com/expo-splash-screen/-/expo-splash-screen-0.29.18.tgz#96ccce3d5a03389a9061743903b0a77c22a16796"
integrity sha512-bTBY+LF6YtYen2j60yGNh2SX/tG4UXZAyBCMMriOSiZZ7LSCs3ARyEufaSiWk+ckWShTeMqItOnaAN/CAF8MJA==
dependencies:
"@expo/prebuild-config" "^8.0.23"

expo-status-bar@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-2.0.0.tgz#dd99adc2ace12a24c92718cd0f97b93347103393"
integrity sha512-vxxdpvpNDMTEc5uTiIrbTvySKKUsOACmfl8OZuUdjNle05oGqwtq3v5YObwym/njSByjoyuZX8UpXBZnxvarwQ==

expo-system-ui@~4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/expo-system-ui/-/expo-system-ui-4.0.6.tgz#23d172e346dbe478f31e36019c2570242e7c0762"
integrity sha512-JWmw0aaNIB8YxA6bXgH6nClyledZaAG5VNzoRvmXT4+j3MY4waAHSSSdVV71bUgjchT/2KOAcibZ/EeosJONug==
dependencies:
"@react-native/normalize-colors" "0.76.5"
debug "^4.3.2"

expo@~52.0.20:
version "52.0.23"
resolved "https://registry.yarnpkg.com/expo/-/expo-52.0.23.tgz#68b79da2206afdce9c68f45f519f812bab9a2cfe"
Expand Down

0 comments on commit e5425b9

Please sign in to comment.