Skip to content

Commit 44635fb

Browse files
authored
Merge pull request #374 from getAlby/feat/btc-map-home
feat: bring btc map home
2 parents 8a8c744 + cfb809e commit 44635fb

File tree

7 files changed

+37
-20
lines changed

7 files changed

+37
-20
lines changed

app/(app)/bitcoin-map.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { BitcoinMap } from "../../pages/BitcoinMap";
2+
3+
export default function Page() {
4+
return <BitcoinMap />;
5+
}

app/(app)/settings/bitcoin-map.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

components/Icons.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
PopiconsImageSolid as ImageIcon,
1818
PopiconsKeyboardSolid as KeyboardIcon,
1919
PopiconsLinkExternalSolid as LinkIcon,
20+
PopiconsMapLine as MapLineIcon,
2021
PopiconsArrowDownLine as MoveDownIcon,
2122
PopiconsArrowUpLine as MoveUpIcon,
2223
PopiconsNotificationSquareSolid as NotificationIcon,
@@ -28,6 +29,7 @@ import {
2829
PopiconsReloadSolid as ResetIcon,
2930
PopiconsFullscreenSolid as ScanIcon,
3031
PopiconsSettingsMinimalSolid as SettingsIcon,
32+
PopiconsSettingsMinimalLine as SettingsLineIcon,
3133
PopiconsShareSolid as ShareIcon,
3234
PopiconsLogoutSolid as SignOutIcon,
3335
PopiconsLoopSolid as SwapIcon,
@@ -72,6 +74,7 @@ interopIcon(HelpCircleIcon);
7274
interopIcon(ImageIcon);
7375
interopIcon(KeyboardIcon);
7476
interopIcon(LinkIcon);
77+
interopIcon(MapLineIcon);
7578
interopIcon(MoveDownIcon);
7679
interopIcon(MoveUpIcon);
7780
interopIcon(NotificationIcon);
@@ -83,6 +86,7 @@ interopIcon(RefreshIcon);
8386
interopIcon(ResetIcon);
8487
interopIcon(ScanIcon);
8588
interopIcon(SettingsIcon);
89+
interopIcon(SettingsLineIcon);
8690
interopIcon(ShareIcon);
8791
interopIcon(SignOutIcon);
8892
interopIcon(SwapIcon);
@@ -113,6 +117,7 @@ export {
113117
ImageIcon,
114118
KeyboardIcon,
115119
LinkIcon,
120+
MapLineIcon,
116121
MoveDownIcon,
117122
MoveUpIcon,
118123
NotificationIcon,
@@ -124,6 +129,7 @@ export {
124129
ResetIcon,
125130
ScanIcon,
126131
SettingsIcon,
132+
SettingsLineIcon,
127133
ShareIcon,
128134
SignOutIcon,
129135
SwapIcon,

components/Screen.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
import { type NativeStackHeaderRightProps } from "@react-navigation/native-stack";
1+
import { type NativeStackHeaderItemProps } from "@react-navigation/native-stack";
22
import { Stack } from "expo-router";
33
import { type StackAnimationTypes } from "react-native-screens";
44

55
type ScreenProps = {
66
title: string;
7-
right?: (props: NativeStackHeaderRightProps) => React.ReactNode;
7+
left?: (props: NativeStackHeaderItemProps) => React.ReactNode;
8+
right?: (props: NativeStackHeaderItemProps) => React.ReactNode;
89
animation?: StackAnimationTypes;
910
};
1011

11-
function Screen({ title, animation, right }: ScreenProps) {
12+
function Screen({ title, animation, right, left }: ScreenProps) {
1213
return (
1314
<Stack.Screen
1415
options={{
1516
title,
1617
animation,
18+
headerLeft: left ? left : undefined,
1719
headerRight: right ? right : undefined,
1820
headerShadowVisible: false,
1921
}}

pages/Home.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import {
1212
TouchableOpacity,
1313
View,
1414
} from "react-native";
15-
import { ChevronUpIcon, SettingsIcon } from "~/components/Icons";
15+
import {
16+
ChevronUpIcon,
17+
MapLineIcon,
18+
SettingsLineIcon,
19+
} from "~/components/Icons";
1620
import { Text } from "~/components/ui/text";
1721

1822
import { LinearGradient } from "expo-linear-gradient";
@@ -67,14 +71,28 @@ export function Home() {
6771
<>
6872
<Screen
6973
title=""
70-
right={() => (
74+
left={() => (
7175
<TouchableOpacity
7276
onPressIn={() => {
7377
router.push("/settings");
7478
}}
79+
className="-ml-4 px-6"
80+
>
81+
<SettingsLineIcon
82+
className="text-muted-foreground"
83+
width={24}
84+
height={24}
85+
/>
86+
</TouchableOpacity>
87+
)}
88+
right={() => (
89+
<TouchableOpacity
90+
onPressIn={() => {
91+
router.push("/bitcoin-map");
92+
}}
7593
className="-mr-4 px-6"
7694
>
77-
<SettingsIcon
95+
<MapLineIcon
7896
className="text-muted-foreground"
7997
width={24}
8098
height={24}

pages/settings/Settings.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
FingerprintIcon,
77
NotificationIcon,
88
OnboardingIcon,
9-
PinIcon,
109
ResetIcon,
1110
SignOutIcon,
1211
ThemeIcon,
@@ -108,14 +107,6 @@ export function Settings() {
108107
</Text>
109108
</TouchableOpacity>
110109
</Link>
111-
<Link href="/settings/bitcoin-map" asChild>
112-
<TouchableOpacity className="flex flex-row gap-4 items-center">
113-
<PinIcon className="text-muted-foreground" />
114-
<Text className="text-foreground font-medium2 text-xl">
115-
Bitcoin Map
116-
</Text>
117-
</TouchableOpacity>
118-
</Link>
119110

120111
{developerMode && (
121112
<>

0 commit comments

Comments
 (0)