2026-01-07 09:31:02 +00:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
import { Button } from '../ui/button';
|
2026-02-09 22:31:52 +00:00
|
|
|
import { X, Repeat, MessageSquare, Link, Mail, Check } from 'lucide-react';
|
2026-01-07 09:31:02 +00:00
|
|
|
import { Post } from '../../types';
|
2026-01-26 13:12:17 +00:00
|
|
|
import { useToast } from '../../components/feedback/ToastProvider';
|
2026-02-09 22:31:52 +00:00
|
|
|
import { useCopyToClipboard } from '@/hooks/useCopyToClipboard';
|
2026-01-07 09:31:02 +00:00
|
|
|
|
|
|
|
|
interface SharePostModalProps {
|
|
|
|
|
post: Post;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
onConfirm: (type: 'repost' | 'quote', text?: string) => void;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
export const SharePostModal: React.FC<SharePostModalProps> = ({
|
|
|
|
|
post,
|
|
|
|
|
onClose,
|
|
|
|
|
onConfirm,
|
|
|
|
|
}) => {
|
2026-01-07 09:31:02 +00:00
|
|
|
const { addToast } = useToast();
|
|
|
|
|
const [mode, setMode] = useState<'options' | 'quote'>('options');
|
|
|
|
|
const [quoteText, setQuoteText] = useState('');
|
2026-02-09 22:31:52 +00:00
|
|
|
const { copied, copy } = useCopyToClipboard();
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-02-09 22:31:52 +00:00
|
|
|
const handleCopyLink = async () => {
|
|
|
|
|
const ok = await copy(`https://veza.io/post/${post.id}`);
|
|
|
|
|
if (ok) {
|
|
|
|
|
addToast('Link copied to clipboard', 'success');
|
|
|
|
|
onClose();
|
|
|
|
|
}
|
2026-01-07 09:31:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (mode === 'quote') {
|
2026-01-13 18:47:57 +00:00
|
|
|
return (
|
fix: UI remediation Phase 1 (S0-S5) + Phase 2 Sprint 6 shadow system
Phase 1:
- S0: Fix open redirect (safeNavigate), delete AuthContext/legacy auth, encrypt API keys, gitignore .env files
- S1: Split client.ts god object into 5 modules, unify toast system, delete unused Sidebar
- S2: Add glass button variant, migrate 32 z-index to SUMI tokens, fix card dark mode
- S3: Skip nav link, aria-hidden on icons, focus-visible ring fixes, alt attrs, aria-live regions
- S4: React.memo on list items, fix key={index}, loading=lazy on images
- S5: Branded loading screen, page transitions respect reduced-motion, LikeButton micro-interaction, i18n sidebar/header
Phase 2 Sprint 6:
- Wire Tailwind shadow utilities to SUMI tokens in @theme block (fixes 50+ files)
- Define shadow-card/shadow-card-hover tokens
- Remove dark:shadow-none workarounds from card.tsx (SUMI handles per-theme shadows)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 09:13:44 +00:00
|
|
|
<div className="fixed inset-0 z-[var(--sumi-z-modal)] flex items-center justify-center p-4">
|
2026-01-13 18:47:57 +00:00
|
|
|
<div
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
className="absolute inset-0 bg-background/90 backdrop-blur-sm"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={onClose}
|
|
|
|
|
></div>
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
<div className="relative w-full max-w-lg bg-muted border border-border rounded-xl shadow-2xl animate-scaleIn overflow-hidden">
|
|
|
|
|
<div className="p-4 border-b border-border bg-card flex justify-between items-center">
|
2026-02-12 01:09:29 +00:00
|
|
|
<h3 className="font-bold text-foreground">Quote Post</h3>
|
2026-01-13 18:47:57 +00:00
|
|
|
<button onClick={onClose}>
|
2026-02-12 01:09:29 +00:00
|
|
|
<X className="w-5 h-5 text-muted-foreground hover:text-foreground" />
|
2026-01-13 18:47:57 +00:00
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="p-4">
|
|
|
|
|
<textarea
|
2026-02-17 16:03:57 +00:00
|
|
|
className="w-full bg-transparent border-none text-foreground placeholder:text-muted-foreground focus:ring-0 resize-none h-24 mb-4"
|
2026-01-13 18:47:57 +00:00
|
|
|
placeholder="Add a comment..."
|
|
|
|
|
value={quoteText}
|
|
|
|
|
onChange={(e) => setQuoteText(e.target.value)}
|
|
|
|
|
autoFocus
|
|
|
|
|
/>
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
<div className="border border-border rounded-lg p-4 bg-card/30 opacity-70">
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="flex items-center gap-2 mb-2">
|
|
|
|
|
<img
|
|
|
|
|
src={post.author.avatar}
|
|
|
|
|
className="w-5 h-5 rounded-full"
|
|
|
|
|
/>
|
2026-02-12 01:09:29 +00:00
|
|
|
<span className="font-bold text-xs text-foreground">
|
2026-01-13 18:47:57 +00:00
|
|
|
{post.author.name}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-02-08 23:04:51 +00:00
|
|
|
<p className="text-xs text-muted-foreground line-clamp-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
{post.content}
|
|
|
|
|
</p>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
<div className="p-4 border-t border-border bg-card flex justify-end gap-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Button variant="ghost" onClick={() => setMode('options')}>
|
|
|
|
|
Back
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="primary"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
onConfirm('quote', quoteText);
|
|
|
|
|
onClose();
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
Quote
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
2026-01-07 09:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
fix: UI remediation Phase 1 (S0-S5) + Phase 2 Sprint 6 shadow system
Phase 1:
- S0: Fix open redirect (safeNavigate), delete AuthContext/legacy auth, encrypt API keys, gitignore .env files
- S1: Split client.ts god object into 5 modules, unify toast system, delete unused Sidebar
- S2: Add glass button variant, migrate 32 z-index to SUMI tokens, fix card dark mode
- S3: Skip nav link, aria-hidden on icons, focus-visible ring fixes, alt attrs, aria-live regions
- S4: React.memo on list items, fix key={index}, loading=lazy on images
- S5: Branded loading screen, page transitions respect reduced-motion, LikeButton micro-interaction, i18n sidebar/header
Phase 2 Sprint 6:
- Wire Tailwind shadow utilities to SUMI tokens in @theme block (fixes 50+ files)
- Define shadow-card/shadow-card-hover tokens
- Remove dark:shadow-none workarounds from card.tsx (SUMI handles per-theme shadows)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 09:13:44 +00:00
|
|
|
<div className="fixed inset-0 z-[var(--sumi-z-modal)] flex items-center justify-center p-4">
|
2026-01-13 18:47:57 +00:00
|
|
|
<div
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
className="absolute inset-0 bg-background/90 backdrop-blur-sm"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={onClose}
|
|
|
|
|
></div>
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
<div className="relative w-full max-w-sm bg-muted border border-border rounded-xl shadow-2xl animate-scaleIn overflow-hidden">
|
|
|
|
|
<div className="p-4 border-b border-border bg-card flex justify-between items-center">
|
2026-02-12 01:09:29 +00:00
|
|
|
<h3 className="font-bold text-foreground">Share Post</h3>
|
2026-01-13 18:47:57 +00:00
|
|
|
<button onClick={onClose}>
|
2026-02-12 01:09:29 +00:00
|
|
|
<X className="w-5 h-5 text-muted-foreground hover:text-foreground" />
|
2026-01-13 18:47:57 +00:00
|
|
|
</button>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="p-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
<button
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
className="w-full flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors group"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={() => {
|
|
|
|
|
onConfirm('repost');
|
|
|
|
|
onClose();
|
|
|
|
|
}}
|
|
|
|
|
>
|
2026-02-08 23:17:14 +00:00
|
|
|
<div className="w-10 h-10 rounded-full bg-success/10 flex items-center justify-center text-success group-hover:bg-success/20">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Repeat className="w-5 h-5" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-left">
|
2026-02-12 01:09:29 +00:00
|
|
|
<div className="text-foreground font-bold">Repost</div>
|
2026-02-08 23:04:51 +00:00
|
|
|
<div className="text-xs text-muted-foreground">
|
2026-01-13 18:47:57 +00:00
|
|
|
Instantly share with your followers
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</button>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<button
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
className="w-full flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors group"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={() => setMode('quote')}
|
|
|
|
|
>
|
refactor: Phase 3a — Global color class migration to SUMI semantics
- Replace all kodo-* color classes across ~100 TSX files:
kodo-void → background, kodo-ink → card, kodo-graphite → muted,
kodo-steel → muted-foreground, kodo-cyan → primary, kodo-magenta → destructive,
kodo-lime → success, kodo-red → destructive, kodo-gold → warning
- Replace cyan-500, magenta-500, lime-500 default Tailwind colors with
semantic equivalents (primary, destructive, success)
- Fix WaveformVisualizer hardcoded hex colors to SUMI values
- Delete global-effects.css (conflicting, redundant with index.css)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 00:51:49 +00:00
|
|
|
<div className="w-10 h-10 rounded-full bg-muted/10 flex items-center justify-center text-muted-foreground group-hover:bg-white/5">
|
2026-01-13 18:47:57 +00:00
|
|
|
<MessageSquare className="w-5 h-5" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-left">
|
2026-02-12 01:09:29 +00:00
|
|
|
<div className="text-foreground font-bold">Quote</div>
|
2026-02-08 23:04:51 +00:00
|
|
|
<div className="text-xs text-muted-foreground">
|
2026-01-13 18:47:57 +00:00
|
|
|
Repost with your own thoughts
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</button>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-02-08 23:08:42 +00:00
|
|
|
<div className="h-px bg-muted/50 my-2 mx-4"></div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<button
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
className="w-full flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors group"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={handleCopyLink}
|
|
|
|
|
>
|
2026-02-12 01:09:29 +00:00
|
|
|
<div className="w-10 h-10 rounded-full bg-muted flex items-center justify-center text-muted-foreground group-hover:text-foreground">
|
2026-02-09 22:31:52 +00:00
|
|
|
{copied ? <Check className="w-5 h-5 text-success" /> : <Link className="w-5 h-5" />}
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
<div className="text-left">
|
2026-02-12 01:09:29 +00:00
|
|
|
<div className="text-foreground font-bold">{copied ? 'Copied!' : 'Copy Link'}</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
className="w-full flex items-center gap-4 p-4 hover:bg-white/5 rounded-lg transition-colors group"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={() => {
|
|
|
|
|
addToast('Sent via DM');
|
|
|
|
|
onClose();
|
|
|
|
|
}}
|
|
|
|
|
>
|
2026-02-12 01:09:29 +00:00
|
|
|
<div className="w-10 h-10 rounded-full bg-muted flex items-center justify-center text-muted-foreground group-hover:text-foreground">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Mail className="w-5 h-5" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-left">
|
2026-02-12 01:09:29 +00:00
|
|
|
<div className="text-foreground font-bold">
|
2026-01-13 18:47:57 +00:00
|
|
|
Send via Direct Message
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</button>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|