mirror of
https://github.com/FranP-code/format_twitter_projects_accounts_tweets.git
synced 2025-10-13 00:32:19 +00:00
Fix circular icons, checkbox placement, and table overflow
This commit is contained in:
committed by
GitHub
parent
fcfac33230
commit
cab98166fb
@@ -36,7 +36,7 @@ export function ProjectCard({ project, onSeenStatusChange }: ProjectCardProps) {
|
|||||||
{/* Author Info */}
|
{/* Author Info */}
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex items-center space-x-3">
|
<div className="flex items-center space-x-3">
|
||||||
<div className="w-10 h-10 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white font-semibold">
|
<div className="w-10 h-10 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white font-semibold flex-shrink-0">
|
||||||
{project.author_name.charAt(0).toUpperCase()}
|
{project.author_name.charAt(0).toUpperCase()}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -44,27 +44,9 @@ export function ProjectCard({ project, onSeenStatusChange }: ProjectCardProps) {
|
|||||||
<p className="text-sm text-muted-foreground">@{project.author_screen_name}</p>
|
<p className="text-sm text-muted-foreground">@{project.author_screen_name}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-2">
|
|
||||||
<div className="ml-auto text-xs text-muted-foreground">
|
<div className="ml-auto text-xs text-muted-foreground">
|
||||||
{formattedDate}
|
{formattedDate}
|
||||||
</div>
|
</div>
|
||||||
{/* Seen Checkbox */}
|
|
||||||
<div className="flex items-center space-x-2">
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
id={`seen-${project.id}`}
|
|
||||||
className="w-4 h-4 rounded border-border bg-background"
|
|
||||||
checked={seen}
|
|
||||||
onChange={toggleSeen}
|
|
||||||
/>
|
|
||||||
<label
|
|
||||||
htmlFor={`seen-${project.id}`}
|
|
||||||
className="text-sm text-muted-foreground cursor-pointer"
|
|
||||||
>
|
|
||||||
Seen
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Project Media */}
|
{/* Project Media */}
|
||||||
@@ -81,7 +63,25 @@ export function ProjectCard({ project, onSeenStatusChange }: ProjectCardProps) {
|
|||||||
|
|
||||||
{/* Project Description */}
|
{/* Project Description */}
|
||||||
<div>
|
<div>
|
||||||
<p className="text-foreground leading-relaxed">{project.project_description}</p>
|
<div className="flex items-start justify-between gap-4">
|
||||||
|
<p className="text-foreground leading-relaxed flex-1">{project.project_description}</p>
|
||||||
|
{/* Seen Checkbox - moved here */}
|
||||||
|
<div className="flex items-center space-x-2 flex-shrink-0">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
id={`seen-${project.id}`}
|
||||||
|
className="w-4 h-4 rounded border-border bg-background"
|
||||||
|
checked={seen}
|
||||||
|
onChange={toggleSeen}
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
htmlFor={`seen-${project.id}`}
|
||||||
|
className="text-sm text-muted-foreground cursor-pointer"
|
||||||
|
>
|
||||||
|
Seen
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Project Actions */}
|
{/* Project Actions */}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
size: 180,
|
size: 160,
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor('project_description', {
|
columnHelper.accessor('project_description', {
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
@@ -140,7 +140,7 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
<p className="text-sm leading-relaxed line-clamp-3 pr-2">{row.original.project_description}</p>
|
<p className="text-sm leading-relaxed line-clamp-3 pr-2">{row.original.project_description}</p>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
size: 300,
|
size: 280,
|
||||||
}),
|
}),
|
||||||
columnHelper.display({
|
columnHelper.display({
|
||||||
id: 'links',
|
id: 'links',
|
||||||
@@ -181,7 +181,7 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
size: 90,
|
size: 80,
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor('media_thumbnail', {
|
columnHelper.accessor('media_thumbnail', {
|
||||||
header: 'Media',
|
header: 'Media',
|
||||||
@@ -201,7 +201,7 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
size: 130,
|
size: 100,
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor('created_at', {
|
columnHelper.accessor('created_at', {
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
@@ -227,7 +227,7 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
: 'N/A'}
|
: 'N/A'}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
size: 120,
|
size: 100,
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor('category', {
|
columnHelper.accessor('category', {
|
||||||
header: ({ column }) => (
|
header: ({ column }) => (
|
||||||
@@ -253,7 +253,7 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
size: 120,
|
size: 100,
|
||||||
})
|
})
|
||||||
], [showUrlColumn, seenProjects]);
|
], [showUrlColumn, seenProjects]);
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
}, [projects]);
|
}, [projects]);
|
||||||
|
|
||||||
// Calculate total width
|
// Calculate total width
|
||||||
const totalWidth = table.getHeaderGroups()[0]?.headers.reduce((acc, header) => acc + header.getSize(), 0) || 850;
|
const totalWidth = table.getHeaderGroups()[0]?.headers.reduce((acc, header) => acc + header.getSize(), 0) || 800;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
@@ -329,9 +329,9 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
|
|
||||||
{/* Table Container */}
|
{/* Table Container */}
|
||||||
<div className="border rounded-lg bg-card overflow-hidden">
|
<div className="border rounded-lg bg-card overflow-hidden">
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full">
|
||||||
{/* Fixed Header */}
|
{/* Fixed Header */}
|
||||||
<div className="sticky top-0 z-10 bg-muted/50 border-b" style={{ minWidth: `${totalWidth}px` }}>
|
<div className="sticky top-0 z-10 bg-muted/50 border-b">
|
||||||
{table.getHeaderGroups().map((headerGroup) => (
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
<div key={headerGroup.id} className="grid" style={{ gridTemplateColumns: headerGroup.headers.map(h => `${h.getSize()}px`).join(' ') }}>
|
<div key={headerGroup.id} className="grid" style={{ gridTemplateColumns: headerGroup.headers.map(h => `${h.getSize()}px`).join(' ') }}>
|
||||||
{headerGroup.headers.map((header) => (
|
{headerGroup.headers.map((header) => (
|
||||||
@@ -352,7 +352,6 @@ export function ProjectsTable({ projects, title, showUrlColumn = true, onSeenSta
|
|||||||
<div
|
<div
|
||||||
ref={parentRef}
|
ref={parentRef}
|
||||||
className="h-[600px] overflow-auto relative"
|
className="h-[600px] overflow-auto relative"
|
||||||
style={{ minWidth: `${totalWidth}px` }}
|
|
||||||
>
|
>
|
||||||
<div style={{ height: `${virtualizer.getTotalSize()}px` }}>
|
<div style={{ height: `${virtualizer.getTotalSize()}px` }}>
|
||||||
{virtualizer.getVirtualItems().map((virtualRow) => {
|
{virtualizer.getVirtualItems().map((virtualRow) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user