rename pickerEnabled, add showPicker to MultiPathField, export both fields
Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
@@ -68,7 +68,7 @@ export function PathFinder({
|
|||||||
placeholder={sourceOptions.placeholder}
|
placeholder={sourceOptions.placeholder}
|
||||||
showSuggestions={sourceOptions.showSuggestions}
|
showSuggestions={sourceOptions.showSuggestions}
|
||||||
clearable={sourceOptions.clearable}
|
clearable={sourceOptions.clearable}
|
||||||
pickerEnabled={sourceOptions.showPicker}
|
showPicker={sourceOptions.showPicker}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{switchable && (
|
{switchable && (
|
||||||
@@ -93,7 +93,7 @@ export function PathFinder({
|
|||||||
placeholder={destOptions.placeholder}
|
placeholder={destOptions.placeholder}
|
||||||
showSuggestions={destOptions.showSuggestions}
|
showSuggestions={destOptions.showSuggestions}
|
||||||
clearable={destOptions.clearable}
|
clearable={destOptions.clearable}
|
||||||
pickerEnabled={destOptions.showPicker}
|
showPicker={destOptions.showPicker}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -208,14 +208,14 @@ export function MultiPathFinder({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function PathField({
|
export function PathField({
|
||||||
path,
|
path,
|
||||||
setPath,
|
setPath,
|
||||||
label,
|
label,
|
||||||
placeholder = 'Enter a remote:/path or local path, or tap to select files',
|
placeholder = 'Enter a remote:/path or local path, or tap to select files',
|
||||||
showSuggestions = true,
|
showSuggestions = true,
|
||||||
clearable = true,
|
clearable = true,
|
||||||
pickerEnabled = true,
|
showPicker = true,
|
||||||
}: {
|
}: {
|
||||||
path: string
|
path: string
|
||||||
setPath: (path: string) => void
|
setPath: (path: string) => void
|
||||||
@@ -223,11 +223,11 @@ function PathField({
|
|||||||
placeholder?: string
|
placeholder?: string
|
||||||
showSuggestions?: boolean
|
showSuggestions?: boolean
|
||||||
clearable?: boolean
|
clearable?: boolean
|
||||||
pickerEnabled?: boolean
|
showPicker?: boolean
|
||||||
}) {
|
}) {
|
||||||
const remotes = useStore((state) => state.remotes)
|
const remotes = useStore((state) => state.remotes)
|
||||||
|
|
||||||
const [debouncedPath] = useDebounce(path, 200)
|
const [debouncedPath] = useDebounce(path, 800)
|
||||||
|
|
||||||
const fieldRef = useRef<HTMLInputElement>(null)
|
const fieldRef = useRef<HTMLInputElement>(null)
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ function PathField({
|
|||||||
))}
|
))}
|
||||||
</Autocomplete>
|
</Autocomplete>
|
||||||
</div>
|
</div>
|
||||||
{pickerEnabled && (
|
{showPicker && (
|
||||||
<Button
|
<Button
|
||||||
onPress={handleBrowse}
|
onPress={handleBrowse}
|
||||||
type="button"
|
type="button"
|
||||||
@@ -440,12 +440,13 @@ function PathField({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function MultiPathField({
|
export function MultiPathField({
|
||||||
paths,
|
paths,
|
||||||
setPaths,
|
setPaths,
|
||||||
label,
|
label,
|
||||||
placeholder = 'Enter a remote:/path or local path, or tap to select files',
|
placeholder = 'Enter a remote:/path or local path, or tap to select files',
|
||||||
showSuggestions = true,
|
showSuggestions = true,
|
||||||
|
showPicker = true,
|
||||||
clearable = true,
|
clearable = true,
|
||||||
}: {
|
}: {
|
||||||
paths: string[]
|
paths: string[]
|
||||||
@@ -453,11 +454,12 @@ function MultiPathField({
|
|||||||
label: string
|
label: string
|
||||||
placeholder?: string
|
placeholder?: string
|
||||||
showSuggestions?: boolean
|
showSuggestions?: boolean
|
||||||
|
showPicker?: boolean
|
||||||
clearable?: boolean
|
clearable?: boolean
|
||||||
}) {
|
}) {
|
||||||
const remotes = useStore((state) => state.remotes)
|
const remotes = useStore((state) => state.remotes)
|
||||||
|
|
||||||
const [debouncedPath] = useDebounce(paths?.[0], 200)
|
const [debouncedPath] = useDebounce(paths?.[0], 800)
|
||||||
|
|
||||||
const fieldRef = useRef<HTMLInputElement>(null)
|
const fieldRef = useRef<HTMLInputElement>(null)
|
||||||
|
|
||||||
@@ -683,6 +685,7 @@ function MultiPathField({
|
|||||||
</Autocomplete>
|
</Autocomplete>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{showPicker && (
|
||||||
<div className="relative w-20 group h-18">
|
<div className="relative w-20 group h-18">
|
||||||
<Button
|
<Button
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
@@ -739,6 +742,7 @@ function MultiPathField({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user