Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 31 additions & 33 deletions frontend/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
from {
opacity: 0;
}

to {
opacity: 1;
}
Expand All @@ -73,6 +74,7 @@
opacity: 0;
transform: translateY(20px);
}

to {
opacity: 1;
transform: translateY(0);
Expand All @@ -84,27 +86,32 @@
opacity: 0;
transform: translateY(-8px);
}

to {
opacity: 1;
transform: translateY(0);
}
}

@keyframes pulse-slow {

0%,
100% {
opacity: 0.1;
}

50% {
opacity: 0.3;
}
}

@keyframes float {

0%,
100% {
transform: translateY(0);
}

50% {
transform: translateY(-10px);
}
Expand Down Expand Up @@ -206,11 +213,9 @@ body {
.wallet-card {
border-radius: 1rem;
border: 1px solid rgba(19, 38, 61, 0.12);
background: linear-gradient(
165deg,
rgba(255, 255, 255, 0.9),
rgba(239, 247, 255, 0.62)
);
background: linear-gradient(165deg,
rgba(255, 255, 255, 0.9),
rgba(239, 247, 255, 0.62));
padding: 1rem;
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -258,11 +263,9 @@ body {
border: 0;
border-radius: 0.75rem;
height: 2.65rem;
background: linear-gradient(
90deg,
var(--accent-strong),
var(--wallet-accent)
);
background: linear-gradient(90deg,
var(--accent-strong),
var(--wallet-accent));
color: #ffffff;
font-size: 0.95rem;
font-weight: 600;
Expand Down Expand Up @@ -504,11 +507,9 @@ body {
.dashboard-stat-card {
border-radius: 0.9rem;
border: 1px solid rgba(19, 38, 61, 0.12);
background: linear-gradient(
160deg,
rgba(255, 255, 255, 0.88),
rgba(242, 250, 255, 0.76)
);
background: linear-gradient(160deg,
rgba(255, 255, 255, 0.88),
rgba(242, 250, 255, 0.76));
padding: 0.9rem;
}

Expand Down Expand Up @@ -550,20 +551,16 @@ body {
.dashboard-analytics-card {
border-radius: 0.9rem;
border: 1px solid rgba(19, 38, 61, 0.11);
background: linear-gradient(
165deg,
rgba(250, 255, 255, 0.92),
rgba(236, 247, 252, 0.74)
);
background: linear-gradient(165deg,
rgba(250, 255, 255, 0.92),
rgba(236, 247, 252, 0.74));
padding: 0.85rem;
}

.dashboard-analytics-card[data-unavailable="true"] {
background: linear-gradient(
165deg,
rgba(247, 250, 253, 0.88),
rgba(236, 242, 249, 0.75)
);
background: linear-gradient(165deg,
rgba(247, 250, 253, 0.88),
rgba(236, 242, 249, 0.75));
}

.dashboard-analytics-card p {
Expand Down Expand Up @@ -1074,6 +1071,7 @@ body {
opacity: 0;
transform: translateY(16px);
}

to {
opacity: 1;
transform: translateY(0);
Expand All @@ -1085,6 +1083,7 @@ body {
opacity: 0;
transform: translateY(8px);
}

to {
opacity: 1;
transform: translateY(0);
Expand All @@ -1102,6 +1101,7 @@ body {
opacity: 0.84;
transform: scale(0.88);
}

to {
opacity: 1;
transform: scale(1.04);
Expand Down Expand Up @@ -1129,12 +1129,10 @@ body {
left: 0;
right: 0;
height: 1px;
background: linear-gradient(
90deg,
transparent,
var(--glass-highlight),
transparent
);
background: linear-gradient(90deg,
transparent,
var(--glass-highlight),
transparent);
z-index: 1;
}

Expand Down Expand Up @@ -1273,13 +1271,13 @@ body {
.stepper__label {
font-size: 0.625rem;
}

.stepper__circle {
width: 2rem;
height: 2rem;
font-size: 0.75rem;
}

.stepper__line {
top: 1rem;
}
Expand Down
44 changes: 26 additions & 18 deletions frontend/components/IncomingStreams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,31 @@ const IncomingStreams: React.FC<IncomingStreamsProps> = ({ streams }) => {
};

return (
<div className="p-8">
<div className="flex justify-between items-center mb-6">
<h1 className="text-2xl font-bold text-gray-800 dark:text-white">Incoming Streams</h1>
<div className="flex gap-4 items-center">
<label htmlFor="statusFilter" className="text-sm font-medium text-gray-500 dark:text-gray-400">Filter Status:</label>
<div className="bg-white/40 dark:bg-slate-900/40 backdrop-blur-md rounded-2xl border border-white/20 dark:border-white/10 shadow-xl overflow-hidden">
<div className="p-6 border-b border-white/20 dark:border-white/10 flex flex-col md:flex-row md:items-center justify-between gap-4">
<div>
<h2 className="text-xl font-bold text-gray-900 dark:text-white">Incoming Payment Streams</h2>
<p className="text-sm text-gray-500 dark:text-gray-400 mt-1">Manage and withdraw from your active incoming streams</p>
</div>
<div className="flex items-center gap-2">
<label htmlFor="filter" className="text-sm font-medium text-gray-700 dark:text-gray-300">Filter:</label>
<select
id="statusFilter"
id="filter"
value={filter}
onChange={handleFilterChange}
className="bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-md shadow-sm py-1.5 px-3 focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm"
className="bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 rounded-lg px-3 py-1 text-sm focus:ring-2 focus:ring-accent outline-none"
>
<option value="All">All Statuses</option>
<option value="All">All Streams</option>
<option value="Active">Active</option>
<option value="Completed">Completed</option>
<option value="Paused">Paused</option>
<option value="Completed">Completed</option>
</select>
</div>
</div>

<div className="overflow-x-auto bg-white dark:bg-gray-800 shadow rounded-lg">
<table className="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
<thead className="bg-gray-50 dark:bg-gray-900">
<div className="overflow-x-auto">
<table className="w-full text-left border-collapse">
<thead className="bg-gray-50/50 dark:bg-gray-800/50">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Sender</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Token</th>
Expand All @@ -81,8 +84,12 @@ const IncomingStreams: React.FC<IncomingStreamsProps> = ({ streams }) => {
</td>
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button
disabled={stream.status !== 'Active'}
onClick={handleWithdraw}
className="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 bg-blue-50 dark:bg-blue-900/20 px-3 py-1 rounded-md transition-colors"
className={`px-4 py-2 rounded-lg transition-all ${stream.status === 'Active'
? 'bg-accent text-white hover:bg-accent-hover shadow-lg'
: 'bg-gray-200 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed'
}`}
>
Withdraw
</button>
Expand All @@ -91,12 +98,13 @@ const IncomingStreams: React.FC<IncomingStreamsProps> = ({ streams }) => {
))}
</tbody>
</table>
{filteredStreams.length === 0 && (
<div className="p-8 text-center text-gray-500 dark:text-gray-400">
No {filter !== 'All' ? filter.toLowerCase() : ''} streams found.
</div>
)}
</div>

{filteredStreams.length === 0 && (
<div className="p-12 text-center">
<p className="text-gray-500 dark:text-gray-400">No incoming streams found matching the filter.</p>
</div>
)}
</div>
);
};
Expand Down
40 changes: 20 additions & 20 deletions frontend/lib/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Stream {
recipient: string;
amount: number;
token: string;
status: "Active" | "Completed" | "Cancelled";
status: "Active" | "Completed" | "Paused";
deposited: number;
withdrawn: number;
date: string;
Expand Down Expand Up @@ -146,34 +146,34 @@ export function getDashboardAnalytics(
{
id: "total-volume-30d",
label: "Total Volume (30D)",
detail: "All incoming and outgoing activity in the last 30 days",
detail: "Total throughput in the last 30 days",
format: "currency",
value: null,
unavailableText: "No recent activity data",
unavailableText: "Insufficient historical data",
},
{
id: "net-flow-30d",
label: "Net Flow (30D)",
detail: "Incoming minus outgoing activity over the same period",
detail: "Net capital flow over the last 30 days",
format: "currency",
value: null,
unavailableText: "No recent activity data",
unavailableText: "Insufficient historical data",
},
{
id: "avg-value-per-stream",
label: "Avg Locked Value / Active Stream",
detail: "Current TVL divided by active stream count",
label: "Avg Value / Stream",
detail: "Mean capital locked across active streams",
format: "currency",
value: null,
unavailableText: "No active stream data",
unavailableText: "No active streams",
},
{
id: "stream-utilization",
label: "Stream Utilization",
detail: "Total withdrawn as a share of total deposited funds",
detail: "Share of total capital already withdrawn",
format: "percent",
value: null,
unavailableText: "No stream funding data",
unavailableText: "No withdrawal data",
},
];
}
Expand Down Expand Up @@ -215,34 +215,34 @@ export function getDashboardAnalytics(
{
id: "total-volume-30d",
label: "Total Volume (30D)",
detail: "All incoming and outgoing activity in the last 30 days",
detail: "Total throughput in the last 30 days",
format: "currency",
value: recentActivity.length > 0 ? totalVolume30d : null,
unavailableText: "No activity in the last 30 days",
value: totalVolume30d,
unavailableText: "Insufficient historical data",
},
{
id: "net-flow-30d",
label: "Net Flow (30D)",
detail: "Incoming minus outgoing activity over the same period",
detail: "Net capital flow over the last 30 days",
format: "currency",
value: recentActivity.length > 0 ? netFlow30d : null,
unavailableText: "No activity in the last 30 days",
value: netFlow30d,
unavailableText: "Insufficient historical data",
},
{
id: "avg-value-per-stream",
label: "Avg Locked Value / Active Stream",
detail: "Current TVL divided by active stream count",
label: "Avg Value / Stream",
detail: "Mean capital locked across active streams",
format: "currency",
value: avgValuePerStream,
unavailableText: "No active streams",
},
{
id: "stream-utilization",
label: "Stream Utilization",
detail: "Total withdrawn as a share of total deposited funds",
detail: "Share of total capital already withdrawn",
format: "percent",
value: utilization,
unavailableText: "No deposited funds yet",
unavailableText: "No withdrawal data",
},
];
}
Loading