New add existing room/space modal (#2451)
Some checks failed
Deploy to Netlify (dev) / Deploy to Netlify (push) Has been cancelled

This commit is contained in:
Ajay Bura 2025-08-19 18:09:31 +05:30 committed by GitHub
parent 09b88d164f
commit 78a0d11f24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 390 additions and 19 deletions

View file

@ -30,9 +30,7 @@ import { SettingTile } from '../setting-tile';
import { useMatrixClient } from '../../hooks/useMatrixClient';
import { stopPropagation } from '../../utils/keyboard';
import { useAsyncSearch, UseAsyncSearchOptions } from '../../hooks/useAsyncSearch';
import { findAndReplace } from '../../utils/findAndReplace';
import { highlightText } from '../../styles/CustomHtml.css';
import { makeHighlightRegex } from '../../plugins/react-custom-html-parser';
import { highlightText, makeHighlightRegex } from '../../plugins/react-custom-html-parser';
export const useAdditionalCreators = (defaultCreators?: string[]) => {
const mx = useMatrixClient();
@ -245,19 +243,9 @@ export function AdditionalCreatorInput({
<Text size="T200" truncate>
<b>
{queryHighlighRegex
? findAndReplace(
? highlightText(queryHighlighRegex, [
getMxIdLocalPart(userId) ?? userId,
queryHighlighRegex,
(match, pushIndex) => (
<span
key={`highlight-${pushIndex}`}
className={highlightText}
>
{match[0]}
</span>
),
(txt) => txt
)
])
: getMxIdLocalPart(userId)}
</b>
</Text>