Put back numbers in home tab titles for categories / following
This commit is contained in:
parent
61d7f0eca0
commit
323a62f041
|
@ -250,8 +250,13 @@ function CategoryFollowSelector(props: {
|
||||||
|
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
|
|
||||||
|
const categoriesTitle = `${
|
||||||
|
followedCategories?.length ? followedCategories.length : 'All'
|
||||||
|
} Categories`
|
||||||
let categoriesDescription = `Showing all categories`
|
let categoriesDescription = `Showing all categories`
|
||||||
|
|
||||||
|
const followingTitle = `${follows?.length ? follows.length : 'All'} Following`
|
||||||
|
|
||||||
if (followedCategories.length) {
|
if (followedCategories.length) {
|
||||||
const categoriesLabel = followedCategories
|
const categoriesLabel = followedCategories
|
||||||
.slice(0, 3)
|
.slice(0, 3)
|
||||||
|
@ -269,7 +274,7 @@ function CategoryFollowSelector(props: {
|
||||||
defaultIndex={mode === 'categories' ? 0 : 1}
|
defaultIndex={mode === 'categories' ? 0 : 1}
|
||||||
tabs={[
|
tabs={[
|
||||||
{
|
{
|
||||||
title: 'Categories',
|
title: categoriesTitle,
|
||||||
content: user && (
|
content: user && (
|
||||||
<Row className="items-center gap-1 text-gray-500">
|
<Row className="items-center gap-1 text-gray-500">
|
||||||
<div>{categoriesDescription}</div>
|
<div>{categoriesDescription}</div>
|
||||||
|
@ -280,7 +285,7 @@ function CategoryFollowSelector(props: {
|
||||||
...(user
|
...(user
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
title: 'Following',
|
title: followingTitle,
|
||||||
content: (
|
content: (
|
||||||
<Row className="items-center gap-2 text-gray-500">
|
<Row className="items-center gap-2 text-gray-500">
|
||||||
<div>Showing markets by users you are following.</div>
|
<div>Showing markets by users you are following.</div>
|
||||||
|
|
|
@ -54,11 +54,7 @@ export function EditFollowingButton(props: { user: User; className?: string }) {
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
>
|
>
|
||||||
<PencilIcon className="inline h-4 w-4" />
|
<PencilIcon className="inline h-4 w-4" />
|
||||||
<div>
|
|
||||||
<span className="font-semibold">{followingIds?.length ?? ''}</span>{' '}
|
|
||||||
Following
|
Following
|
||||||
</div>
|
|
||||||
|
|
||||||
<FollowingFollowersDialog
|
<FollowingFollowersDialog
|
||||||
user={user}
|
user={user}
|
||||||
defaultTab="following"
|
defaultTab="following"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user