Yarn upgrade all the things

This commit is contained in:
Aarni Koskela
2022-02-11 14:14:24 +02:00
parent 8b9838a32e
commit 648798e11f
4 changed files with 1467 additions and 4963 deletions

View File

@@ -1,17 +1,25 @@
export const ChannelReferenceRenderer = (props: { value: string }) => {
import React from "react";
function renderStringWithChannelRefs(value: string) {
return (
<>
{props.value.split(/(<#[A-Z0-9]+\|[A-Za-z0-9]+>)/).map((str) => {
{value.split(/(<#[A-Z0-9]+\|[A-Za-z0-9]+>)/).map((str, i) => {
const matches = str.match(/<#([A-Z0-9]+)\|([A-Za-z0-9]+)>/);
if (matches) {
return (
<a href={`https://app.slack.com/client/T03BQ3NU9/${matches[1]}`}>
<a href={`https://app.slack.com/client/T03BQ3NU9/${matches[1]}`} key={i}>
#{matches[2]}
</a>
);
}
return str;
return <React.Fragment key={i}>{str}</React.Fragment>;
})}
</>
);
}
export const ChannelReferenceRenderer = ({ children }: React.PropsWithChildren<{}>) => {
// TODO: this should probably walk the tree
if (typeof children[0] === "string") return renderStringWithChannelRefs(children[0]);
return <>{children}</>;
};