From dfba8e043c26ae3ac39ab677b40f27ad463b2aae Mon Sep 17 00:00:00 2001
From: Josie123-Dev
Date: Fri, 29 May 2026 07:16:07 +0100
Subject: [PATCH] swift send implementation
---
src/components/BottomNav.tsx | 28 ++++++----
src/components/TransactionItem.tsx | 54 ++++++++++++++-----
.../TransactionItem.metadata.test.tsx | 27 +++++++++-
src/pages/History.tsx | 5 +-
src/pages/Refunds.tsx | 5 +-
src/pages/SendMoney.tsx | 2 +-
6 files changed, 96 insertions(+), 25 deletions(-)
diff --git a/src/components/BottomNav.tsx b/src/components/BottomNav.tsx
index c98222b..22ab307 100644
--- a/src/components/BottomNav.tsx
+++ b/src/components/BottomNav.tsx
@@ -14,34 +14,44 @@ export function BottomNav() {
const location = useLocation();
const navigate = useNavigate();
+ const handleNavClick = (path: string) => {
+ // Haptic feedback for mobile devices
+ if ('vibrate' in navigator && navigator.vibrate) {
+ navigator.vibrate(10);
+ }
+ navigate(path);
+ };
+
return (
-
)}
{(transaction.explorerUrl || transaction.txHash) && (
- event.stopPropagation()}
>
- Open in Stellar Explorer
-
-
+
+ View on Explorer
+
+
+
)}
diff --git a/src/components/__tests__/TransactionItem.metadata.test.tsx b/src/components/__tests__/TransactionItem.metadata.test.tsx
index e016210..23db051 100644
--- a/src/components/__tests__/TransactionItem.metadata.test.tsx
+++ b/src/components/__tests__/TransactionItem.metadata.test.tsx
@@ -103,7 +103,32 @@ describe('TransactionItem detailed metadata (#92)', () => {
/>,
);
- expect(screen.getByText('Open in Stellar Explorer')).toBeInTheDocument();
+ expect(screen.getByText('View on Explorer')).toBeInTheDocument();
expect(screen.getByText(/Hash:/)).toBeInTheDocument();
});
+
+ it('shows explorer button in main view when tx hash exists', () => {
+ render(
+ ,
+ );
+
+ expect(screen.getByText('View on Explorer')).toBeInTheDocument();
+ });
+
+ it('does not show explorer button when tx hash is missing', () => {
+ render(
+ ,
+ );
+
+ expect(screen.queryByText('View on Explorer')).not.toBeInTheDocument();
+ });
});
diff --git a/src/pages/History.tsx b/src/pages/History.tsx
index f8cde73..223f79c 100644
--- a/src/pages/History.tsx
+++ b/src/pages/History.tsx
@@ -10,6 +10,7 @@ import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
+import { BottomNav } from '@/components/BottomNav';
import { useNavigate } from 'react-router-dom';
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';
import { Bar, BarChart, Cell, Pie, PieChart, XAxis, YAxis } from 'recharts';
@@ -133,7 +134,7 @@ const History: React.FC = () => {
];
return (
-
+
{/* Header with back button */}
@@ -425,6 +426,8 @@ const History: React.FC = () => {
)}
+
+
);
};
diff --git a/src/pages/Refunds.tsx b/src/pages/Refunds.tsx
index 836d83a..462e865 100644
--- a/src/pages/Refunds.tsx
+++ b/src/pages/Refunds.tsx
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom';
import { ArrowLeft, RotateCcw } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Separator } from '@/components/ui/separator';
+import { BottomNav } from '@/components/BottomNav';
import { useQuery } from '@tanstack/react-query';
import { fetchRefunds } from '@/lib/activity';
import { RefundTracker, RefundCard } from '@/components/RefundTracker';
@@ -22,7 +23,7 @@ const Refunds: React.FC = () => {
);
return (
-
+
{/* Header */}
@@ -84,6 +85,8 @@ const Refunds: React.FC = () => {
)}
+
+
);
};
diff --git a/src/pages/SendMoney.tsx b/src/pages/SendMoney.tsx
index 8ab42a9..81fa6cb 100644
--- a/src/pages/SendMoney.tsx
+++ b/src/pages/SendMoney.tsx
@@ -883,7 +883,7 @@ export default function SendMoney() {
}
return (
-