From 8dbfbb23681942c14cc5adb2a3083c26149fc83c Mon Sep 17 00:00:00 2001 From: KrNel Date: Thu, 23 May 2019 20:59:10 -0400 Subject: [PATCH] Added HTML header data for all Steem pages I had neglected custom HTML head tags for all pages except posts. This has been corrected for all Steem related pages, which have custom titles and descriptions. --- .../pages/Steem/AuthorCatgoryTime.js | 53 +++++++++---------- .../components/pages/Steem/Post/Comment.js | 2 +- .../pages/Steem/Post/PostDetails.js | 2 +- client/src/components/pages/Steem/Posts.js | 41 ++++++++++++++ 4 files changed, 69 insertions(+), 29 deletions(-) diff --git a/client/src/components/pages/Steem/AuthorCatgoryTime.js b/client/src/components/pages/Steem/AuthorCatgoryTime.js index 003b891..20139ff 100644 --- a/client/src/components/pages/Steem/AuthorCatgoryTime.js +++ b/client/src/components/pages/Steem/AuthorCatgoryTime.js @@ -19,33 +19,32 @@ import './AuthorCatgoryTime.css'; * @param {number} payoutValue Post payout value * @param {string} createdFromNow Time since post was created */ -const AuthorCatgoryTime = ({ author, authorReputation, category, created, permlink }) => { - return ( -
- -
- ) -} +const AuthorCatgoryTime = ({ author, authorReputation, category, created, permlink }) => ( +
+ +
+) + AuthorCatgoryTime.propTypes = { author: PropTypes.string, diff --git a/client/src/components/pages/Steem/Post/Comment.js b/client/src/components/pages/Steem/Post/Comment.js index 8be01c7..c61d0dc 100644 --- a/client/src/components/pages/Steem/Post/Comment.js +++ b/client/src/components/pages/Steem/Post/Comment.js @@ -172,7 +172,7 @@ class Comment extends Component { const id = comment.id; const author = comment.author; const permlink = comment.permlink; - const created = comment.created; + const created = `${comment.created}Z`; const anchorLink = `#@${author}/${permlink}`; const activeVotes = comment.active_votes; const totalPayout = diff --git a/client/src/components/pages/Steem/Post/PostDetails.js b/client/src/components/pages/Steem/Post/PostDetails.js index 562f560..4b01289 100644 --- a/client/src/components/pages/Steem/Post/PostDetails.js +++ b/client/src/components/pages/Steem/Post/PostDetails.js @@ -225,7 +225,7 @@ class PostDetails extends Component { - + diff --git a/client/src/components/pages/Steem/Posts.js b/client/src/components/pages/Steem/Posts.js index 629a3c8..f3e3001 100644 --- a/client/src/components/pages/Steem/Posts.js +++ b/client/src/components/pages/Steem/Posts.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Header, Label, Grid, Icon } from 'semantic-ui-react'; import { withRouter, Link } from 'react-router-dom'; +import { Helmet } from 'react-helmet-async'; import PostsSummaryGrid from './PostsSummaryGrid'; import PostsSummaryList from './PostsSummaryList'; @@ -23,6 +24,7 @@ import FollowButton from './FollowButton'; import Follows from './Follows'; import './Posts.css'; +import defaultImage from '../../../images/steemkure-600.png'; /** * Gets the Steem blockchain content and displays a list of post @@ -357,6 +359,7 @@ class Posts extends Component { props: { match: { path, + url, }, user, csrf, @@ -460,8 +463,46 @@ class Posts extends Component { ); } + let pageTitle = ''; + let desc = ''; + + if (page === 'blog') { + pageTitle = `${author}'s Blog`; + desc = `Check out the latest content from ${author}.`; + }else if (page === 'feed') { + pageTitle = `${author}'s Feed`; + desc = `Look at ${author}'s feed of posts around Steem.`; + }else if (path === '/@:author/followers') { + pageTitle = `${author}'s Followers`; + desc = `Look at ${author}'s followers on Steem.`; + }else if (path === '/@:author/following') { + pageTitle = `${author}'s Following`; + desc = `Look at who ${author} is following on Steem.`; + }else { + let filterPage = this.selectedFilter.charAt(0).toUpperCase() + this.selectedFilter.slice(1); + filterPage = filterPage.indexOf('Created') === 0 ? 'New' : filterPage; + pageTitle = `${filterPage} Steem Posts`; + desc = `Check out the latest ${filterPage} content on Steem.`; + } + + const metaUrl = `https://thekure.net${url}`; + const metaTitle = `${pageTitle} - KURE`; + const image = `https://thekure.net${defaultImage}`; + return ( + + {pageTitle} + + + + + + + + + +