Skip to content

Commit

Permalink
Merge branch 'main' into ecosystem-submission/kabat-2024-10-01
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlyMartin authored Oct 9, 2024
2 parents ca5c3a4 + 26470dd commit 3253079
Show file tree
Hide file tree
Showing 42 changed files with 627 additions and 114 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: Lint Code Base

on:
push:
branches: [main]
branches:
- main
- cms/*
- ecosystem-submission/*
pull_request:
branches: [main]
branches:
- main
- cms/*
- ecosystem-submission/*

jobs:
lint:
Expand Down
16 changes: 16 additions & 0 deletions cypress/e2e/critical/allocators_page_spec.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { PATHS } from '@/constants/paths'

import { testPageMetadata } from '@/support/test-utils'
import { verifyLinks } from '@/support/verifyLinksUtil'

describe('Allocators Page', () => {
it('should check metadata', () => {
testPageMetadata(PATHS.ALLOCATORS, {
overrideDefaultTitle: true,
})
})

it('should check links', () => {
verifyLinks(PATHS.ALLOCATORS.path)
})
})
51 changes: 40 additions & 11 deletions public/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ meta_config: &meta_config
- "^.{0,220}$"
- "Must have at most 220 characters."
hint: "To generate meta title and description, copy and paste the entry content into ChatGPT 4.0, then use the prompt: 'Generate a meta title and a meta description under 220 characters for the following content: [paste your content here].'"
- name: "og"
- name: "open-graph"
label: "Open Graph Metadata"
widget: "object"
required: false
Expand All @@ -130,6 +130,11 @@ meta_config: &meta_config
widget: "string"
required: false
hint: "If left empty, the SEO meta title will be used."
- name: "description"
label: "Open Graph Description"
widget: "string"
required: false
hint: "If left empty, the SEO meta description will be used."
- name: "image"
label: "Open Graph Image"
widget: "image"
Expand Down Expand Up @@ -206,16 +211,16 @@ collections:
- *header_config
- *meta_config

- name: "ecosystem"
label: "Ecosystem"
- name: "ecosystem-explorer"
label: "Ecosystem Explorer"
file: "src/content/pages/ecosystem-explorer.md"
preview_path: "ecosystem-explorer"
fields:
- *header_config
- *meta_config

- name: "ecosystem-explorer/project-form"
label: "Ecosystem Explorer Project Form"
label: "Ecosystem Explorer - Project Form"
file: "src/content/pages/ecosystem-explorer/project-form.md"
preview_path: "ecosystem-explorer/project-form"
fields:
Expand Down Expand Up @@ -250,12 +255,20 @@ collections:

- name: "filecoin-plus"
label: "Filecoin Plus"
file: "src/content/pages/filecoin-plus.md"
file: "src/content/pages/filecoin-plus/filecoin-plus.md"
preview_path: "filecoin-plus"
fields:
- *header_config
- *meta_config

- name: "allocators"
label: "Filecoin Plus - Allocators"
file: "src/content/pages/filecoin-plus/allocators.md"
preview_path: "filecoin-plus/allocators"
fields:
- *header_config
- *meta_config

- name: "governance"
label: "Governance"
file: "src/content/pages/governance.md"
Expand Down Expand Up @@ -305,6 +318,14 @@ collections:
max: 6
- *meta_config

- name: "orbit"
label: "Orbit"
file: "src/content/pages/orbit.md"
preview_path: "orbit"
fields:
- *header_config
- *meta_config

- name: "privacy-policy"
label: "Privacy Policy"
file: "src/content/pages/privacy-policy.md"
Expand All @@ -313,24 +334,32 @@ collections:
- *header_config
- *meta_config

- name: "security-maturity-model"
label: "Maturity Model"
file: "src/content/pages/security/maturity-model.md"
preview_path: "security/maturity-model"
- name: "security"
label: "Security"
file: "src/content/pages/security/security.md"
preview_path: "security"
fields:
- *header_config
- *meta_config

- name: "security/bug-bounty"
label: "Bug Bounty"
label: "Security - Bug Bounty"
file: "src/content/pages/security/bug-bounty.md"
preview_path: "security/bug-bounty"
fields:
- *header_config
- *meta_config

- name: "security-maturity-model"
label: "Security - Maturity Model"
file: "src/content/pages/security/maturity-model.md"
preview_path: "security/maturity-model"
fields:
- *header_config
- *meta_config

- name: "terms"
label: "Terms"
label: "Terms of Use"
file: "src/content/pages/terms-of-use.md"
preview_path: "terms-of-use"
fields:
Expand Down
Binary file not shown.
10 changes: 7 additions & 3 deletions src/app/_components/FocusAreaCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import Image from 'next/image'

import type { StaticImageProps } from '@/types/sharedProps/imageType'

import { buildImageSizeProp } from '@/utils/buildImageSizeProp'

import { Heading } from '@/components/Heading'
import { StaticImage, type StaticImageProps } from '@/components/StaticImage'

export type FocusAreaCardProps = {
title: string
Expand All @@ -16,8 +19,9 @@ export function FocusAreaCard({
}: FocusAreaCardProps) {
return (
<li className="rounded-lg border border-brand-300 p-1 sm:flex lg:block">
<StaticImage
{...image}
<Image
src={image.data}
alt={image.alt}
className="aspect-video w-full rounded object-cover sm:w-60 sm:shrink-0 md:w-80 lg:w-full"
sizes={buildImageSizeProp({
startSize: '100vw',
Expand Down
32 changes: 24 additions & 8 deletions src/app/_components/NoResultsMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
'use client'

import { MagnifyingGlass } from '@phosphor-icons/react/dist/ssr'
import type { CTAProps } from '@/types/sharedProps/ctaType'

import { Button } from '@/components/Button'
import { Heading } from '@/components/Heading'
import { Icon } from '@/components/Icon'
import { Icon, type IconProps } from '@/components/Icon'

type NoResultsMessageProps = {
icon: IconProps['component']
title: string
message: string
cta?: CTAProps
}

export function NoResultsMessage() {
export function NoResultsMessage({
icon,
title,
message,
cta,
}: NoResultsMessageProps) {
return (
<div className="flex flex-col items-center gap-4 text-brand-200">
<span className="grid size-16 place-items-center rounded-full bg-brand-700 text-brand-300">
<Icon component={MagnifyingGlass} />
<Icon component={icon} />
</span>
<Heading tag="h3" variant="xl">
No Results Found
{title}
</Heading>
<p>Try changing your search query.</p>
<p className="max-w-md text-center">{message}</p>
{cta && (
<Button href={cta.href} variant="primary">
{cta.text}
</Button>
)}
</div>
)
}
13 changes: 13 additions & 0 deletions src/app/_components/NoSearchResultsMessage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { MagnifyingGlass } from '@phosphor-icons/react/dist/ssr'

import { NoResultsMessage } from '@/components/NoResultsMessage'

export function NoSearchResultsMessage() {
return (
<NoResultsMessage
icon={MagnifyingGlass}
title="No Results Found"
message="Try changing your search query."
/>
)
}
24 changes: 11 additions & 13 deletions src/app/_components/OrbitAmbassadorCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Image from 'next/image'

import { clsx } from 'clsx'

import { buildImageSizeProp } from '@/utils/buildImageSizeProp'

import { BasicCard } from '@/components/BasicCard'
import { StaticImage } from '@/components/StaticImage'

import type { AmbassadorData } from '@/orbit/data/ambassadorsData'

Expand All @@ -27,25 +28,22 @@ export function OrbitAmbassadorCard({
isImagePositionOdd && 'lg:flex-row-reverse',
)}
>
<div className="relative h-48 flex-shrink-0 sm:h-64 lg:h-auto lg:w-1/3">
<StaticImage
{...image}
fill
className="h-full w-full rounded-lg"
sizes={buildImageSizeProp({
startSize: '100vw',
lg: '33vw',
})}
/>
</div>
<Image
src={image.data}
alt={image.alt}
className="h-48 flex-shrink-0 rounded-lg object-cover sm:h-64 lg:h-auto lg:w-1/3"
sizes={buildImageSizeProp({
startSize: '100vw',
lg: '33vw',
})}
/>

<div className="flex-grow">
<BasicCard>
<div className="space-y-6">
{testimonial.map((text, index) => (
<p key={index}>{text}</p>
))}

<div>
<p className="font-bold">{name}</p>
<p className="text-brand-300">{location}</p>
Expand Down
29 changes: 14 additions & 15 deletions src/app/_components/PageSection.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Image, { type StaticImageData } from 'next/image'

import { clsx } from 'clsx'

import { buildImageSizeProp } from '@/utils/buildImageSizeProp'
Expand All @@ -15,13 +17,17 @@ import {
SectionDivider,
type SectionDividerProps,
} from '@/components/SectionDivider'
import { StaticImage, type StaticImageProps } from '@/components/StaticImage'

type PageSectionImageProps = {
data: StaticImageData
alt: string
}

type PageSectionProps = {
kicker: SectionDividerProps['title']
title: string
description?: DescriptionTextType
image?: StaticImageProps
image?: PageSectionImageProps
cta?: CTAButtonGroupProps['cta']
children?: React.ReactNode
}
Expand All @@ -37,7 +43,6 @@ export function PageSection({
return (
<section>
<SectionDivider title={kicker} />

<div
className={clsx('mt-4', {
'grid grid-cols-1 gap-6 lg:grid-cols-2': image,
Expand All @@ -49,24 +54,18 @@ export function PageSection({
<Heading tag="h2" variant="3xl">
{title}
</Heading>

{description && <DescriptionText>{description}</DescriptionText>}

{cta && <CTAButtonGroup cta={cta} />}
</div>

{image && (
<div className="relative aspect-video lg:aspect-auto">
<StaticImage
{...image}
fill
className="rounded-lg"
sizes={buildImageSizeProp({ startSize: '100vw', lg: '480px' })}
/>
</div>
<Image
src={image.data}
alt={image.alt}
sizes={buildImageSizeProp({ startSize: '100vw', lg: '480px' })}
className="aspect-video h-full w-full rounded-lg object-cover lg:aspect-auto"
/>
)}
</div>

{children && <div className="flex flex-col gap-6">{children}</div>}
</section>
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import { clsx } from 'clsx'

type TableHeadProps<Data extends RowData> = {
headerGroups: Array<HeaderGroup<Data>>
textColor?: 'text-brand-100' | 'text-brand-300'
}

export function TableHead<Data extends RowData>({
headerGroups,
textColor = 'text-brand-100',
}: TableHeadProps<Data>) {
const firstHeaderGroup = headerGroups[0]
const { headers } = firstHeaderGroup
Expand All @@ -22,7 +24,10 @@ export function TableHead<Data extends RowData>({
const { meta } = header.column.columnDef

return (
<th key={header.id} className={clsx('cell', meta?.headerCellStyle)}>
<th
key={header.id}
className={clsx('cell', textColor, meta?.headerCellStyle)}
>
{flexRender(header.column.columnDef.header, header.getContext())}
</th>
)
Expand Down
2 changes: 2 additions & 0 deletions src/app/_constants/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type PathValues =
| '/employee-privacy-policy'
| '/events'
| '/filecoin-plus'
| '/filecoin-plus/allocators'
| '/governance'
| '/grants'
| '/orbit'
Expand Down Expand Up @@ -79,6 +80,7 @@ export const PATHS = {
BLOG: createPathConfig('/blog', 'Blog', {
includesEntries: true,
}),
ALLOCATORS: createPathConfig('/filecoin-plus/allocators', 'Allocators'),
BUG_BOUNTY: createPathConfig('/security/bug-bounty', 'Bug Bounty Program'),
COORDINATED_DISCLOSURE_POLICY: createPathConfig(
'/security/coordinated-disclosure-policy',
Expand Down
Loading

0 comments on commit 3253079

Please sign in to comment.