From 96ecf6c7803cfc8798921730bb7c446aaa08fbf9 Mon Sep 17 00:00:00 2001 From: teodorus-nathaniel Date: Mon, 4 Mar 2024 19:40:06 +0700 Subject: [PATCH 1/3] Remove featured posts filter --- src/components/main/HomePageFilters.tsx | 7 +------ src/components/main/types.ts | 2 +- src/components/main/utils.ts | 12 ++++++------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/components/main/HomePageFilters.tsx b/src/components/main/HomePageFilters.tsx index 570f9a2a5..afa7afdf7 100644 --- a/src/components/main/HomePageFilters.tsx +++ b/src/components/main/HomePageFilters.tsx @@ -38,11 +38,6 @@ const verifiedIcon = ( ) export const postFilterOpt: Filter[] = [ - { - label: 'Featured Posts', - icon: verifiedIcon, - value: 'suggested', - }, { label: 'Hot Posts', icon: '🔥', value: 'hot' }, { label: 'All Posts', value: 'latest' }, // removed most liked and commented @@ -119,7 +114,7 @@ export const Filters = (props: Props) => { if (tabKey === 'feed' || !enableGraphQl) return null - const onFilterChange: any = (value: PostFilterType = 'suggested') => + const onFilterChange: any = (value: PostFilterType = 'hot') => setFiltersInUrl(router, tabKey, { type: value, date: date as DateFilterType }) const onDateChange: any = (value: DateFilterType = 'week') => diff --git a/src/components/main/types.ts b/src/components/main/types.ts index 91d354788..89fa65a9b 100644 --- a/src/components/main/types.ts +++ b/src/components/main/types.ts @@ -4,7 +4,7 @@ import { Dispatch } from 'react' import { AccountId } from 'src/types' import { PostKind } from '../../types/graphql-global-types' -export type PostFilterType = 'latest' | 'suggested' | 'hot' +export type PostFilterType = 'latest' | 'hot' // | 'liked' | 'commented' // removed most liked and commented export type SpaceFilterType = 'suggested' | 'latest' diff --git a/src/components/main/utils.ts b/src/components/main/utils.ts index 8417df1b9..c04dbf8f7 100644 --- a/src/components/main/utils.ts +++ b/src/components/main/utils.ts @@ -31,12 +31,12 @@ const getPostsByFilter: GetEntityFilter = { month: q.GET_LATEST_POST_IDS, allTime: q.GET_LATEST_POST_IDS, }, - suggested: { - day: q.GET_LATEST_POST_IDS, - week: q.GET_LATEST_POST_IDS, - month: q.GET_LATEST_POST_IDS, - allTime: q.GET_LATEST_POST_IDS, - }, + // suggested: { + // day: q.GET_LATEST_POST_IDS, + // week: q.GET_LATEST_POST_IDS, + // month: q.GET_LATEST_POST_IDS, + // allTime: q.GET_LATEST_POST_IDS, + // }, hot: { day: q.GET_LATEST_POST_IDS, week: q.GET_LATEST_POST_IDS, From c9fb3e4b7d6039676e459d365482d7f809d31952 Mon Sep 17 00:00:00 2001 From: Mell Date: Mon, 4 Mar 2024 20:38:02 +0200 Subject: [PATCH 2/3] Add pinned posts --- src/components/posts/pinned-post.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/posts/pinned-post.ts b/src/components/posts/pinned-post.ts index ca408f355..72559cb8f 100644 --- a/src/components/posts/pinned-post.ts +++ b/src/components/posts/pinned-post.ts @@ -1,7 +1,7 @@ import { getLastestPostIdsInSpace } from 'src/graphql/apis' import { GqlClient } from 'src/graphql/ApolloProvider' -const PINNED_POST_IDS: string[] = [] +const PINNED_POST_IDS: string[] = ['84710', '84833'] const PINNED_POST_ID = PINNED_POST_IDS[Math.floor(Math.random() * PINNED_POST_IDS.length)] const COMMUNITY_SPACE_ID = '1244' From efa463b145a1fd9c85d036c2aa9c3d2fb907dbe0 Mon Sep 17 00:00:00 2001 From: Mell Date: Mon, 4 Mar 2024 20:39:19 +0200 Subject: [PATCH 3/3] Rename All Posts to Latest --- src/components/main/HomePageFilters.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/main/HomePageFilters.tsx b/src/components/main/HomePageFilters.tsx index afa7afdf7..34cf906c8 100644 --- a/src/components/main/HomePageFilters.tsx +++ b/src/components/main/HomePageFilters.tsx @@ -39,7 +39,7 @@ const verifiedIcon = ( export const postFilterOpt: Filter[] = [ { label: 'Hot Posts', icon: '🔥', value: 'hot' }, - { label: 'All Posts', value: 'latest' }, + { label: 'Latest', value: 'latest' }, // removed most liked and commented // ...offchainPostFilterOpt, ]