mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-25 01:52:45 +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 = `
|
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}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user