mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
optimizations for unlisted user items
This commit is contained in:
parent
871e853340
commit
ab4d60c950
@ -65,7 +65,7 @@ export const SearchControl = () => {
|
||||
setItemsResults(items.filter(item => {
|
||||
if (item.layer?.itemNameField) item.name = getValue(item, item.layer.itemNameField)
|
||||
if (item.layer?.itemTextField) item.text = getValue(item, item.layer.itemTextField)
|
||||
return value.length > 2 && (item.name?.toLowerCase().includes(value.toLowerCase()) || item.text?.toLowerCase().includes(value.toLowerCase()))
|
||||
return value.length > 2 && ((item.layer?.listed && item.name?.toLowerCase().includes(value.toLowerCase()) || item.text?.toLowerCase().includes(value.toLowerCase())))
|
||||
}))
|
||||
let phrase = value;
|
||||
if (value.startsWith("#")) phrase = value.substring(1);
|
||||
|
||||
@ -68,6 +68,7 @@ export function OverlayItemProfile() {
|
||||
scroll();
|
||||
}, [addItemPopupType])
|
||||
|
||||
const profile = items.find(i => (i.user_created?.id === item.id) && i.layer?.itemType.name === "user");
|
||||
|
||||
const updateActiveTab = (id: number) => {
|
||||
setActiveTab(id);
|
||||
@ -304,7 +305,7 @@ export function OverlayItemProfile() {
|
||||
{item.layer?.itemType.onepager &&
|
||||
<>
|
||||
{item.user_created.first_name && (
|
||||
<ContactInfo name={item.user_created.first_name} avatar={item.user_created.avatar} email={item.contact} telephone={item.telephone} />
|
||||
<ContactInfo name={profile?.name ? profile.name : item.user_created.first_name} avatar={profile?.image ? profile.image : item.user_created.avatar} email={item.contact} telephone={item.telephone} />
|
||||
)}
|
||||
|
||||
{/* Description Section */}
|
||||
|
||||
@ -205,7 +205,7 @@ export function OverlayItemProfileSettings() {
|
||||
position: item.position,
|
||||
contact: contact,
|
||||
telephone: telephone,
|
||||
markerIcon: markerIcon,
|
||||
...markerIcon && {markerIcon: markerIcon},
|
||||
next_appointment: nextAppointment,
|
||||
...image.length > 10 && { image: image },
|
||||
...offers.length > 0 && { offers: offer_updates },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user