Format topic
This commit is contained in:
parent
307573830a
commit
1fe4c4d17e
File diff suppressed because one or more lines are too long
@ -8,6 +8,7 @@ import Button from 'components/ui/Button';
|
||||
import { join } from 'state/channels';
|
||||
import { searchChannels } from 'state/channelSearch';
|
||||
import { linkify } from 'utils';
|
||||
import colorify from 'utils/colorify';
|
||||
|
||||
const Channel = memo(({ network, name, topic, userCount, joined }) => {
|
||||
const dispatch = useDispatch();
|
||||
@ -35,7 +36,7 @@ const Channel = memo(({ network, name, topic, userCount, joined }) => {
|
||||
)}
|
||||
</div>
|
||||
<p className="modal-channel-topic">
|
||||
<Text>{linkify(topic)}</Text>
|
||||
<Text>{colorify(linkify(topic))}</Text>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
@ -7,6 +7,7 @@ import Button from 'components/ui/Button';
|
||||
import useModal from 'components/modals/useModal';
|
||||
import { getSelectedChannel } from 'state/channels';
|
||||
import { linkify } from 'utils';
|
||||
import colorify from 'utils/colorify';
|
||||
|
||||
const Topic = () => {
|
||||
const [modal, channel, closeModal] = useModal('topic');
|
||||
@ -20,7 +21,7 @@ const Topic = () => {
|
||||
<Button icon={FiX} className="modal-close" onClick={closeModal} />
|
||||
</div>
|
||||
<p className="modal-content">
|
||||
<Text>{linkify(topic)}</Text>
|
||||
<Text>{colorify(linkify(topic))}</Text>
|
||||
</p>
|
||||
</Modal>
|
||||
);
|
||||
|
@ -329,6 +329,10 @@ function colorifyString(str, state = {}) {
|
||||
}
|
||||
|
||||
export default function colorify(blocks) {
|
||||
if (!blocks) {
|
||||
return blocks;
|
||||
}
|
||||
|
||||
const result = [];
|
||||
let colored;
|
||||
let state;
|
||||
|
Loading…
Reference in New Issue
Block a user