From e30cc48e85e4bff6ba89abd62404e69d5f2e348c Mon Sep 17 00:00:00 2001 From: Kalidou Diagne Date: Mon, 30 Jun 2025 13:18:17 +0100 Subject: [PATCH] General fixes part 7 (#484) fix issue #483 fix issue #477 --- app/(pages)/blog/[slug]/page.tsx | 20 +++++++- .../projects/sections/ProjectContent.tsx | 32 ++++++------ app/layout.tsx | 3 ++ components/blog/articles-list.tsx | 49 ++++++++++--------- config/site.ts | 6 ++- 5 files changed, 69 insertions(+), 41 deletions(-) diff --git a/app/(pages)/blog/[slug]/page.tsx b/app/(pages)/blog/[slug]/page.tsx index 517e6ba..617317e 100644 --- a/app/(pages)/blog/[slug]/page.tsx +++ b/app/(pages)/blog/[slug]/page.tsx @@ -1,9 +1,12 @@ +import { LABELS } from "@/app/labels" import { blogArticleCardTagCardVariants } from "@/components/blog/blog-article-card" import { BlogContent } from "@/components/blog/blog-content" +import { Icons } from "@/components/icons" import { AppContent } from "@/components/ui/app-content" import { Button } from "@/components/ui/button" import { Label } from "@/components/ui/label" import { Markdown } from "@/components/ui/markdown" +import { siteConfig } from "@/config/site" import { getArticles, getArticleById } from "@/lib/content" import { cn, getBackgroundImage } from "@/lib/utils" import { Metadata } from "next" @@ -67,7 +70,22 @@ export default function BlogArticle({ params }: any) { post?.tldr?.toLowerCase()?.includes("newsletter") return ( -
+
+ + +
{ const { project } = getProjectById(id) ?? {} const hasSocialLinks = Object.keys(project?.links ?? {}).length > 0 - const editPageURL = siteConfig?.editProjectPage(project?.id as string) const ProjectStatusMessageMap: Record = { [ProjectStatus.ACTIVE]: "", @@ -87,7 +86,22 @@ export const ProjectContent = ({ id }: { id: string }) => { } return ( -
+
+ + +
@@ -200,20 +214,6 @@ export const ProjectContent = ({ id }: { id: string }) => { {!isResearchProject && ( )} -
- - - - {LABELS.COMMON.EDIT_THIS_PAGE} - - -
diff --git a/app/layout.tsx b/app/layout.tsx index dc6915e..ccbeea6 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -111,6 +111,9 @@ export const metadata: Metadata = { ], }, }, + icons: { + icon: "/favicon.svg", + }, } interface RootLayoutProps { diff --git a/components/blog/articles-list.tsx b/components/blog/articles-list.tsx index fbb71b0..f3d3934 100644 --- a/components/blog/articles-list.tsx +++ b/components/blog/articles-list.tsx @@ -3,7 +3,6 @@ import { useQuery } from "@tanstack/react-query" import { Article, ArticleTag } from "@/lib/content" import { ArticleListCard } from "./article-list-card" -import Link from "next/link" import { cva } from "class-variance-authority" import { ArticleInEvidenceCard } from "./article-in-evidance-card" import { Input } from "../ui/input" @@ -11,8 +10,8 @@ import { Button } from "../ui/button" import { LABELS } from "@/app/labels" import { Search as SearchIcon } from "lucide-react" import { useState } from "react" -import { useDebounce } from "react-use" -import { useParams, useRouter, useSearchParams } from "next/navigation" +import { useDebounce, useMedia } from "react-use" +import { useRouter, useSearchParams } from "next/navigation" const ArticleTitle = cva( "text-white font-display hover:text-anakiwa-400 transition-colors group-hover:text-anakiwa-400", @@ -121,6 +120,8 @@ export const ArticlesList: React.FC = ({ [searchQuery] ) + const isMobile = useMedia("(max-width: 768px)") + return (
{!hasTag && !hasSearchParams && searchQuery !== "all" && ( @@ -132,35 +133,39 @@ export const ArticlesList: React.FC = ({ className="h-full " asLink /> - <> + {isMobile && ( + <> + {featuredArticles?.map((article: Article) => { + return ( + + ) + })} + + )} +
+ {!isMobile && ( +
{featuredArticles?.map((article: Article) => { return ( ) })} - -
-
- {featuredArticles?.map((article: Article) => { - return ( - - ) - })} -
+
+ )}
)}
diff --git a/config/site.ts b/config/site.ts index da99ec5..76dd938 100644 --- a/config/site.ts +++ b/config/site.ts @@ -27,7 +27,9 @@ export const siteConfig = { "https://docs.google.com/forms/d/e/1FAIpQLSendzYY0z_z7fZ37g3jmydvzS9I7OWKbY2JrqAnyNqeaBHvMQ/viewform", }, addGithubResource: - "https://github.com/privacy-scaling-explorations/website-v2/blob/main/app/%5Blang%5D/content/resources.md", + "https://github.com/privacy-scaling-explorations/website-v2/blob/main/content/resources.md", editProjectPage: (id: string) => - `https://github.com/privacy-scaling-explorations/pse.dev/blob/main/data/projects/${id}.ts`, + `https://github.com/privacy-scaling-explorations/website-v2/blob/main/content/projects/${id}.md`, + editBlogPage: (slug: string) => + `https://github.com/privacy-scaling-explorations/website-v2/blob/main/content/articles/${slug}.md`, }