From 84bc490ed311991b138065eb3a214e6b14006528 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 7 Oct 2022 14:56:55 -0500 Subject: [PATCH] comment sort: move below input, newest as default --- web/components/contract/contract-tabs.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/components/contract/contract-tabs.tsx b/web/components/contract/contract-tabs.tsx index fdfc5c3d..7b2886aa 100644 --- a/web/components/contract/contract-tabs.tsx +++ b/web/components/contract/contract-tabs.tsx @@ -80,7 +80,7 @@ const CommentsTabContent = memo(function CommentsTabContent(props: { const { contract } = props const tips = useTipTxns({ contractId: contract.id }) const comments = useComments(contract.id) ?? props.comments - const [sort, setSort] = usePersistentState<'Newest' | 'Best'>('Best', { + const [sort, setSort] = usePersistentState<'Newest' | 'Best'>('Newest', { key: `contract-comments-sort`, store: storageStore(safeLocalStorage()), }) @@ -123,7 +123,7 @@ const CommentsTabContent = memo(function CommentsTabContent(props: { const topLevelComments = commentsByParent['_'] ?? [] const sortRow = comments.length > 0 && ( - +