@@ -40,7 +82,9 @@ function ActivityFeedSkeletonRows() {
* the issue spec.
* settled, trades.length > 0 -> real rows.
*/
-const CreatorActivityFeed: React.FC
= ({ creatorId }) => {
+const CreatorActivityFeed: React.FC = ({
+ creatorId,
+}) => {
const { trades, isLoading } = useCreatorActivityFeed(creatorId, id =>
creatorActivityService.getCreatorActivity(id)
);
@@ -68,37 +112,7 @@ const CreatorActivityFeed: React.FC = ({ creatorId })
return (
{trades.map(trade => (
-
-
- {trade.type === 'buy' ? (
-
- ) : (
-
- )}
-
-
-
-
- {trade.type === 'buy' ? 'Buy' : 'Sell'}
-
- •
-
- {formatCreatorHandle(trade.traderHandle)}
-
-
-
- {trade.amount} keys
- •
- {trade.price} XLM
- •
- {formatRelativeTime(trade.timestamp)}
-
-
-
+
))}
);
diff --git a/src/components/home/CreatorSpotlight.tsx b/src/components/home/CreatorSpotlight.tsx
index 11362e3f..42caf93c 100644
--- a/src/components/home/CreatorSpotlight.tsx
+++ b/src/components/home/CreatorSpotlight.tsx
@@ -1,14 +1,14 @@
-import { useQuery } from '@tanstack/react-query';
import { Users, Star, ArrowRight } from 'lucide-react';
+import { useQuery } from '@tanstack/react-query';
import { useEffect, useRef } from 'react';
import { Link } from 'react-router';
import { courseService, type Course } from '@/services/course.service';
import { queryKeys } from '@/lib/queryKeys';
-import { STROOPS_PER_XLM } from '@/constants/stellar';
import { formatHolderCount } from '@/utils/numberFormat.utils';
import { normalizeCreatorDisplayName } from '@/utils/creatorDisplayName.utils';
import { cn } from '@/lib/utils';
import CreatorInitialsAvatar from '@/components/common/CreatorInitialsAvatar';
+import { useFormatXlm } from '@/hooks/useFormatXlm';
/* ------------------------------------------------------------------ */
/* Skeleton */
@@ -27,10 +27,17 @@ function SpotlightSkeletonCard() {
Loading spotlight creator
{/* Rank badge placeholder */}
-
+
{/* Avatar */}
-
+
{/* Name */}
@@ -65,9 +72,10 @@ interface SpotlightCreatorCardProps {
function SpotlightCreatorCard({ creator, rank }: SpotlightCreatorCardProps) {
const name = normalizeCreatorDisplayName(creator.title) || 'Unnamed creator';
+ const { format: formatXlm } = useFormatXlm();
const keyPrice =
creator.priceStroops != null
- ? (creator.priceStroops / STROOPS_PER_XLM).toFixed(2)
+ ? formatXlm(creator.priceStroops)
: creator.price.toFixed(2);
const holderCount = creator.creatorShareSupply ?? 0;
@@ -112,7 +120,9 @@ function SpotlightCreatorCard({ creator, rank }: SpotlightCreatorCardProps) {
{keyPrice}
- XLM
+
+ XLM
+
{/* Holder count */}
@@ -143,7 +153,8 @@ export default function CreatorSpotlight() {
const { data: creators, isLoading } = useQuery({
queryKey: queryKeys.creators.list({ sort: 'volume_desc', limit: 3 }),
- queryFn: () => courseService.getCourses({ sort: 'volume_desc', limit: 3 }),
+ queryFn: () =>
+ courseService.getCourses({ sort: 'volume_desc', limit: 3 }),
});
useEffect(() => {
diff --git a/src/components/home/TrendingCreatorCard.tsx b/src/components/home/TrendingCreatorCard.tsx
index bf3f39c0..6b1fec97 100644
--- a/src/components/home/TrendingCreatorCard.tsx
+++ b/src/components/home/TrendingCreatorCard.tsx
@@ -7,12 +7,14 @@ type Props = { creator: Course & { walletAddress: string } };
import { formatHolderCount } from '@/utils/numberFormat.utils';
import { cn } from '@/lib/utils';
import { creatorCardSubtitleClampClass } from '@/utils/lineClamp.utils';
+import { useFormatXlm } from '@/hooks/useFormatXlm';
export default function TrendingCreatorCard({ creator }: Props) {
const name = creator.title || 'Unnamed creator';
const avatar = makeBlockie(creator.walletAddress);
+ const { format: formatXlm } = useFormatXlm();
const priceXlm = creator.priceStroops
- ? (creator.priceStroops / 1e7).toFixed(2)
+ ? formatXlm(creator.priceStroops)
: creator.price.toFixed(2);
return (