Merge branch 'main' into blog-section

This commit is contained in:
Kalidou Diagne
2025-04-09 09:06:51 +03:00
85 changed files with 1961 additions and 1522 deletions

View File

@@ -1,25 +1,25 @@
import { ReactNode } from 'react'
import { ReactNode } from "react"
export enum ProjectCategory {
APPLICATION = 'APPLICATIONS',
DEVTOOLS = 'DEVTOOLS',
RESEARCH = 'RESEARCH',
APPLICATION = "APPLICATIONS",
DEVTOOLS = "DEVTOOLS",
RESEARCH = "RESEARCH", // Category has now it's own page
}
export const ProjectCategories = Object.values(ProjectCategory) as string[]
// list of project groups
export const ProjectSections = [
'pse',
'grant',
'collaboration',
'archived',
"pse",
"grant",
"collaboration",
"archived",
] as const
export type ProjectSection = (typeof ProjectSections)[number]
export enum ProjectStatus {
ACTIVE = 'active',
INACTIVE = 'inactive',
MAINTAINED = 'maintained',
ACTIVE = "active",
INACTIVE = "inactive",
MAINTAINED = "maintained",
}
export interface Faq {
question: string
@@ -27,30 +27,30 @@ export interface Faq {
}
export const ProjectCategoryLabelMapping: Record<ProjectCategory, string> = {
[ProjectCategory.APPLICATION]: 'DEVTOOLS',
[ProjectCategory.DEVTOOLS]: 'APPLICATIONS',
[ProjectCategory.RESEARCH]: 'RESEARCH',
[ProjectCategory.APPLICATION]: "DEVTOOLS",
[ProjectCategory.DEVTOOLS]: "APPLICATIONS",
[ProjectCategory.RESEARCH]: "RESEARCH", // Category has now it's own page
}
export const ProjectSectionLabelMapping: Record<ProjectSection, string> = {
pse: 'PSE projects',
grant: 'Grants',
collaboration: 'Collaborations',
archived: 'Archived',
pse: "PSE projects",
grant: "Grants",
collaboration: "Collaborations",
archived: "Archived",
}
export const ProjectStatusLabelMapping: Record<ProjectStatus, string> = {
active: 'Active',
inactive: 'Inactive',
maintained: 'Maintained',
active: "Active",
inactive: "Inactive",
maintained: "Maintained",
}
export const ProjectStatusDescriptionMapping: Record<ProjectStatus, string> = {
active: 'These projects are under active development by PSE-supported teams',
active: "These projects are under active development by PSE-supported teams",
inactive:
'The projects in our archive are not currently being worked on by PSE, but we encourage everyone to check out their findings and continue experimentation!',
"The projects in our archive are not currently being worked on by PSE, but we encourage everyone to check out their findings and continue experimentation!",
maintained:
'Maintenance projects are still being monitored for bug fixes, but are not under active feature development',
"Maintenance projects are still being monitored for bug fixes, but are not under active feature development",
}
export interface AnnounceInterface {
@@ -65,7 +65,7 @@ export interface AnnounceInterface {
}
}[]
embeds?: {
type: 'link' | 'article'
type: "link" | "article"
url: string
title: string
description: string
@@ -83,21 +83,21 @@ export interface NewsInterface {
}
export type ProjectLinkWebsite =
| 'github'
| 'website'
| 'discord'
| 'twitter'
| 'youtube'
| 'telegram'
| "github"
| "website"
| "discord"
| "twitter"
| "youtube"
| "telegram"
export type ProjectLinkType = Partial<Record<ProjectLinkWebsite, any>>
export type ProjectExtraLinkType = 'buildWith' | 'play' | 'research' | 'learn'
export type ProjectExtraLinkType = "buildWith" | "play" | "research" | "learn"
export type TagType =
| 'types'
| 'themes'
| 'builtWith'
| 'keywords'
| 'fundingSource'
| "types"
| "themes"
| "builtWith"
| "keywords"
| "fundingSource"
export type ProjectTags = Partial<Record<TagType, string[]>>
export type ActionLinkTypeLink = {
label: string

View File

@@ -1,6 +1,6 @@
import { ReadonlyURLSearchParams } from 'next/navigation'
import { clsx, type ClassValue } from 'clsx'
import { twMerge } from 'tailwind-merge'
import { ReadonlyURLSearchParams } from "next/navigation"
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
@@ -18,7 +18,7 @@ export function queryStringToObject(
const obj = Object.fromEntries(searchParams.entries())
const object: Record<string, any> = {}
Object.keys(obj).forEach((key) => {
object[key] = obj[key]?.split(',')
object[key] = obj[key]?.split(",")
})
return object
@@ -35,14 +35,14 @@ export function convertDirtyStringToHtml(string: string) {
// eslint-disable-next-line no-useless-escape
const pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim
if (!string) return ''
if (!string) return ""
return string
.replace(/\n/g, '<br />')
.replace(/\n/g, "<br />")
.replace(urlPattern, '<a href="$&">$&</a>')
.replace(pseudoUrlPattern, '$1<a href="http://$2">$2</a>')
.toLowerCase()
}
export function removeProtocol(url: string) {
return url?.replace(/^https?:\/\//, '')
return url?.replace(/^https?:\/\//, "")
}