hide comment sort, trade tab if no items

This commit is contained in:
mantikoros 2022-10-02 16:47:46 -05:00
parent 39638a3888
commit 11bd658c68

View File

@ -53,7 +53,7 @@ export function ContractTabs(props: {
title: 'Comments', title: 'Comments',
content: <CommentsTabContent contract={contract} comments={comments} />, content: <CommentsTabContent contract={contract} comments={comments} />,
}, },
{ bets.length > 0 && {
title: capitalize(PAST_BETS), title: capitalize(PAST_BETS),
content: <BetsTabContent contract={contract} bets={bets} />, content: <BetsTabContent contract={contract} bets={bets} />,
}, },
@ -150,25 +150,27 @@ const CommentsTabContent = memo(function CommentsTabContent(props: {
<> <>
<ContractCommentInput className="mb-5" contract={contract} /> <ContractCommentInput className="mb-5" contract={contract} />
<Row className="mb-4 items-center"> {comments.length > 0 && (
<Button <Row className="mb-4 items-center">
size={'xs'} <Button
color={'gray-white'} size={'xs'}
onClick={() => setSort(sort === 'Newest' ? 'Best' : 'Newest')} color={'gray-white'}
> onClick={() => setSort(sort === 'Newest' ? 'Best' : 'Newest')}
<Tooltip
text={
sort === 'Best'
? 'Highest tips + bounties first. Your new comments briefly appear to you first.'
: ''
}
> >
Sorted by: {sort} <Tooltip
</Tooltip> text={
</Button> sort === 'Best'
? 'Highest tips + bounties first. Your new comments briefly appear to you first.'
: ''
}
>
Sort by: {sort}
</Tooltip>
</Button>
<BountiedContractSmallBadge contract={contract} showAmount /> <BountiedContractSmallBadge contract={contract} showAmount />
</Row> </Row>
)}
{topLevelComments.map((parent) => ( {topLevelComments.map((parent) => (
<FeedCommentThread <FeedCommentThread