Skip to content

Commit 630eb02

Browse files
authored
Merge pull request #830 from Akanimoh12/fix/740-741-742-743-frontend-assets-activity-config
fix: sync accepted assets and fix activity feed issues #740 #741 #742 #743
2 parents 3476520 + 6a09877 commit 630eb02

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

frontend/src/app/create/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,12 @@ export default function CreatePage() {
430430
key={asset}
431431
type="button"
432432
onClick={() => {
433+
const isSelected = assets.some((a) => a.code === asset);
434+
setAssets(
435+
isSelected
436+
? assets.filter((a) => a.code !== asset)
437+
: [...assets, { code: asset, issuer: "" }]
438+
);
433439
setForm((prev) => ({
434440
...prev,
435441
acceptedAssets: prev.acceptedAssets.includes(asset)
@@ -438,7 +444,7 @@ export default function CreatePage() {
438444
}));
439445
}}
440446
className={`rounded-xl border px-4 py-2 text-xs font-semibold transition ${
441-
form.acceptedAssets.includes(asset)
447+
assets.some((a) => a.code === asset)
442448
? "border-mint bg-mint/10 text-mint"
443449
: "border-white/10 bg-white/5 text-steel hover:border-white/20"
444450
}`}

frontend/src/components/activity-feed.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
} from "lucide-react";
1313
import { motion, AnimatePresence } from "framer-motion";
1414
import Link from "next/link";
15-
16-
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:4000";
15+
import { API_BASE_URL } from "@/lib/config";
16+
import { stellarExpertUrl } from "@/lib/stellar";
1717

1818
type ActivityItem = {
1919
id: string;
@@ -120,13 +120,13 @@ export function ActivityFeed({ username, limit = 10 }: ActivityFeedProps) {
120120
id: `tx-${tx.id}`,
121121
type: "support",
122122
title: `Received ${tx.amount} ${tx.assetCode}`,
123-
description: `Support from ${truncateHash(tx.senderAddress, 8)}`,
123+
description: `Support from ${truncateHash(tx.supporterAddress ?? '', 8)}`,
124124
timestamp: tx.createdAt,
125125
icon: getActivityIcon("support"),
126126
metadata: {
127127
amount: tx.amount,
128128
assetCode: tx.assetCode,
129-
supporter: tx.senderAddress,
129+
supporter: tx.supporterAddress,
130130
txHash: tx.txHash,
131131
},
132132
});
@@ -257,7 +257,7 @@ export function ActivityFeed({ username, limit = 10 }: ActivityFeedProps) {
257257
)}
258258
{activity.metadata.txHash && (
259259
<Link
260-
href={`https://stellar.expert/explorer/${process.env.NEXT_PUBLIC_STELLAR_NETWORK === 'MAINNET' ? 'mainnet' : 'testnet'}/tx/${activity.metadata.txHash}`}
260+
href={stellarExpertUrl('tx', activity.metadata.txHash)}
261261
target="_blank"
262262
rel="noopener noreferrer"
263263
className="inline-flex items-center gap-1 px-2 py-1 rounded bg-white/5 text-xs text-white/70 hover:text-white/90 transition font-mono"

0 commit comments

Comments
 (0)