Skip to content
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

Fix/improve-responsiveness-projectCards #132

Merged
merged 2 commits into from
Nov 1, 2024
Merged
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
4 changes: 2 additions & 2 deletions frontend/components/projects/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Projects({ isWorkspaceEnabled }: ProjectsProps) {
{[...Array(5).keys()].map((_, index) => (
<div key={index} className="flex flex-col">
<Skeleton className="h-8 w-1/3 mb-4" />
<div className="grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
<div className="grid gap-4 grid-cols-1 max-[768px]:grid-cols-1 md:grid-cols-1 lg:grid-cols-2 min-[1441px]:grid-cols-3">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom media queries max-[768px] and min-[1441px] are not standard Tailwind CSS syntax. Consider using Tailwind's built-in responsive utilities like sm:, md:, lg:, xl:, and 2xl: for better maintainability and consistency.

Suggested change
<div className="grid gap-4 grid-cols-1 max-[768px]:grid-cols-1 md:grid-cols-1 lg:grid-cols-2 min-[1441px]:grid-cols-3">
<div className="grid gap-4 grid-cols-1 sm:grid-cols-1 md:grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3">

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, but this was intentional. We will migrate this to flex-wrap eventually

<Skeleton className="h-32 w-96" />
<Skeleton className="h-32 w-96" />
</div>
Expand All @@ -67,7 +67,7 @@ export default function Projects({ isWorkspaceEnabled }: ProjectsProps) {
</div>
)}
{workspace.projects.length > 0 && (
<div className="grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
<div className="grid gap-4 grid-cols-1 max-[768px]:grid-cols-1 md:grid-cols-1 lg:grid-cols-2 min-[1441px]:grid-cols-3">
{workspace.projects.map((project) => (
<ProjectCard key={project.id} project={project} />
))}
Expand Down