Skip to content

Commit

Permalink
Make UI Adjustment. Use iconUrl from the API
Browse files Browse the repository at this point in the history
  • Loading branch information
rustam-cb committed Mar 4, 2025
1 parent 530c8fd commit 1bff326
Show file tree
Hide file tree
Showing 36 changed files with 687 additions and 576 deletions.
Binary file modified android/app/src/main/res/drawable-hdpi/splashscreen_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-mdpi/splashscreen_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<color name="splashscreen_background">#ffffff</color>
<color name="splashscreen_background">#0052FF</color>
<color name="iconBackground">#ffffff</color>
<color name="colorPrimary">#023c69</color>
<color name="colorPrimaryDark">#ffffff</color>
<color name="colorPrimaryDark">#0052FF</color>
</resources>
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">Onramp Demo Mobile</string>
<string name="expo_system_ui_user_interface_style" translatable="false">automatic</string>
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
<string name="expo_system_ui_user_interface_style" translatable="false">automatic</string>
</resources>
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<item name="android:editTextStyle">@style/ResetEditText</item>
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:statusBarColor">#ffffff</item>
<item name="android:statusBarColor">#0052FF</item>
</style>
<style name="ResetEditText" parent="@android:style/Widget.EditText">
<item name="android:padding">0dp</item>
Expand Down
14 changes: 12 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"splash": {
"image": "./assets/images/onramp.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
"backgroundColor": "#0052FF"
},
"assetBundlePatterns": [
"**/*"
Expand Down Expand Up @@ -41,7 +41,17 @@
"owner": "coinbase",
"plugins": [
"expo-secure-store",
"expo-font"
"expo-font",
[
"expo-splash-screen",
{
"imageResizeMode": "contain",
"image": "./assets/images/onramp.png",
"backgroundColor": "#0052FF",
"imageWidth": 150,
"imageHeight": 150
}
]
]
}
}
12 changes: 2 additions & 10 deletions app/(tabs)/home.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { FundForm } from "@/components/FundForm/FundForm";
import { ThemedText } from "@/components/ThemedText";
import { ThemedView } from "@/components/ThemedView";
import { CURRENCY_OPTIONS } from "@/constants/constants";
import { useApp } from "@/context/AppContext";
import { useWallet } from "@/hooks/useWallet";
import { useMemo } from "react";
import {
KeyboardAvoidingView,
Platform,
Expand All @@ -14,24 +12,18 @@ import {
import { useSafeAreaInsets } from "react-native-safe-area-context";

export default function HomeScreen() {
const { currency, network } = useApp();
const { network } = useApp();

const insets = useSafeAreaInsets();
const currentWallet = useWallet({ network: network?.name || "base" });

const currencySymbol = useMemo(
() =>
CURRENCY_OPTIONS.find((option) => option.value === currency?.id)?.symbol,
[currency]
);

return (
<ThemedView style={{ flex: 1 }}>
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
style={{ flex: 1, paddingTop: insets.top }}
>
<ThemedText type="subtitle" style={{ textAlign: "center" }}>
<ThemedText type="subtitle" style={{ textAlign: "center", height: 56 }}>
Coinbase Onramp demo
</ThemedText>
<ScrollView
Expand Down
9 changes: 6 additions & 3 deletions app/(tabs)/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { StyleSheet, TouchableOpacity, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";

export default function WalletScreen() {
const { user, logout } = usePrivy();
const { logout } = usePrivy();
const insets = useSafeAreaInsets();
const { network, setNetwork } = useApp();
const { network } = useApp();
const currentWallet = useWallet({ network: network?.name || "base" });
const negativeColor = useThemeColor({}, "negative");
const { setAppLoading, setAppLoadingMessage } = useApp();
Expand Down Expand Up @@ -45,7 +45,10 @@ export default function WalletScreen() {
<View style={styles.content}>
<Balance network={network?.name || "base"} />

<WalletDetails address={currentWallet?.address} />
<WalletDetails
address={currentWallet?.address}
network={network?.displayName}
/>
</View>

<View style={styles.footer}>
Expand Down
3 changes: 1 addition & 2 deletions app/+not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Link, Stack, usePathname } from "expo-router";
import { Link, Stack } from "expo-router";
import { StyleSheet } from "react-native";

import { ThemedText } from "@/components/ThemedText";
import { ThemedView } from "@/components/ThemedView";
import React from "react";

export default function NotFoundScreen() {
const pathname = usePathname();
return (
<>
<Stack.Screen options={{ title: "Oops!" }} />
Expand Down
10 changes: 9 additions & 1 deletion components/BottomSheet/BottomSheetProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import React, {
useRef,
useState,
} from "react";
import { StyleSheet, View } from "react-native";
import { Dimensions, StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";

type BottomSheetContextType = {
showBottomSheet: (content: React.ReactNode, snapPoints?: string[]) => void;
Expand All @@ -39,6 +40,7 @@ export const BottomSheetProvider = memo(
const [points, setPoints] = useState<string[]>(["50%"]);
const [isReady, setIsReady] = useState(false);

const insets = useSafeAreaInsets();
useEffect(() => {
// Ensure the component is mounted
setIsReady(true);
Expand Down Expand Up @@ -83,6 +85,9 @@ export const BottomSheetProvider = memo(
{children}
{isReady && (
<BottomSheet
maxDynamicContentSize={
Dimensions.get("screen").height - insets.top - 50
}
ref={bottomSheetRef}
index={-1}
snapPoints={points}
Expand All @@ -99,6 +104,9 @@ export const BottomSheetProvider = memo(
if (index === -1) setContent(null);
}}
backgroundStyle={{ backgroundColor }}
keyboardBehavior="interactive"
keyboardBlurBehavior="none"
android_keyboardInputMode="adjustResize"
>
<View style={styles.contentContainer}>{content}</View>
</BottomSheet>
Expand Down
Loading

0 comments on commit 1bff326

Please sign in to comment.