tag optimization

This commit is contained in:
Anton Tranelis 2024-02-19 11:11:37 +01:00
parent e5da04c98d
commit beaf073e27
5 changed files with 7 additions and 6 deletions

View File

@ -13,6 +13,7 @@ import { getValue } from '../../../../Utils/GetValue';
import { LocateControl } from './LocateControl';
import * as L from 'leaflet';
import MarkerIconFactory from '../../../../Utils/MarkerIconFactory';
import { decodeTag } from '../../../../Utils/FormatTags';
@ -100,7 +101,7 @@ export const SearchControl = ({ clusterRef }) => {
let params = new URLSearchParams(window.location.search);
window.history.pushState({}, "", "/" + `${params? `?${params}` : ""}`);
}}>
<b>#{capitalizeFirstLetter(tag.name)}</b>
<b>#{decodeTag(tag.name)}</b>
</div>
))}
</div>

View File

@ -3,7 +3,7 @@ import { Item } from '../../../../types'
export const StartEndView = ({item} : {item?:Item}) => {
return (
<div className="tw-flex tw-flex-row tw-mb-4">
<div className="tw-flex tw-flex-row tw-mb-4 tw-mt-1">
<div className="tw-basis-2/5 tw-flex tw-flex-row">
<svg xmlns="http://www.w3.org/2000/svg" className="tw-h-4 tw-w-4 tw-mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
<path strokeLinecap="round" strokeLinejoin="round" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />

View File

@ -82,7 +82,7 @@ export function OverlayProfile() {
</div>
<div className='tw-overflow-y-auto tw-h-full tw-pt-4 fade'>
<div className='tw-grid tw-grid-cols-1 xl:tw-grid-cols-2'>
<div className='tw-grid tw-grid-cols-1'>
{
offers.length > 0 ?
<div className='tw-col-span-1'>

View File

@ -187,11 +187,11 @@ export function OverlayProfileSettings() {
let offer_state : Array<any> = [];
let needs_state : Array<any> = [];
offers.map(o => {
await offers.map(o => {
offer_state.push({directus_user_id: user?.id, tags_id: o.id})
});
needs.map(n => {
await needs.map(n => {
needs_state.push({directus_user_id: user?.id, tags_id: n.id})
});

View File

@ -4,5 +4,5 @@ export function decodeTag(string : string) {
}
export function encodeTag(string : string) {
return string.replace(/\s+/, "_");
return string.replace(/\s+/g, "_");
}