diff --git a/apps/website/src/components/table-issues/table-issues.tsx b/apps/website/src/components/table-issues/table-issues.tsx index e047a920..5266442c 100644 --- a/apps/website/src/components/table-issues/table-issues.tsx +++ b/apps/website/src/components/table-issues/table-issues.tsx @@ -1,11 +1,13 @@ -import { useState } from 'react' +import { useRef, useState } from 'react' -import { Avatar, Button, Tag, Text } from '@status-im/components' -import { OpenIcon } from '@status-im/icons' +import { Avatar, Button, Input, Tag, Text } from '@status-im/components' +import { OpenIcon, SearchIcon } from '@status-im/icons' import Link from 'next/link' import { FilterAuthor } from './filters/filter-author' +import type { TextInput } from 'react-native' + const issues = [ { id: 5154, @@ -93,6 +95,10 @@ const authors = [ export const TableIssues = () => { const [activeTab, setActiveTab] = useState<'open' | 'closed'>('open') + const [issuesSearchText, setIssuesSearchText] = useState('') + const inputRef = useRef(null) + const [isMinimized, setIsMinimized] = useState(true) + return (
@@ -119,6 +125,19 @@ export const TableIssues = () => {
+
+ } + size={32} + value={issuesSearchText} + onChangeText={setIssuesSearchText} + onHandleMinimized={() => setIsMinimized(!isMinimized)} + minimized={isMinimized} + direction="rtl" + ref={inputRef} + /> +
+ )} + + + + ) +} + +const Input = forwardRef(_Input) + +export { Input } +export type { Props as InputProps } + const InputFrame = styled( TextInput, { @@ -46,6 +157,8 @@ const InputFrame = styled( } ) +const InputBase = focusableInputHOC(InputFrame) + const InputContainer = styled(Stack, { name: 'InputContainer', tag: 'div', @@ -54,11 +167,12 @@ const InputContainer = styled(Stack, { gap: 8, borderWidth: 1, - borderColor: '$neutral-20', + borderColor: '$neutral-30', paddingHorizontal: 12, - animation: 'fast', + animation: 'medium', + width: '100%', hoverStyle: { borderColor: '$neutral-40', @@ -85,6 +199,15 @@ const InputContainer = styled(Stack, { borderRadius: '$10', }, }, + minimized: { + true: { + width: 32, + paddingHorizontal: 0, + paddingLeft: 5, + + cursor: 'pointer', + }, + }, error: { true: { borderColor: '$danger-50-opa-40', @@ -99,76 +222,3 @@ const InputContainer = styled(Stack, { }, } as const, }) - -type Props = GetProps & { - button?: { - label: string - onPress: () => void - } - endLabel?: string - icon?: React.ReactElement - label?: string - onClear?: () => void - size?: 40 | 32 - error?: boolean -} - -const InputBase = focusableInputHOC(InputFrame) - -const _Input = (props: Props, ref: Ref) => { - const { - button, - color = '$neutral-50', - endLabel, - error, - icon, - label, - onClear, - size = 40, - value, - ...rest - } = props - return ( - - {Boolean(label || endLabel) && ( - - {label && ( - - {label} - - )} - {endLabel && ( - - {endLabel} - - )} - - )} - - {icon ? cloneElement(icon, { color }) : null} - - - {Boolean(onClear) && !!value && ( - - } - onPress={onClear} - /> - - )} - {button && ( - - )} - - - - ) -} - -const Input = forwardRef(_Input) - -export { Input } -export type { Props as InputProps }