Delete closing soon, mark new as New for you, trending is site-wide

This commit is contained in:
James Grugett 2022-09-09 00:47:47 -05:00
parent bb009506ef
commit 0a80fb7e1b
2 changed files with 11 additions and 4 deletions

View File

@ -110,7 +110,6 @@ export const getHomeItems = (
const items = [ const items = [
{ label: 'Trending', id: 'score' }, { label: 'Trending', id: 'score' },
{ label: 'Newest', id: 'newest' }, { label: 'Newest', id: 'newest' },
{ label: 'Close date', id: 'close-date' },
{ label: 'Your trades', id: 'your-bets' }, { label: 'Your trades', id: 'your-bets' },
...groups.map((g) => ({ ...groups.map((g) => ({
label: g.name, label: g.name,

View File

@ -75,8 +75,9 @@ const Home = () => {
return ( return (
<SearchSection <SearchSection
key={id} key={id}
label={sort.label} label={sort.value === 'newest' ? 'New for you' : sort.label}
sort={sort.value} sort={sort.value}
followed={sort.value === 'newest'}
user={user} user={user}
/> />
) )
@ -106,8 +107,9 @@ function SearchSection(props: {
user: User | null | undefined user: User | null | undefined
sort: Sort sort: Sort
yourBets?: boolean yourBets?: boolean
followed?: boolean
}) { }) {
const { label, user, sort, yourBets } = props const { label, user, sort, yourBets, followed } = props
const href = `/home?s=${sort}` const href = `/home?s=${sort}`
return ( return (
@ -122,7 +124,13 @@ function SearchSection(props: {
<ContractSearch <ContractSearch
user={user} user={user}
defaultSort={sort} defaultSort={sort}
additionalFilter={yourBets ? { yourBets: true } : { followed: true }} additionalFilter={
yourBets
? { yourBets: true }
: followed
? { followed: true }
: undefined
}
noControls noControls
maxResults={6} maxResults={6}
persistPrefix={`experimental-home-${sort}`} persistPrefix={`experimental-home-${sort}`}