fixes more edge cases

This commit is contained in:
@wwwjim 2020-09-12 00:46:27 -07:00
parent 58d94d8f6a
commit 7f6fef1c72
3 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import { dispatchCustomEvent } from "~/common/custom-events";
const LINK_STYLES = ` const LINK_STYLES = `
font-family: ${Constants.font.text}; font-family: ${Constants.font.text};
font-weight: 400; font-weight: 400;
text-decoration: none;
color: ${Constants.system.moonstone}; color: ${Constants.system.moonstone};
cursor: pointer; cursor: pointer;
transition: 200ms ease color; transition: 200ms ease color;
@ -88,7 +89,7 @@ export const ProcessedText = ({ text }) => {
replacedText = StringReplace( replacedText = StringReplace(
replacedText, replacedText,
/@(\w*[0-9a-zA-Z]+\w*[0-9a-zA-Z])/g, /@(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g,
(match, i) => ( (match, i) => (
<a <a
css={STYLES_LINK} css={STYLES_LINK}
@ -103,7 +104,7 @@ export const ProcessedText = ({ text }) => {
replacedText = StringReplace( replacedText = StringReplace(
replacedText, replacedText,
/#(\w*[0-9a-zA-Z]+\w*[0-9a-zA-Z])/g, /#(\w*[0-9a-zA-Z-_]+\w*[0-9a-zA-Z-_])/g,
(match, i) => ( (match, i) => (
<span <span
css={STYLES_LINK} css={STYLES_LINK}

View File

@ -20,6 +20,10 @@ export default class ScenePublicProfile extends React.Component {
return null; return null;
} }
if (!prevProps.data) {
return null;
}
if (this.props.data.id === prevProps.data.id) { if (this.props.data.id === prevProps.data.id) {
return null; return null;
} }

View File

@ -20,6 +20,10 @@ export default class ScenePublicSlate extends React.Component {
return null; return null;
} }
if (!prevProps.data) {
return null;
}
if (this.props.data.id === prevProps.data.id) { if (this.props.data.id === prevProps.data.id) {
return null; return null;
} }