aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Feeds.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-11-01 20:28:30 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:58 +0300
commit4b8d5219a2320e6d3d1e1260574bd6042c97b27e (patch)
tree11f5607560b2f45b3782a88fdc2962cf696b50f5 /vnext/src/ui/Feeds.js
parentb197e2616db62e25227548bfdb085f4e1f2908f0 (diff)
Add page titles
Diffstat (limited to 'vnext/src/ui/Feeds.js')
-rw-r--r--vnext/src/ui/Feeds.js37
1 files changed, 32 insertions, 5 deletions
diff --git a/vnext/src/ui/Feeds.js b/vnext/src/ui/Feeds.js
index 75f1800d..c0698204 100644
--- a/vnext/src/ui/Feeds.js
+++ b/vnext/src/ui/Feeds.js
@@ -11,6 +11,7 @@ import UserInfo from './UserInfo';
import { getMessages } from '../api';
import { useVisitor } from './VisitorContext';
+import { Helmet } from 'react-helmet';
/**
* @typedef {object} Query
@@ -27,7 +28,7 @@ import { useVisitor } from './VisitorContext';
function RequireAuth({ children }) {
let location = useLocation();
- let [ visitor ] = useVisitor();
+ let [visitor] = useVisitor();
if (!visitor.hash) {
// Redirect them to the /login page, but save the current location they were
// trying to go to when they were redirected. This allows us to send them
@@ -50,7 +51,14 @@ export function Discover() {
search: search,
pageParam: search.search ? 'page' : 'before_mid'
};
- return (<Feed query={query} />);
+ return (
+ <>
+ <Helmet>
+ <title>Discover</title>
+ </Helmet>
+ <Feed query={query} />
+ </>
+ );
}
/**
@@ -61,7 +69,14 @@ export function Discussions() {
baseUrl: '/api/messages/discussions',
pageParam: 'to'
};
- return (<Feed query={query} />);
+ return (
+ <>
+ <Helmet>
+ <title>Discussions</title>
+ </Helmet>
+ <Feed query={query} />
+ </>
+ );
}
/**
@@ -79,8 +94,13 @@ export function Blog() {
search: search,
pageParam: search.search ? 'page' : 'before_mid'
};
+ const blogTitle = `${user} blog`;
+ const pageTitle = search.tag ? `${blogTitle}: #${search.tag}` : blogTitle;
return (
<>
+ <Helmet>
+ <title>{pageTitle}</title>
+ </Helmet>
<div className="msg-cont">
<UserInfo uname={user} />
</div>
@@ -90,7 +110,7 @@ export function Blog() {
}
/**
- * @param {PageProps} props
+ *
*/
export function Tag() {
const params = useParams();
@@ -102,7 +122,14 @@ export function Tag() {
},
pageParam: 'before_mid'
};
- return (<Feed query={query} />);
+ return (
+ <>
+ <Helmet>
+ <title>#{tag}</title>
+ </Helmet>
+ <Feed query={query} />
+ </>
+ );
}
/**