Skip to content

Commit 3a697d5

Browse files
committed
feat: hard code the first trending project
1 parent ad76a72 commit 3a697d5

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// project that gets more real estate on the home page
2-
const SPOTLIGHT_PROJECT_ID = 490 // blunt
2+
const SPOTLIGHT_PROJECT_ID = 618 // roman storm
33

44
export const JUICY_PICKS_PROJECT_IDS = [
55
SPOTLIGHT_PROJECT_ID,
66
501, // cryo
7-
507, // thirsty thirsty
7+
594, // brume
88
471, // pinnable
9-
508, // cryo
9+
614, // cryo
1010
]

src/components/Home/TopSection/TopSection.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { SectionHeading } from 'components/Home/SectionHeading'
1111
import { ProjectTag } from 'components/ProjectTags/ProjectTag'
1212
import { XLButton } from 'components/buttons/XLButton'
1313
import { HOMEPAGE } from 'constants/fathomEvents'
14-
import { PV_V1 } from 'constants/pv'
14+
import { PV_V1, PV_V2 } from 'constants/pv'
1515
import {
1616
DEFAULT_TRENDING_PROJECTS_LIMIT,
1717
useDBProjectsQuery,
@@ -30,6 +30,8 @@ const HEADER_TAGS: ProjectTagName[] = [
3030
'business',
3131
]
3232

33+
const FIRST_PROJECT = getSubgraphIdForProject(PV_V2, 618) // roman storm
34+
3335
// These projects will render if there isn't enough trending projects.
3436
const BACKUP_PROJECTS = [
3537
getSubgraphIdForProject(PV_V1, 199), // moondao
@@ -43,16 +45,17 @@ export function TopSection() {
4345
DEFAULT_TRENDING_PROJECTS_LIMIT,
4446
)
4547
const { data: backupProjects } = useDBProjectsQuery({
46-
ids: BACKUP_PROJECTS,
48+
ids: [FIRST_PROJECT, ...BACKUP_PROJECTS],
4749
})
50+
const firstProject = backupProjects?.[0] // hardcore the first project in the list
4851

4952
const remainderProjectCount =
5053
DEFAULT_TRENDING_PROJECTS_LIMIT - (trendingProjects?.length ?? 0)
5154

5255
const renderBackup =
5356
trendingProjects && backupProjects && remainderProjectCount
5457
? backupProjects
55-
.slice(0, remainderProjectCount)
58+
.slice(1, remainderProjectCount)
5659
.filter(
5760
p =>
5861
!trendingProjects
@@ -61,9 +64,10 @@ export function TopSection() {
6164
)
6265
: []
6366

64-
const renderProjects = trendingProjects
65-
? [...trendingProjects, ...renderBackup]
66-
: undefined
67+
const renderProjects =
68+
trendingProjects && firstProject
69+
? [firstProject, ...trendingProjects, ...renderBackup]
70+
: undefined
6771

6872
return (
6973
<SectionContainer className="pt-6 pb-24 md:px-0 md:pt-10">

0 commit comments

Comments
 (0)