Skip to content

Commit

Permalink
Merge pull request #83 from privacy-scaling-explorations/project-status
Browse files Browse the repository at this point in the history
project status
  • Loading branch information
kalidiagne authored Sep 8, 2023
2 parents c7c8407 + ab730b3 commit c38c64f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 42 deletions.
40 changes: 2 additions & 38 deletions app/projects/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ import { projects } from "@/data/projects"
import GithubVector from "@/public/social-medias/github-fill.svg"
import GlobalVector from "@/public/social-medias/global-line.svg"
import TwitterVector from "@/public/social-medias/twitter-fill.svg"
import {
FilterLabelMapping,
ProjectFilter,
filterProjects,
} from "@/state/useProjectFiltersState"
import { filterProjects } from "@/state/useProjectFiltersState"

import { ProjectInterface } from "@/lib/types"
import { shuffleArray } from "@/lib/utils"
import { CategoryTag } from "@/components/ui/categoryTag"
import { Markdown } from "@/components/ui/markdown"
import { Icons } from "@/components/icons"
import ProjectCard from "@/components/project/project-card"
import { ProjectTags } from "@/components/project/project-detail-tags"
import ProjectExtraLinks from "@/components/project/project-extra-links"

type PageProps = {
Expand Down Expand Up @@ -55,38 +51,6 @@ export async function generateMetadata(
}
}

function ProjectTags({ project }: ProjectProps) {
return (
<div className="flex flex-col gap-4 mt-8">
{Object.entries(FilterLabelMapping).map(([key, label]) => {
const keyTags = project?.tags?.[key as ProjectFilter]
const hasItems = keyTags && keyTags?.length > 0

return (
hasItems && (
<div>
<div className="flex items-center gap-2">
<span className="py-2 text-base font-medium ">{label}</span>
<div className="flex gap-[6px] flex-wrap">
{keyTags?.map((tag) => {
return (
<Link href={`/projects?${key}=${tag}`}>
<CategoryTag key={tag} variant="gray">
{tag}
</CategoryTag>
</Link>
)
})}
</div>
</div>
</div>
)
)
})}
</div>
)
}

function DiscoverMoreProjects({ project }: ProjectProps) {
const getSuggestedProjects = () => {
const projectList = projects.filter((p) => p.id !== project.id)
Expand Down
6 changes: 3 additions & 3 deletions components/project/project-detail-tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface TagsProps extends HtmlHTMLAttributes<HTMLDivElement> {

const TagsWrapper = ({ label, children }: TagsProps) => {
return (
<div className="flex gap-2">
<div className="flex items-center gap-2">
<span className="py-2 text-base font-medium ">{label}</span>
{children}
</div>
Expand All @@ -40,7 +40,7 @@ export function ProjectTags({ project }: { project: ProjectInterface }) {
hasItems && (
<div>
<TagsWrapper label={label}>
<div className="flex gap-[6px]">
<div className="flex gap-[6px] flex-wrap">
{keyTags?.map((tag) => {
return (
<Link href={`/projects?${key}=${tag}`}>
Expand All @@ -57,7 +57,7 @@ export function ProjectTags({ project }: { project: ProjectInterface }) {
)
})}
<TagsWrapper label="Project status">
<CategoryTag variant="gray">
<CategoryTag variant="gray" size="default">
<div className="flex items-center gap-1">
{icon}
{label}
Expand Down
2 changes: 1 addition & 1 deletion components/ui/categoryTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { cn } from "@/lib/utils"
import { Icons } from "../icons"

const categoryTagVariants = cva(
"flex p-[6px] gap-2 rounded-[6px] inline-flex items-center",
"flex gap-2 rounded-[6px] inline-flex items-center",
{
variants: {
variant: {
Expand Down

1 comment on commit c38c64f

@vercel
Copy link

@vercel vercel bot commented on c38c64f Sep 8, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.