} variant="outline" />
@@ -69,5 +67,5 @@ const Sort = (props: Props) => {
)
}
-export { Sort }
-export type { Props as SortProps }
+export { DropdownSort }
+export type { Props as DropdownSortProps }
diff --git a/apps/website/src/components/table-issues/filters/index.ts b/apps/website/src/components/table-issues/filters/index.ts
index d58da616..28bd6dc5 100644
--- a/apps/website/src/components/table-issues/filters/index.ts
+++ b/apps/website/src/components/table-issues/filters/index.ts
@@ -1,3 +1,3 @@
-export { FilterWithCheckboxes } from './filter-with-checkboxes'
-export { Sort } from './sort'
+export { DropdownFilter } from './dropdown-filter'
+export { DropdownSort } from './dropdown-sort'
export { Tabs } from './tabs'
diff --git a/apps/website/src/components/table-issues/table-issues.tsx b/apps/website/src/components/table-issues/table-issues.tsx
index 458e54ef..03b049b4 100644
--- a/apps/website/src/components/table-issues/table-issues.tsx
+++ b/apps/website/src/components/table-issues/table-issues.tsx
@@ -6,10 +6,10 @@ import Link from 'next/link'
import { useCurrentBreakpoint } from '@/hooks/use-current-breakpoint'
-import { FilterWithCheckboxes, Sort, Tabs } from './filters'
+import { DropdownFilter, DropdownSort, Tabs } from './filters'
-import type { FilterWithCheckboxesProps } from './filters/filter-with-checkboxes'
-import type { SortProps } from './filters/sort'
+import type { DropdownFilterProps } from './filters/dropdown-filter'
+import type { DropdownSortProps } from './filters/dropdown-sort'
import type { TextInput } from 'react-native'
const issues = [
@@ -55,7 +55,7 @@ const issues = [
},
]
-const authors: FilterWithCheckboxesProps['data'] = [
+const authors: DropdownFilterProps['data'] = [
{
id: 4,
name: 'marcelines',
@@ -78,7 +78,7 @@ const authors: FilterWithCheckboxesProps['data'] = [
},
]
-const epics: FilterWithCheckboxesProps['data'] = [
+const epics: DropdownFilterProps['data'] = [
{
id: 4,
name: 'E:ActivityCenter',
@@ -101,7 +101,7 @@ const epics: FilterWithCheckboxesProps['data'] = [
},
]
-const labels: FilterWithCheckboxesProps['data'] = [
+const labels: DropdownFilterProps['data'] = [
{
id: 4,
name: 'Mobile',
@@ -124,7 +124,7 @@ const labels: FilterWithCheckboxesProps['data'] = [
},
]
-const assignees: FilterWithCheckboxesProps['data'] = [
+const assignees: DropdownFilterProps['data'] = [
{
id: 1,
name: 'Unassigned',
@@ -152,7 +152,7 @@ const assignees: FilterWithCheckboxesProps['data'] = [
},
]
-const repositories: FilterWithCheckboxesProps['data'] = [
+const repositories: DropdownFilterProps['data'] = [
{
id: 1,
name: 'status-mobile',
@@ -191,7 +191,7 @@ const repositories: FilterWithCheckboxesProps['data'] = [
},
]
-const sortOptions: SortProps['data'] = [
+const sortOptions: DropdownSortProps['data'] = [
{
id: 1,
name: 'Default',
@@ -217,7 +217,6 @@ const sortOptions: SortProps['data'] = [
const TableIssues = () => {
const [issuesSearchText, setIssuesSearchText] = useState('')
const inputRef = useRef
(null)
- const [isMinimized, setIsMinimized] = useState(true)
const currentBreakpoint = useCurrentBreakpoint()
@@ -228,29 +227,51 @@ const TableIssues = () => {
-
-
-
+
+
+
}
size={32}
value={issuesSearchText}
onChangeText={setIssuesSearchText}
- onHandleMinimized={() => setIsMinimized(!isMinimized)}
- minimized={isMinimized}
+ variant="retractable"
direction={currentBreakpoint === '2xl' ? 'rtl' : 'ltr'}
ref={inputRef}
/>
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
diff --git a/packages/components/src/input/input.tsx b/packages/components/src/input/input.tsx
index 9fe3141c..5d2c94d9 100644
--- a/packages/components/src/input/input.tsx
+++ b/packages/components/src/input/input.tsx
@@ -1,4 +1,4 @@
-import { cloneElement, forwardRef } from 'react'
+import { cloneElement, forwardRef, useState } from 'react'
import { ClearIcon } from '@status-im/icons'
import { setupReactNative, Stack, styled } from '@tamagui/core'
@@ -24,10 +24,9 @@ type Props = GetProps
& {
icon?: React.ReactElement
label?: string
onClear?: () => void
- onHandleMinimized?: (isMinimized: boolean) => void
+ variant?: 'default' | 'retractable'
size?: 40 | 32
error?: boolean
- minimized?: boolean
direction?: 'ltr' | 'rtl'
}
@@ -41,14 +40,17 @@ const _Input = (props: Props, ref: Ref) => {
label,
onClear,
size = 40,
- minimized,
placeholder,
value,
direction = 'ltr',
- onHandleMinimized,
+ variant = 'default',
...rest
} = props
+ const [isMinimized, setIsMinimized] = useState(variant === 'retractable')
+
+ const isRetractable = variant === 'retractable'
+
return (
{Boolean(label || endLabel) && (
@@ -68,13 +70,13 @@ const _Input = (props: Props, ref: Ref) => {
{
event.stopPropagation()
event.preventDefault()
- if (onHandleMinimized && minimized) {
- onHandleMinimized(false)
+ if (isRetractable && isMinimized) {
+ setIsMinimized(false)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore ref is not inferred correctly here
@@ -87,12 +89,12 @@ const _Input = (props: Props, ref: Ref) => {
) : null}
{
- if (!value && onHandleMinimized && !minimized) {
- onHandleMinimized?.(true)
+ if (!value && isRetractable && !isMinimized) {
+ setIsMinimized(true)
}
}}
{...rest}