Skip to content

Commit

Permalink
fix: positioning of toasts, icon (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
reneaaron authored Sep 12, 2024
1 parent ce5d6ba commit a3f10d7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function RootLayout() {
<PolyfillCrypto />
<SafeAreaView className="w-full h-full bg-background">
<Stack />
<Toast config={toastConfig} position="bottom" bottomOffset={140} />
<Toast config={toastConfig} position="bottom" bottomOffset={140} topOffset={140} />
<PortalHost />
</SafeAreaView>
</ThemeProvider>
Expand Down
3 changes: 3 additions & 0 deletions components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
Palette,
Egg,
HelpCircle,
CircleCheck,
} from "lucide-react-native";
import { cssInterop } from "nativewind";

Expand Down Expand Up @@ -85,6 +86,7 @@ interopIcon(CameraOff);
interopIcon(Palette);
interopIcon(Egg);
interopIcon(HelpCircle);
interopIcon(CircleCheck);

export {
AlertCircle,
Expand Down Expand Up @@ -122,4 +124,5 @@ export {
Palette,
Egg,
HelpCircle,
CircleCheck,
};
4 changes: 2 additions & 2 deletions components/ToastConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ToastConfig } from "react-native-toast-message";
import { Text } from "./ui/text";
import { View } from "react-native";
import { CheckCircle, XCircle } from "./Icons";
import { CircleCheck, XCircle } from "./Icons";
import { Link } from "expo-router";
import { Button } from "./ui/button";
import { useAppStore } from "~/lib/state/appStore";
Expand All @@ -10,7 +10,7 @@ export const toastConfig: ToastConfig = {
success: ({ text1, text2 }) => (
<View className="bg-foreground rounded-full px-6 py-3 mx-6">
<View className="flex flex-row gap-2 justify-center items-center">
<CheckCircle className="text-background" width={16} height={16} />
<CircleCheck className="text-background" width={16} height={16} />
<Text className="text-background font-semibold2">{text1}</Text>
</View>
{text2 && <Text className="text-background text-center">{text2}</Text>}
Expand Down
1 change: 1 addition & 0 deletions pages/settings/Wallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function Wallets() {
Toast.show({
type: "success",
text1: `Switched wallet to ${item.item.name || DEFAULT_WALLET_NAME}`,
position: "top",
});
}
}}
Expand Down
1 change: 1 addition & 0 deletions pages/settings/wallets/WalletConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function WalletConnection() {
type: "success",
text1: "Wallet Connected",
text2: "Your lightning wallet is ready to use",
position: "top"
});
} catch (error) {
console.error(error);
Expand Down

0 comments on commit a3f10d7

Please sign in to comment.