aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/components')
-rw-r--r--vnext/src/components/Avatar.js12
-rw-r--r--vnext/src/components/Message.js10
-rw-r--r--vnext/src/components/Thread.js4
-rw-r--r--vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap12
4 files changed, 16 insertions, 22 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js
index f79d7b09..31d7dd34 100644
--- a/vnext/src/components/Avatar.js
+++ b/vnext/src/components/Avatar.js
@@ -4,7 +4,7 @@ import { Link } from 'react-router-dom';
import { UserType } from './Types';
-export default function Avatar(props) {
+const Avatar = React.memo(function AvatarComponent(props) {
return (
<div style={{ display: 'flex' }}>
<div className="msg-avatar">
@@ -13,16 +13,18 @@ export default function Avatar(props) {
</Link>
</div>
<div style={{ display: 'flex', flexDirection: 'column' }}>
- <span itemProp="author" itemScope="" itemType="http://schema.org/Person">
- <Link to={{ pathname: `/${props.user.uname}/` }} itemProp="url" rel="author">
- <span itemProp="name">{props.user.uname}</span>
+ <span>
+ <Link to={{ pathname: `/${props.user.uname}/` }}>
+ <span>{props.user.uname}</span>
</Link>
</span>
{props.children}
</div>
</div>
);
-}
+});
+
+export default Avatar;
Avatar.propTypes = {
user: UserType,
diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js
index b36936ba..1ecbf996 100644
--- a/vnext/src/components/Message.js
+++ b/vnext/src/components/Message.js
@@ -11,12 +11,12 @@ import { format } from '../utils/embed';
export default function Message({ data, visitor, children, ...rest }) {
return (
- <div className="msg-cont" itemProp="blogPost" itemScope="" itemType="http://schema.org/BlogPosting" itemRef="org">
+ <div className="msg-cont">
<header className="h">
<Avatar user={data.user}>
<div className="msg-ts">
<Link to={{ pathname: `/${data.user.uname}/${data.mid}`, state: { msg: data } }}>
- <time itemProp="datePublished dateModified" itemType="http://schema.org/Date" dateTime={data.timestamp}
+ <time dateTime={data.timestamp}
title={moment.utc(data.timestamp).local().format('lll')}>
{moment.utc(data.timestamp).fromNow()}
</time>
@@ -26,11 +26,11 @@ export default function Message({ data, visitor, children, ...rest }) {
<Tags user={data.user} data={data.tags || []} />
</header>
<div className="msg-txt">
- <p itemProp="description" dangerouslySetInnerHTML={{ __html: format(data.body, data.mid, (data.tags || []).indexOf('code') >= 0) }}></p>
+ <p dangerouslySetInnerHTML={{ __html: format(data.body, data.mid, (data.tags || []).indexOf('code') >= 0) }}></p>
</div>
{data.photo &&
<p className="ir"><a href={`//i.juick.com/p/${data.mid}.${data.attach}`} data-fname={`${data.mid}.${data.attach}`}>
- <img itemProp="image" src={`//i.juick.com/photos-512/${data.mid}.${data.attach}`} alt="" /></a>
+ <img src={`//i.juick.com/photos-512/${data.mid}.${data.attach}`} alt="" /></a>
</p>
}
<nav className="l">
@@ -91,7 +91,7 @@ export default function Message({ data, visitor, children, ...rest }) {
function Tags({ data, user, ...rest }) {
return data.length > 0 && (
- <div className="msg-tags" itemProp="headline">
+ <div className="msg-tags">
{
data.map(tag => {
return (<Link key={tag} to={{ pathname: `/${user.uname}`, search: `?tag=${tag}` }} title={tag}>{tag}</Link>);
diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js
index 2097a315..a1255fd5 100644
--- a/vnext/src/components/Thread.js
+++ b/vnext/src/components/Thread.js
@@ -103,7 +103,7 @@ export default class Thread extends React.Component {
<Avatar user={msg.user}>
<div className="msg-ts">
<a href={`/${msg.user.uname}/${msg.mid}`}>
- <time itemProp="datePublished dateModified" itemType="http://schema.org/Date" dateTime={msg.timestamp}
+ <time dateTime={msg.timestamp}
title={moment.utc(msg.timestamp).local().format('lll')}>
{moment.utc(msg.timestamp).fromNow()}
</time>
@@ -119,7 +119,7 @@ export default class Thread extends React.Component {
{
msg.photo &&
<p className="ir"><a href={`//i.juick.com/p/${msg.mid}-${msg.rid}.${msg.attach}`} data-fname={`${msg.mid}-${msg.rid}.${msg.attach}`}>
- <img itemProp="image" src={`//i.juick.com/p/${msg.mid}-${msg.rid}.${msg.attach}`} alt="" /></a>
+ <img src={`//i.juick.com/p/${msg.mid}-${msg.rid}.${msg.attach}`} alt="" /></a>
</p>
}
<div className="msg-links">
diff --git a/vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap b/vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap
index e44b49db..ef7be4ed 100644
--- a/vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap
+++ b/vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap
@@ -29,20 +29,12 @@ exports[`Avatar renders correctly 1`] = `
}
}
>
- <span
- itemProp="author"
- itemScope=""
- itemType="http://schema.org/Person"
- >
+ <span>
<a
href="/ugnich/"
- itemProp="url"
onClick={[Function]}
- rel="author"
>
- <span
- itemProp="name"
- >
+ <span>
ugnich
</span>
</a>