mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-09 20:28:29 +03:00
fixes more edge cases
This commit is contained in:
parent
58d94d8f6a
commit
7f6fef1c72
@ -9,6 +9,7 @@ import { dispatchCustomEvent } from "~/common/custom-events";
|
||||
const LINK_STYLES = `
|
||||
font-family: ${Constants.font.text};
|
||||
font-weight: 400;
|
||||
text-decoration: none;
|
||||
color: ${Constants.system.moonstone};
|
||||
cursor: pointer;
|
||||
transition: 200ms ease color;
|
||||
@ -88,7 +89,7 @@ export const ProcessedText = ({ text }) => {
|
||||
|
||||
replacedText = StringReplace(
|
||||
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) => (
|
||||
<a
|
||||
css={STYLES_LINK}
|
||||
@ -103,7 +104,7 @@ export const ProcessedText = ({ text }) => {
|
||||
|
||||
replacedText = StringReplace(
|
||||
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) => (
|
||||
<span
|
||||
css={STYLES_LINK}
|
||||
|
@ -20,6 +20,10 @@ export default class ScenePublicProfile extends React.Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!prevProps.data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.props.data.id === prevProps.data.id) {
|
||||
return null;
|
||||
}
|
||||
|
@ -20,6 +20,10 @@ export default class ScenePublicSlate extends React.Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!prevProps.data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.props.data.id === prevProps.data.id) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user