From cbc4f4a7c5d85acaf15d5aadc22677409b4a35f7 Mon Sep 17 00:00:00 2001 From: Jonas de Luna Skulberg Date: Tue, 10 Sep 2024 21:00:30 +0200 Subject: [PATCH] Update to use dropdown --- app/components/Comments/CommentView.css | 17 +-- app/components/Comments/CommentView.tsx | 127 ++++++++----------- app/routes/forum/components/ThreadDetail.tsx | 1 - 3 files changed, 60 insertions(+), 85 deletions(-) diff --git a/app/components/Comments/CommentView.css b/app/components/Comments/CommentView.css index 535f029b28..009ba9b4e1 100644 --- a/app/components/Comments/CommentView.css +++ b/app/components/Comments/CommentView.css @@ -1,16 +1,9 @@ .headerContainer { - margin-bottom: 0.25rem; + margin-bottom: var(--spacing-sm); } -.sortIcon { - flex-direction: column; -} - -.iconWrapper { - margin-left: 0.25rem; -} - -.sortList { - margin-left: 0.5rem; - min-width: 10rem; +.dropdownElement { + padding: var(--spacing-sm); + cursor: pointer; + width: var(--spacing-ss); } diff --git a/app/components/Comments/CommentView.tsx b/app/components/Comments/CommentView.tsx index be40613005..7bb26b1bd8 100644 --- a/app/components/Comments/CommentView.tsx +++ b/app/components/Comments/CommentView.tsx @@ -1,15 +1,10 @@ -import { - FilterSection, - Flex, - Icon, - LoadingIndicator, -} from '@webkom/lego-bricks'; -import { ListFilter } from 'lucide-react'; +import { Flex, Icon, LoadingIndicator } from '@webkom/lego-bricks'; +import { ArrowDownUpIcon } from 'lucide-react'; import moment from 'moment'; -import { useEffect, useState, type CSSProperties } from 'react'; +import { useState, type CSSProperties } from 'react'; import CommentForm from 'app/components/CommentForm'; +import Dropdown from 'app/components/Dropdown'; import { generateTreeStructure } from 'app/utils'; -import { SelectInput } from '../Form'; import CommentTree from './CommentTree'; import styles from './CommentView.css'; import type Comment from 'app/store/models/Comment'; @@ -36,13 +31,9 @@ const orderingOptions: Array