Make categories work when signed out

This commit is contained in:
James Grugett 2022-05-31 21:23:36 -05:00
parent b236ebdbd9
commit 9cb24c9f3c
3 changed files with 4 additions and 13 deletions

View File

@ -115,7 +115,6 @@ export function ContractSearch(props: {
{showCategorySelector && (
<CategorySelector
className="mb-2"
user={user}
category={category}
setCategory={setCategory}
/>

View File

@ -1,16 +1,14 @@
import clsx from 'clsx'
import { User } from '../../../common/user'
import { Row } from '../layout/row'
import { CATEGORIES, CATEGORY_LIST } from '../../../common/categories'
export function CategorySelector(props: {
user: User | null | undefined
category: string
setCategory: (category: string) => void
className?: string
}) {
const { className, user, category, setCategory } = props
const { className, category, setCategory } = props
return (
<Row
@ -24,8 +22,7 @@ export function CategorySelector(props: {
key="all"
category="All"
isFollowed={category === 'all'}
toggle={async () => {
if (!user?.id) return
toggle={() => {
setCategory('all')
}}
/>
@ -35,8 +32,7 @@ export function CategorySelector(props: {
key={cat}
category={CATEGORIES[cat].split(' ')[0]}
isFollowed={cat === category}
toggle={async () => {
if (!user?.id) return
toggle={() => {
setCategory(cat)
}}
/>

View File

@ -39,11 +39,7 @@ export default function Activity() {
<>
<Page assertUser="signed-in" suspend={!!contract}>
<Col className="mx-auto w-full max-w-[700px]">
<CategorySelector
user={user}
category={category}
setCategory={setCategory}
/>
<CategorySelector category={category} setCategory={setCategory} />
<Spacer h={1} />
{feed ? (
<ActivityFeed