-
Notifications
You must be signed in to change notification settings - Fork 231
feat(ui): Polish UI and refactor project page components #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
282bd00
feat: refactor NoProject component and improve VS Code-style alignment
norberia e2046aa
refactor: replace hardcoded colors with CSS variables across all proj…
norberia 2e42f56
Reorder import statements in projects page
norberia 08a21a8
Merge branch 'FullstackAgent:main' into style/vscode-alignment
norberia acb8bdb
update sidebar colors
norberia 97b01eb
update globals.css
norberia 90140dd
Refactor: Extract project page components and improve data fetching
norberia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { memo } from 'react'; | ||
| import { Folder, Plus } from 'lucide-react'; | ||
| import Link from 'next/link'; | ||
|
|
||
| import { Button } from '@/components/ui/button'; | ||
|
|
||
| interface PageHeaderProps { | ||
| projectsCount: number; | ||
| className?: string; | ||
| } | ||
|
|
||
| const PageHeader = memo(({ projectsCount, className }: PageHeaderProps) => { | ||
| return ( | ||
| <div className={`h-12 bg-card border-b border-border flex items-center justify-between px-4 ${className || ''}`}> | ||
| <div className="flex items-center gap-3"> | ||
| <Folder className="h-4 w-4 text-muted-foreground" /> | ||
| <h1 className="text-sm font-medium text-foreground">Projects</h1> | ||
| <span className="text-xs text-muted-foreground">({projectsCount})</span> | ||
| </div> | ||
| <Link href="/projects/new"> | ||
| <Button | ||
| size="sm" | ||
| className="h-7 bg-primary hover:bg-primary/90 text-primary-foreground text-xs px-3" | ||
| > | ||
| <Plus className="mr-1 h-3 w-3" /> | ||
| New Project | ||
| </Button> | ||
| </Link> | ||
| </div> | ||
| ); | ||
| }); | ||
|
|
||
| PageHeader.displayName = 'PageHeader'; | ||
|
|
||
| export default PageHeader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import { memo } from 'react'; | ||
| import { Clock } from 'lucide-react'; | ||
| import Link from 'next/link'; | ||
|
|
||
| import { cn } from '@/lib/utils'; | ||
| import { Project } from '@/types/project'; | ||
|
|
||
| interface ProjectCardProps { | ||
| project: Project; | ||
| } | ||
|
|
||
| const ProjectCard = memo(({ project }: ProjectCardProps) => { | ||
| return ( | ||
| <Link href={`/projects/${project.id}`}> | ||
| <div className="group bg-card border border-border hover:border-primary rounded-lg transition-all cursor-pointer p-3"> | ||
| {/* Header */} | ||
| <div className="flex items-start justify-between mb-2"> | ||
| <div className="flex-1 min-w-0"> | ||
| <h3 className="text-sm font-medium text-foreground truncate"> | ||
| {project.name} | ||
| </h3> | ||
| </div> | ||
| <div | ||
| className={cn( | ||
| 'h-2 w-2 rounded-full shrink-0 ml-2 mt-1', | ||
| project.status === 'RUNNING' && 'bg-green-600 dark:bg-green-500', | ||
| project.status === 'STOPPED' && 'bg-muted-foreground', | ||
| project.status === 'STARTING' && 'bg-yellow-600 dark:bg-yellow-500 animate-pulse', | ||
| project.status === 'STOPPING' && 'bg-yellow-600 dark:bg-yellow-500 animate-pulse', | ||
| project.status === 'CREATING' && 'bg-blue-600 dark:bg-blue-500 animate-pulse', | ||
| project.status === 'TERMINATING' && 'bg-red-600 dark:bg-red-500 animate-pulse', | ||
| project.status === 'ERROR' && 'bg-destructive', | ||
| project.status === 'PARTIAL' && 'bg-orange-600 dark:bg-orange-500' | ||
| )} | ||
| /> | ||
| </div> | ||
|
|
||
| {/* Description */} | ||
| <p className="text-xs text-muted-foreground line-clamp-2 mb-3 min-h-[2.5rem]"> | ||
| {project.description || 'No description'} | ||
| </p> | ||
|
|
||
| {/* Footer */} | ||
| <div className="flex items-center justify-between pt-2 border-t border-border"> | ||
| <span className="text-xs text-muted-foreground">{project.status}</span> | ||
| <div className="flex items-center gap-1 text-xs text-muted-foreground"> | ||
| <Clock className="h-3 w-3" /> | ||
| <span> | ||
| {new Date(project.updatedAt).toLocaleDateString('en-US', { | ||
| month: 'short', | ||
| day: 'numeric', | ||
| })} | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </Link> | ||
| ); | ||
| }); | ||
|
|
||
| ProjectCard.displayName = 'ProjectCard'; | ||
|
|
||
| export default ProjectCard; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.