mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-14 02:15:57 -04:00
Show folder for search results in mobile app (#1665)
This commit is contained in:
committed by
Leendert de Borst
parent
2b82ad6565
commit
f9986894d1
@@ -1177,7 +1177,7 @@ export default function ItemsScreen(): React.ReactNode {
|
||||
isLoadingItems ? (
|
||||
<SkeletonLoader count={1} height={60} parts={2} />
|
||||
) : (
|
||||
<ItemCard item={itm} onItemDelete={onItemDelete} />
|
||||
<ItemCard item={itm} onItemDelete={onItemDelete} showFolderPath={!!searchQuery} />
|
||||
)
|
||||
}
|
||||
ListEmptyComponent={renderEmptyComponent() as React.ReactElement}
|
||||
|
||||
@@ -19,12 +19,13 @@ import { getFieldValue, FieldKey } from '@/utils/dist/core/models/vault';
|
||||
type ItemCardProps = {
|
||||
item: Item;
|
||||
onItemDelete?: (itemId: string) => Promise<void>;
|
||||
showFolderPath?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Item card component for displaying vault items in a list.
|
||||
*/
|
||||
export function ItemCard({ item, onItemDelete }: ItemCardProps): React.ReactNode {
|
||||
export function ItemCard({ item, onItemDelete, showFolderPath = false }: ItemCardProps): React.ReactNode {
|
||||
const colors = useColors();
|
||||
const { t } = useTranslation();
|
||||
const { showConfirm } = useDialog();
|
||||
@@ -257,6 +258,11 @@ export function ItemCard({ item, onItemDelete }: ItemCardProps): React.ReactNode
|
||||
serviceNameRow: {
|
||||
alignItems: 'center',
|
||||
flexDirection: 'row',
|
||||
flexWrap: 'wrap',
|
||||
},
|
||||
folderPath: {
|
||||
color: colors.textMuted,
|
||||
fontSize: 14,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -284,6 +290,9 @@ export function ItemCard({ item, onItemDelete }: ItemCardProps): React.ReactNode
|
||||
<ItemIcon item={item} style={styles.logo} />
|
||||
<View style={styles.itemInfo}>
|
||||
<View style={styles.serviceNameRow}>
|
||||
{showFolderPath && item.FolderPath && (
|
||||
<Text style={styles.folderPath}>{item.FolderPath} > </Text>
|
||||
)}
|
||||
<Text style={styles.serviceName}>
|
||||
{getItemName(item)}
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user