Skip to content

Commit

Permalink
chore: change to pressable and fix toast link
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Dec 4, 2024
1 parent b96a2f3 commit 3e3a57c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 1 addition & 7 deletions components/ToastConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Link } from "expo-router";
import { View } from "react-native";
import { ToastConfig } from "react-native-toast-message";
import { useAppStore } from "~/lib/state/appStore";
import { CircleCheck, XCircle } from "./Icons";
import { Button } from "./ui/button";
import { Text } from "./ui/text";
Expand Down Expand Up @@ -35,18 +34,13 @@ export const toastConfig: ToastConfig = {
</View>
),
connectionError: ({ text1, text2, hide }) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const selectedWalletId = useAppStore((store) => store.selectedWalletId);
return (
<View className="bg-foreground rounded-xl px-6 py-3 mx-6 flex flex-col gap-2">
<View className="flex flex-row gap-2 justify-center items-center">
<XCircle className="text-background" width={16} height={16} />
<Text className="text-background font-semibold2">{text1}</Text>
</View>
<Link
href={`/settings/wallets/${selectedWalletId}/wallet-connection`}
asChild
>
<Link href={`/settings/wallets`} asChild>
<Button variant="secondary" size="sm">
<Text>Update Wallet Connection</Text>
</Button>
Expand Down
6 changes: 3 additions & 3 deletions pages/send/AddressBook.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Link, router } from "expo-router";
import { ScrollView, TouchableOpacity, View } from "react-native";
import { Pressable, ScrollView, TouchableOpacity, View } from "react-native";
import { Trash2 } from "~/components/Icons";
import Screen from "~/components/Screen";
import { Button } from "~/components/ui/button";
Expand All @@ -21,7 +21,7 @@ export function AddressBook() {
<ScrollView className="flex-1 flex flex-col">
{addressBookEntries.length > 0 ? (
addressBookEntries.map((addressBookEntry, index) => (
<TouchableOpacity
<Pressable
key={index}
onPress={() => {
router.dismissAll();
Expand Down Expand Up @@ -62,7 +62,7 @@ export function AddressBook() {
</TouchableOpacity>
</CardContent>
</Card>
</TouchableOpacity>
</Pressable>
))
) : (
<Text className="text-lg">No entries yet.</Text>
Expand Down

0 comments on commit 3e3a57c

Please sign in to comment.