Skip to content

Commit 73639bf

Browse files
Merge pull request #1952 from Solid-Money/claude/rain-transaction-sources-qaBhF
Display merchant location in card transaction details
2 parents c8b5229 + f1829c8 commit 73639bf

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

app/(protected)/(tabs)/activity/[clientTxId].tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ const CardTransactionDetail = memo(function CardTransactionDetail({
163163
cardProvider,
164164
}: CardTransactionDetailProps) {
165165
const merchantName = transaction.merchant_name || transaction.description || 'Unknown';
166+
const merchantLocation = [transaction.merchant_city, transaction.merchant_country]
167+
.filter(Boolean)
168+
.join(' ') || undefined;
166169
const isPurchase = transaction.category === CardTransactionCategory.PURCHASE;
167170
const { data: cashbacks } = useCashbacks();
168171

@@ -247,7 +250,12 @@ const CardTransactionDetail = memo(function CardTransactionDetail({
247250
return (
248251
<PageLayout desktopOnly>
249252
<View className="mx-auto w-full max-w-lg flex-1 gap-10 px-4 py-8 pb-32 md:py-12">
250-
<Back title={merchantName} className="text-xl md:text-3xl" />
253+
<View>
254+
<Back title={merchantName} className="text-xl md:text-3xl" />
255+
{merchantLocation && (
256+
<Text className="ml-10 text-sm text-muted-foreground">{merchantLocation}</Text>
257+
)}
258+
</View>
251259

252260
<View className="items-center gap-4">
253261
{/* Avatar with initials or token icon */}

app/(protected)/(tabs)/card/details/transactions.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export default function CardTransactions() {
6666
const renderTransaction = ({ item, index }: { item: CardTransaction; index: number }) => {
6767
const isPurchase = item.category === CardTransactionCategory.PURCHASE;
6868
const merchantName = item.merchant_name || item.description;
69+
const merchantLocation = [item.merchant_city, item.merchant_country]
70+
.filter(Boolean)
71+
.join(' ') || undefined;
6972
const color = getColorForTransaction(merchantName);
7073

7174
const transactionUrl = item.crypto_transaction_details?.tx_hash
@@ -103,6 +106,11 @@ export default function CardTransactions() {
103106
<Text className="text-lg font-medium" numberOfLines={1}>
104107
{merchantName}
105108
</Text>
109+
{merchantLocation && (
110+
<Text className="text-sm text-muted-foreground" numberOfLines={1}>
111+
{merchantLocation}
112+
</Text>
113+
)}
106114
<Text className="text-sm text-muted-foreground" numberOfLines={1}>
107115
{formatDate(item.posted_at)}
108116
{', '}

components/Activity/CardTransactions.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ export default function CardTransactions() {
156156

157157
const transaction = row as CardTransactionWithTimestamp;
158158
const merchantName = transaction.merchant_name || transaction.description || 'Unknown';
159+
const merchantLocation = [transaction.merchant_city, transaction.merchant_country]
160+
.filter(Boolean)
161+
.join(' ') || undefined;
159162
const initials = getInitials(merchantName);
160163
const isPurchase = transaction.category === CardTransactionCategory.PURCHASE;
161164
const color = getColorForTransaction(merchantName);
@@ -195,6 +198,11 @@ export default function CardTransactions() {
195198
<Text className="text-lg font-medium text-white" numberOfLines={1}>
196199
{merchantName}
197200
</Text>
201+
{merchantLocation && (
202+
<Text className="text-sm text-[#8E8E93]" numberOfLines={1}>
203+
{merchantLocation}
204+
</Text>
205+
)}
198206
{cashbackInfo && (
199207
<View className="mt-0.5 flex-row items-center gap-1">
200208
<Diamond />

lib/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,8 @@ export interface CardTransaction {
12411241
merchant_category_code?: string;
12421242
merchant_name?: string;
12431243
merchant_location?: string;
1244+
merchant_city?: string;
1245+
merchant_country?: string;
12441246
local_transaction_details?: LocalTransactionDetails;
12451247
}
12461248

0 commit comments

Comments
 (0)