diff --git a/apps/website/src/components/table-issues/filters/components/color-circle.tsx b/apps/website/src/components/table-issues/filters/components/color-circle.tsx new file mode 100644 index 00000000..d0cabe46 --- /dev/null +++ b/apps/website/src/components/table-issues/filters/components/color-circle.tsx @@ -0,0 +1,44 @@ +import { tokens } from '@status-im/components/src/tokens' + +import type { ColorTokens } from '@tamagui/core' + +// TypeGuard for ColorTokens +function isColorTokens( + value: `#${string}` | ColorTokens +): value is ColorTokens { + return typeof value === 'string' && value.startsWith('$') +} + +const ColorCircle = ({ + color: colorFromProps, +}: { + color?: ColorTokens | `#${string}` +}) => { + if (!colorFromProps) { + return null + } + + let color: ColorTokens | string = colorFromProps + + if (isColorTokens(colorFromProps)) { + const colorToken = colorFromProps.replace( + '$', + '' + ) as keyof typeof tokens.color + color = tokens.color[colorToken]?.val || colorFromProps + } + + return ( +
+ ) +} + +export { ColorCircle } diff --git a/apps/website/src/components/table-issues/filters/filter-author.tsx b/apps/website/src/components/table-issues/filters/filter-author.tsx deleted file mode 100644 index c0c3ffc8..00000000 --- a/apps/website/src/components/table-issues/filters/filter-author.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { useState } from 'react' - -import { Avatar, Button, Input, Text } from '@status-im/components' -import { DropdownMenu } from '@status-im/components/src/dropdown-menu' -import { DropdownIcon, SearchIcon } from '@status-im/icons' - -type Props = { - authors: { - id: number - name: string - avatar?: string - }[] -} -const FilterAuthor = (props: Props) => { - const { authors } = props - - const [authorFilterText, setAuthorFilterText] = useState('') - const filteredAuthors = authors.filter(author => - author.name.toLowerCase().includes(authorFilterText.toLowerCase()) - ) - - const [selectedAuthors, setSelectedAuthors] = useState