Skip to content

Commit 8779103

Browse files
committed
UI polish: web tabs theming, welcome screen, home screen improvements
1 parent fea1126 commit 8779103

5 files changed

Lines changed: 65 additions & 13 deletions

File tree

app/(tabs)/_layout.web.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ export default function TabLayout() {
8080
minHeight: 0,
8181
};
8282

83-
const slotContainerStyle: StyleProp<ViewStyle> = isUltrawide
84-
? [styles.slotContainer, styles.slotContainerUltrawide]
85-
: styles.slotContainer;
83+
const slotContainerStyle: StyleProp<ViewStyle> = styles.slotContainer;
8684

8785
const tabs: readonly TabDef[] = [
8886
{ name: "index", href: "/", icon: "wallet", label: t("wallet.title") },
@@ -173,7 +171,14 @@ export default function TabLayout() {
173171
{tabs.map(renderTrigger)}
174172
</TabList>
175173
<View style={slotContainerStyle}>
176-
<TabSlot />
174+
<View
175+
style={[
176+
styles.slotInner,
177+
isUltrawide && styles.slotInnerUltrawide,
178+
]}
179+
>
180+
<TabSlot />
181+
</View>
177182
</View>
178183
</>
179184
) : (
@@ -244,18 +249,30 @@ const styles = StyleSheet.create({
244249

245250
// Wrapper around <TabSlot /> that owns the flex sizing. Without this the
246251
// default TabSlot style (`flexShrink: 0`) prevents react-native-web's
247-
// `<ScrollView>` from receiving a bounded height.
252+
// `<ScrollView>` from receiving a bounded height. We also center children
253+
// horizontally so the inner cap-width column on ultrawide displays sits in
254+
// the middle of the available space (not vertically centered, which is what
255+
// `alignSelf: 'center'` would do inside a row-direction parent).
248256
slotContainer: {
249257
flex: 1,
250258
minHeight: 0,
251259
minWidth: 0,
252260
alignSelf: "stretch",
261+
alignItems: "center",
253262
},
254-
// On ultrawide displays the content column is centered and capped.
255-
slotContainerUltrawide: {
256-
maxWidth: CONTENT_MAX_WIDTH,
257-
alignSelf: "center",
263+
// Inner wrapper that holds the actual <TabSlot />. Always full width on
264+
// smaller screens, capped to CONTENT_MAX_WIDTH on ultrawide so cards and
265+
// text don't stretch across the viewport. Content is top-aligned because
266+
// the wrapper itself is a flex column with the default `justifyContent:
267+
// 'flex-start'`.
268+
slotInner: {
269+
flex: 1,
258270
width: "100%",
271+
minHeight: 0,
272+
minWidth: 0,
273+
},
274+
slotInnerUltrawide: {
275+
maxWidth: CONTENT_MAX_WIDTH,
259276
},
260277

261278
// ── Bottom tab bar (< 600px) ──────────────────────────────────────────────

app/(tabs)/index.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import Animated, {
2424
Extrapolation,
2525
} from "react-native-reanimated";
2626
import { LinearGradient } from "expo-linear-gradient";
27+
import * as WebBrowser from "expo-web-browser";
28+
import * as Localization from "expo-localization";
2729
import { useWalletStore } from "../../src/wallet/wallet-store";
2830
import {
2931
BalanceDisplay,
@@ -76,9 +78,25 @@ export default function HomeScreen() {
7678
const transactions = useWalletStore((s) => s.transactions);
7779
const network = useWalletStore((s) => s.network);
7880
const activeWalletName = useWalletStore((s) => s.activeWalletName);
81+
const receiveAddress = useWalletStore((s) => s.currentReceiveAddress);
7982
const refreshBalance = useWalletStore((s) => s.refreshBalance);
8083
const loading = useWalletStore((s) => s.loading);
8184

85+
const handleBuy = useCallback(async () => {
86+
const locale = Localization.getLocales()[0];
87+
const language = locale?.languageCode ?? "en";
88+
const country = locale?.regionCode ?? "";
89+
const params = new URLSearchParams({
90+
in_app: "true",
91+
address: receiveAddress ?? "",
92+
language,
93+
country,
94+
});
95+
await WebBrowser.openBrowserAsync(
96+
`https://buy.fairco.in/?${params.toString()}`,
97+
);
98+
}, [receiveAddress]);
99+
82100
const [price, setPrice] = useState<PriceData | null>(getCachedPrice);
83101

84102
useFocusEffect(
@@ -191,6 +209,11 @@ export default function HomeScreen() {
191209
label="Receive"
192210
onPress={() => router.push("/(tabs)/receive")}
193211
/>
212+
<ActionButton
213+
icon="credit-card-plus"
214+
label="Buy"
215+
onPress={handleBuy}
216+
/>
194217
<ActionButton
195218
icon="account-group"
196219
label="Contacts"

app/(tabs)/settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ export default function SettingsScreen() {
525525
<ScreenHeader title="Settings" />
526526
<ScrollView
527527
className="flex-1"
528-
contentContainerClassName="px-4 pt-2 pb-8 gap-6"
528+
contentContainerClassName="pt-2 pb-8 gap-2"
529529
>
530530
{/* Wallets */}
531531
<SettingsListGroup title="Wallets">

app/onboarding/welcome.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
*/
44

55
import { useCallback } from "react";
6-
import { View, Text } from "react-native";
6+
import { View, Text, Image } from "react-native";
77
import { useRouter } from "expo-router";
88
import { SafeAreaView } from "react-native-safe-area-context";
99
import { Button } from "../../src/ui/components/Button";
10+
import { FONT_PHUDU_BLACK } from "../../src/utils/fonts";
1011

1112
export default function WelcomeScreen() {
1213
const router = useRouter();
@@ -24,8 +25,18 @@ export default function WelcomeScreen() {
2425
<View className="flex-1 items-center justify-between px-8 pt-20 pb-10">
2526
{/* Brand */}
2627
<View className="flex-1 items-center justify-center">
27-
<Text className="text-primary text-7xl mb-6">{"\u229C"}</Text>
28-
<Text className="text-foreground text-3xl font-bold tracking-wider mb-3">
28+
<Image
29+
source={require("../../assets/icon.png")}
30+
style={{ width: 128, height: 128, marginBottom: 24, borderRadius: 28 }}
31+
resizeMode="contain"
32+
accessibilityIgnoresInvertColors
33+
accessibilityRole="image"
34+
accessibilityLabel="FAIRWallet logo"
35+
/>
36+
<Text
37+
className="text-foreground text-4xl tracking-wider mb-3"
38+
style={{ fontFamily: FONT_PHUDU_BLACK }}
39+
>
2940
FAIRWallet
3041
</Text>
3142
<Text className="text-muted-foreground text-base tracking-widest">

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"expo-sqlite": "~55.0.0",
4545
"expo-status-bar": "~55.0.0",
4646
"expo-system-ui": "~55.0.0",
47+
"expo-web-browser": "^55.0.14",
4748
"nativewind": "^4.2.3",
4849
"react": "19.2.0",
4950
"react-dom": "19.2.0",

0 commit comments

Comments
 (0)