signal-desktop/ts/components/GroupDescriptionText.tsx

25 lines
765 B
TypeScript
Raw Normal View History

2021-06-17 17:15:51 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import type { RenderTextCallbackType } from '../types/Util';
2021-06-17 17:15:51 +00:00
import { AddNewLines } from './conversation/AddNewLines';
import { Emojify } from './conversation/Emojify';
import { Linkify } from './conversation/Linkify';
type PropsType = {
text: string;
};
const renderNonLink: RenderTextCallbackType = ({ key, text }) => (
<Emojify key={key} text={text} />
);
const renderNonNewLine: RenderTextCallbackType = ({ key, text }) => (
<Linkify key={key} text={text} renderNonLink={renderNonLink} />
);
2022-11-18 00:45:19 +00:00
export function GroupDescriptionText({ text }: PropsType): JSX.Element {
return <AddNewLines text={text} renderNonNewLine={renderNonNewLine} />;
}