diff --git a/src/.graphclient/index.ts b/src/.graphclient/index.ts index 510863f..9ab869f 100644 --- a/src/.graphclient/index.ts +++ b/src/.graphclient/index.ts @@ -10876,7 +10876,10 @@ export const getProjectGrantsDocument = gql` ${ShipDisplayFragmentDoc}` as unknown as DocumentNode; export const GetProjectsDocument = gql` query GetProjects($chainId: Int!) { - Project(where: {chainId: {_eq: $chainId}}) { + Project( + order_by: {db_write_timestamp: desc, hasEditedProfile: desc_nulls_last} + where: {chainId: {_eq: $chainId}} + ) { ...ProjectDetails metadata { ...RawMetadata @@ -10887,7 +10890,10 @@ export const GetProjectsDocument = gql` ${RawMetadataFragmentDoc}` as unknown as DocumentNode; export const GetUserProjectsDocument = gql` query GetUserProjects($id: String!) { - Project(where: {owner: {_eq: $id}}) { + Project( + order_by: {db_write_timestamp: desc, hasEditedProfile: desc_nulls_last} + where: {owner: {_eq: $id}} + ) { ...ProjectDetails metadata { ...RawMetadata diff --git a/src/constants/filterLists.ts b/src/constants/filterLists.ts index acd2d26..424ca58 100644 --- a/src/constants/filterLists.ts +++ b/src/constants/filterLists.ts @@ -8,8 +8,20 @@ export const PROD_PROJECT_FILTER_LIST: string[] = [ '0x4abcf5af3284bc04f1b22839c9795e638a1e98b1', '0x6cc0ab6764657bbf9bf44a9156674eebe870528a', '0x9474322501a0d6dae5729a2eed6ab8498af65fbc', + '0x087593361D738C972181781e442CD58718d6b42E', '0x98a92adc79fa79e38dd3ce6373ebb74b8f90b486', -]; + '0x4695B577F2A243476E34060c15675F296212BBc9', + '0xC19257E31402446183F87a5a45803AB93c1fFC27', + '0x899E0e86eB3A97508bA1603140ecBaBBcabd0BaC', + '0x272a05D0a4AD86Ca0e9c4760eb061cff7Cad2a49', + '0x8d3EE1bfa283B487aF9e1975b8E9E45Cb73AD074', + // Hackathon Projects + '0x73bBeaE4478c5E0530C9e01C839dFB299Ae7b419', + '0xB4783D9Bbb02238A43d3e54a6A58E7e9585Ba0A3', + '0x6A7b8dda03759b3aE87723572D1686153909425D', + // Jord's Tester + '0x6068962E7a64DAFDf69f13a85EB191260705008E', +].map((id) => id.toLowerCase()); export const PROJECT_FILTER_LIST = import.meta.env.VITE_RUNTIME_ENV === 'dev' diff --git a/src/graphql/newQueries/getProjects.graphql b/src/graphql/newQueries/getProjects.graphql index d641ba3..0c0695e 100644 --- a/src/graphql/newQueries/getProjects.graphql +++ b/src/graphql/newQueries/getProjects.graphql @@ -13,7 +13,10 @@ fragment RawMetadata on RawMetadata { } query GetProjects($chainId: Int!) { - Project(where: { chainId: { _eq: $chainId } }) { + Project( + order_by: { db_write_timestamp: desc, hasEditedProfile: desc_nulls_last } + where: { chainId: { _eq: $chainId } } + ) { ...ProjectDetails metadata { ...RawMetadata @@ -22,7 +25,10 @@ query GetProjects($chainId: Int!) { } query GetUserProjects($id: String!) { - Project(where: { owner: { _eq: $id } }) { + Project( + order_by: { db_write_timestamp: desc, hasEditedProfile: desc_nulls_last } + where: { owner: { _eq: $id } } + ) { ...ProjectDetails metadata { ...RawMetadata diff --git a/src/queries/getProjectCards.ts b/src/queries/getProjectCards.ts index 76351f2..ad0c239 100644 --- a/src/queries/getProjectCards.ts +++ b/src/queries/getProjectCards.ts @@ -8,7 +8,6 @@ import { getGatewayUrl, getIpfsJson } from '../utils/ipfs/get'; import { ProjectProfileMetadata } from '../utils/ipfs/metadataValidation'; import { SUBGRAPH_URL } from '../constants/gameSetup'; import { PROJECT_FILTER_LIST } from '../constants/filterLists'; -import { Chain } from 'viem'; type ProjectMetadataType = z.infer; @@ -40,14 +39,12 @@ const projectMetadataResolver = async (project: ProjectCardFromQuery) => { export const getProjectCards = async ({ chainId }: { chainId: number }) => { try { - const { GetProjects } = getBuiltGraphSDK({ - apiEndpoint: SUBGRAPH_URL, - }); + const { GetProjects } = getBuiltGraphSDK(); const result = await GetProjects({ chainId }); const filteredProjects = result.Project?.filter( - (project) => !PROJECT_FILTER_LIST.includes(project.id) + (project) => !PROJECT_FILTER_LIST.includes(project.id.toLocaleLowerCase()) ); const resolvedProjects = await Promise.all( @@ -62,28 +59,3 @@ export const getProjectCards = async ({ chainId }: { chainId: number }) => { throw new Error(error?.mesasge || 'Error fetching projects'); } }; - -// export const getUserProjects = async (userId: string) => { -// try { -// const { GetUserProjects } = getBuiltGraphSDK({ -// apiEndpoint: SUBGRAPH_URL, -// }); - -// const { projects } = await GetUserProjects({ id: userId }); - -// const filteredProjects = projects?.filter( -// (project) => !PROJECT_FILTER_LIST.includes(project.id) -// ); - -// console.log('filteredProjects', filteredProjects); - -// const resolvedProjects = await Promise.all( -// filteredProjects?.map((project) => projectMetadataResolver(project)) -// ); - -// return resolvedProjects as ProjectCard[]; -// } catch (error: any) { -// console.error(error); -// throw new Error(error?.mesasge || 'Error fetching projects'); -// } -// }; diff --git a/src/utils/media.ts b/src/utils/media.ts index e7b213e..9acaea8 100644 --- a/src/utils/media.ts +++ b/src/utils/media.ts @@ -92,18 +92,14 @@ export const parseShowcaseLink = ( }; }; -const testPNG = youtubeRegex.test( - 'https://presskit.manada.dev/images/cloudlines/0000screenshot.png' -); +// const testPNG = youtubeRegex.test( +// 'https://presskit.manada.dev/images/cloudlines/0000screenshot.png' +// ); -const youtubeURLTest = youtubeRegex.test( - 'https://www.youtube.com/watch?v=Sg-G1E1UwAY' -); +// const youtubeURLTest = youtubeRegex.test( +// 'https://www.youtube.com/watch?v=Sg-G1E1UwAY' +// ); -const youtubeShareTest = youtubeRegex.test( - 'https://youtu.be/Sg-G1E1UwAY?feature=shared' -); - -console.log('test PNG', testPNG); -console.log('youtubeTest', youtubeURLTest); -console.log('youtubeShareTest', youtubeShareTest); +// const youtubeShareTest = youtubeRegex.test( +// 'https://youtu.be/Sg-G1E1UwAY?feature=shared' +// );