mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
multi-word-tags
This commit is contained in:
parent
e74de18b95
commit
bd193acabf
@ -13,7 +13,7 @@ export const TagsControl = () => {
|
||||
<div key={tag.id} className='tw-rounded-2xl tw-text-white tw-p-2 tw-px-4 tw-shadow-xl tw-card tw-mr-2 tw-mb-2' style={{ backgroundColor: tag.color }}>
|
||||
<div className="tw-card-actions tw-justify-end">
|
||||
<label className="tw-btn tw-btn-xs tw-btn-circle tw-absolute tw--right-2 tw--top-2 tw-bg-white tw-text-gray-600" onClick={() => (removeFilterTag(tag.name!))}>✕</label>
|
||||
</div><b>#{capitalizeFirstLetter(tag.name)}</b>
|
||||
</div><b>#{formatTag(tag.name)}</b>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@ -21,6 +21,11 @@ export const TagsControl = () => {
|
||||
}
|
||||
|
||||
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
function formatTag(string : string) {
|
||||
console.log(string);
|
||||
|
||||
let formatedTag = string.replace(/_/g, " ");
|
||||
console.log(formatedTag);
|
||||
|
||||
return formatedTag = formatedTag.charAt(0).toUpperCase() + formatedTag.slice(1);
|
||||
}
|
||||
@ -1 +1 @@
|
||||
export const hashTagRegex = /(#+[a-zA-Z0-9A-Za-zÀ-ÖØ-öø-ʸ(_)]{1,})/g;
|
||||
export const hashTagRegex = /(#+[a-zA-Z0-9À-ÖØ-öø-ʸ_-]{1,})/g;
|
||||
Loading…
x
Reference in New Issue
Block a user