Skip to content

Commit

Permalink
revert hard code roman storm project to top of trending
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Hayes authored and Tyler Hayes committed Jan 23, 2024
1 parent c7edad1 commit b104576
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/components/Home/TopSection/TopSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SectionHeading } from 'components/Home/SectionHeading'
import { ProjectTag } from 'components/ProjectTags/ProjectTag'
import { XLButton } from 'components/buttons/XLButton'
import { HOMEPAGE } from 'constants/fathomEvents'
import { PV_V1, PV_V2 } from 'constants/pv'
import { PV_V1 } from 'constants/pv'
import {
DEFAULT_TRENDING_PROJECTS_LIMIT,
useDBProjectsQuery,
Expand All @@ -30,8 +30,6 @@ const HEADER_TAGS: ProjectTagName[] = [
'business',
]

const FIRST_PROJECT = getSubgraphIdForProject(PV_V2, 618) // roman storm

// These projects will render if there isn't enough trending projects.
const BACKUP_PROJECTS = [
getSubgraphIdForProject(PV_V1, 199), // moondao
Expand All @@ -45,17 +43,16 @@ export function TopSection() {
DEFAULT_TRENDING_PROJECTS_LIMIT,
)
const { data: backupProjects } = useDBProjectsQuery({
ids: [FIRST_PROJECT, ...BACKUP_PROJECTS],
ids: BACKUP_PROJECTS,
})
const firstProject = backupProjects?.find(p => p.id === FIRST_PROJECT) // hardcore the first project in the list

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

const renderBackup =
trendingProjects && backupProjects && remainderProjectCount
? backupProjects
.slice(1, remainderProjectCount)
.slice(0, remainderProjectCount)
.filter(
p =>
!trendingProjects
Expand All @@ -64,10 +61,9 @@ export function TopSection() {
)
: []

const renderProjects =
trendingProjects && firstProject
? [firstProject, ...trendingProjects, ...renderBackup]
: undefined
const renderProjects = trendingProjects
? [...trendingProjects, ...renderBackup]
: undefined

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

2 comments on commit b104576

@vercel
Copy link

@vercel vercel bot commented on b104576 Jan 23, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

juice-interface – ./

juice-interface-peel.vercel.app
juice-interface-git-main-peel.vercel.app

@vercel
Copy link

@vercel vercel bot commented on b104576 Jan 23, 2024

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.