Spaces:
Paused
Paused
CBV01 commited on
Commit ·
0bfcc32
1
Parent(s): 061901d
style(campaigns): set 2 grid cards per row and localize color to angled top beam
Browse files
frontend/src/app/campaigns/page.tsx
CHANGED
|
@@ -507,11 +507,11 @@ export default function CampaignsPage() {
|
|
| 507 |
switch (status) {
|
| 508 |
case 'completed':
|
| 509 |
return {
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
iconBg: 'bg-
|
| 513 |
-
dotColor: 'bg-
|
| 514 |
-
accentText: 'text-
|
| 515 |
ringColor: '#2dd4bf',
|
| 516 |
statusText: 'COMPLETED',
|
| 517 |
actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
|
|
@@ -520,22 +520,22 @@ export default function CampaignsPage() {
|
|
| 520 |
case 'active':
|
| 521 |
case 'running':
|
| 522 |
return {
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
iconBg: 'bg-
|
| 526 |
-
dotColor: 'bg-
|
| 527 |
-
accentText: 'text-
|
| 528 |
ringColor: '#34d399',
|
| 529 |
statusText: 'ACTIVE',
|
| 530 |
actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
|
| 531 |
};
|
| 532 |
case 'paused':
|
| 533 |
return {
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
iconBg: 'bg-
|
| 537 |
-
dotColor: 'bg-
|
| 538 |
-
accentText: 'text-
|
| 539 |
ringColor: '#fbbf24',
|
| 540 |
statusText: 'PAUSED',
|
| 541 |
actionBtn: 'bg-[#12281d] text-[#34d399] hover:bg-[#183526] border border-emerald-500/30'
|
|
@@ -543,20 +543,20 @@ export default function CampaignsPage() {
|
|
| 543 |
case 'failed':
|
| 544 |
case 'error':
|
| 545 |
return {
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
iconBg: 'bg-
|
| 549 |
-
dotColor: 'bg-
|
| 550 |
-
accentText: 'text-
|
| 551 |
ringColor: '#fb7185',
|
| 552 |
statusText: 'FAILED',
|
| 553 |
actionBtn: 'bg-rose-950/70 text-rose-400 hover:bg-rose-900/70 border border-rose-500/30'
|
| 554 |
};
|
| 555 |
default:
|
| 556 |
return {
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
iconBg: 'bg-
|
| 560 |
dotColor: 'bg-neutral-400',
|
| 561 |
accentText: 'text-neutral-400',
|
| 562 |
ringColor: '#64748b',
|
|
@@ -705,8 +705,8 @@ export default function CampaignsPage() {
|
|
| 705 |
</button>
|
| 706 |
</div>
|
| 707 |
) : viewMode === 'grid' ? (
|
| 708 |
-
/* Natural Modern Grid Cards
|
| 709 |
-
<div className="grid grid-cols-1
|
| 710 |
{filteredCampaigns.map((camp) => {
|
| 711 |
const progressPct = Math.min(100, Math.round(((camp.sent_count || 0) / Math.max(1, camp.total_targets || 1)) * 100));
|
| 712 |
let failedCount = 0;
|
|
@@ -747,8 +747,14 @@ export default function CampaignsPage() {
|
|
| 747 |
return (
|
| 748 |
<div
|
| 749 |
key={camp.id}
|
| 750 |
-
className=
|
|
|
|
| 751 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 752 |
<div>
|
| 753 |
{/* Header: Icon, Title, Status & Action Button */}
|
| 754 |
<div className="flex items-start justify-between gap-3 mb-2.5">
|
|
@@ -953,8 +959,13 @@ export default function CampaignsPage() {
|
|
| 953 |
return (
|
| 954 |
<div
|
| 955 |
key={camp.id}
|
| 956 |
-
className=
|
|
|
|
| 957 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 958 |
<div className="flex items-center gap-3.5 min-w-0">
|
| 959 |
<div className={`w-11 h-11 rounded-2xl flex items-center justify-center shrink-0 ${cardStyle.iconBg}`}>
|
| 960 |
<Zap size={20} className="fill-current" />
|
|
|
|
| 507 |
switch (status) {
|
| 508 |
case 'completed':
|
| 509 |
return {
|
| 510 |
+
topBeamColor: 'from-transparent via-teal-400 to-transparent',
|
| 511 |
+
radialGlow: 'radial-gradient(circle at 45% -20%, rgba(45, 212, 191, 0.12) 0%, rgba(45, 212, 191, 0.02) 40%, transparent 70%)',
|
| 512 |
+
iconBg: 'bg-[#102422] text-[#2dd4bf]',
|
| 513 |
+
dotColor: 'bg-[#2dd4bf]',
|
| 514 |
+
accentText: 'text-[#2dd4bf]',
|
| 515 |
ringColor: '#2dd4bf',
|
| 516 |
statusText: 'COMPLETED',
|
| 517 |
actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
|
|
|
|
| 520 |
case 'active':
|
| 521 |
case 'running':
|
| 522 |
return {
|
| 523 |
+
topBeamColor: 'from-transparent via-emerald-400 to-transparent',
|
| 524 |
+
radialGlow: 'radial-gradient(circle at 45% -20%, rgba(52, 211, 153, 0.12) 0%, rgba(52, 211, 153, 0.02) 40%, transparent 70%)',
|
| 525 |
+
iconBg: 'bg-[#13271d] text-[#34d399]',
|
| 526 |
+
dotColor: 'bg-[#34d399]',
|
| 527 |
+
accentText: 'text-[#34d399]',
|
| 528 |
ringColor: '#34d399',
|
| 529 |
statusText: 'ACTIVE',
|
| 530 |
actionBtn: 'bg-white/[0.04] text-neutral-300 hover:bg-white/[0.08] border border-white/[0.08]'
|
| 531 |
};
|
| 532 |
case 'paused':
|
| 533 |
return {
|
| 534 |
+
topBeamColor: 'from-transparent via-amber-400 to-transparent',
|
| 535 |
+
radialGlow: 'radial-gradient(circle at 50% -20%, rgba(251, 191, 36, 0.12) 0%, rgba(251, 191, 36, 0.02) 40%, transparent 70%)',
|
| 536 |
+
iconBg: 'bg-[#272012] text-[#fbbf24]',
|
| 537 |
+
dotColor: 'bg-[#fbbf24]',
|
| 538 |
+
accentText: 'text-[#fbbf24]',
|
| 539 |
ringColor: '#fbbf24',
|
| 540 |
statusText: 'PAUSED',
|
| 541 |
actionBtn: 'bg-[#12281d] text-[#34d399] hover:bg-[#183526] border border-emerald-500/30'
|
|
|
|
| 543 |
case 'failed':
|
| 544 |
case 'error':
|
| 545 |
return {
|
| 546 |
+
topBeamColor: 'from-transparent via-rose-400 to-transparent',
|
| 547 |
+
radialGlow: 'radial-gradient(circle at 45% -20%, rgba(244, 63, 94, 0.12) 0%, rgba(244, 63, 94, 0.02) 40%, transparent 70%)',
|
| 548 |
+
iconBg: 'bg-[#271216] text-[#fb7185]',
|
| 549 |
+
dotColor: 'bg-[#fb7185]',
|
| 550 |
+
accentText: 'text-[#fb7185]',
|
| 551 |
ringColor: '#fb7185',
|
| 552 |
statusText: 'FAILED',
|
| 553 |
actionBtn: 'bg-rose-950/70 text-rose-400 hover:bg-rose-900/70 border border-rose-500/30'
|
| 554 |
};
|
| 555 |
default:
|
| 556 |
return {
|
| 557 |
+
topBeamColor: 'from-transparent via-white/20 to-transparent',
|
| 558 |
+
radialGlow: 'none',
|
| 559 |
+
iconBg: 'bg-[#1a1e24] text-neutral-400',
|
| 560 |
dotColor: 'bg-neutral-400',
|
| 561 |
accentText: 'text-neutral-400',
|
| 562 |
ringColor: '#64748b',
|
|
|
|
| 705 |
</button>
|
| 706 |
</div>
|
| 707 |
) : viewMode === 'grid' ? (
|
| 708 |
+
/* Natural Modern Grid Cards - Two Per Line (Matching Screenshot) */
|
| 709 |
+
<div className="grid grid-cols-1 lg:grid-cols-2 gap-5">
|
| 710 |
{filteredCampaigns.map((camp) => {
|
| 711 |
const progressPct = Math.min(100, Math.round(((camp.sent_count || 0) / Math.max(1, camp.total_targets || 1)) * 100));
|
| 712 |
let failedCount = 0;
|
|
|
|
| 747 |
return (
|
| 748 |
<div
|
| 749 |
key={camp.id}
|
| 750 |
+
className="relative rounded-2xl bg-[#111513] border border-white/[0.05] p-6 transition-all duration-300 hover:translate-y-[-2px] flex flex-col justify-between group/card shadow-sm overflow-hidden"
|
| 751 |
+
style={{ backgroundImage: cardStyle.radialGlow !== 'none' ? cardStyle.radialGlow : undefined }}
|
| 752 |
>
|
| 753 |
+
{/* Angled Glowing Top Beam */}
|
| 754 |
+
<div
|
| 755 |
+
className={`absolute -top-px left-[15%] right-[15%] h-[2px] bg-gradient-to-r ${cardStyle.topBeamColor} pointer-events-none`}
|
| 756 |
+
/>
|
| 757 |
+
|
| 758 |
<div>
|
| 759 |
{/* Header: Icon, Title, Status & Action Button */}
|
| 760 |
<div className="flex items-start justify-between gap-3 mb-2.5">
|
|
|
|
| 959 |
return (
|
| 960 |
<div
|
| 961 |
key={camp.id}
|
| 962 |
+
className="relative rounded-2xl bg-[#111513] border border-white/[0.05] p-4 transition-all flex flex-col md:flex-row md:items-center justify-between gap-4 group/card overflow-hidden"
|
| 963 |
+
style={{ backgroundImage: cardStyle.radialGlow !== 'none' ? cardStyle.radialGlow : undefined }}
|
| 964 |
>
|
| 965 |
+
{/* Angled Glowing Top Beam */}
|
| 966 |
+
<div
|
| 967 |
+
className={`absolute -top-px left-[20%] right-[20%] h-[2px] bg-gradient-to-r ${cardStyle.topBeamColor} pointer-events-none`}
|
| 968 |
+
/>
|
| 969 |
<div className="flex items-center gap-3.5 min-w-0">
|
| 970 |
<div className={`w-11 h-11 rounded-2xl flex items-center justify-center shrink-0 ${cardStyle.iconBg}`}>
|
| 971 |
<Zap size={20} className="fill-current" />
|