[UI > AssetBrowser] Improve search, add name copying
This commit is contained in:
parent
9f1fe6313d
commit
0ec19aaf5c
2 changed files with 8 additions and 1 deletions
|
@ -16,7 +16,7 @@ export default function AssetBrowser() {
|
|||
title="SEARCH"
|
||||
/>
|
||||
<RN.FlatList
|
||||
data={Object.values(all).filter(a => a.name.startsWith(searchName))}
|
||||
data={Object.values(all).filter(a => a.name.includes(searchName))}
|
||||
renderItem={({ item }) => (
|
||||
<AssetDisplay asset={item} />
|
||||
)}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { Asset } from "@types";
|
||||
import { React, ReactNative as RN } from "@metro/common";
|
||||
import { showToast } from "@ui/toasts";
|
||||
import { getAssetIDByName } from "@ui/assets";
|
||||
import { Forms } from "@ui/components";
|
||||
import copyText from "@lib/utils/copyText";
|
||||
|
||||
interface AssetDisplayProps {
|
||||
asset: Asset;
|
||||
|
@ -20,6 +23,10 @@ export default function AssetDisplay({ asset }: AssetDisplayProps) {
|
|||
<FormRow
|
||||
label={`${asset.name} - ${asset.id}`}
|
||||
trailing={() => <RN.Image source={asset.id} style={styles.asset} />}
|
||||
onPress={() => {
|
||||
copyText(asset.name);
|
||||
showToast("Copied asset name to clipboard.", getAssetIDByName("toast_copy_link"))
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue