This commit is contained in:
Tom (plebeius.eth)
2024-07-02 15:39:20 +02:00
parent 66cc23c404
commit 3f39e1efba
3 changed files with 15 additions and 4 deletions
+6
View File
@@ -1,8 +1,14 @@
import { useEffect } from 'react';
import { HashLink } from 'react-router-hash-link';
import { Footer, HomeLogo } from '../home';
import styles from './faq.module.css';
const FAQ = () => {
useEffect(() => {
window.scrollTo(0, 0);
document.title = 'FAQ - plebchan';
}, []);
return (
<div className={styles.wrapper}>
<div className={styles.content}>
+8 -2
View File
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { Role, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks';
import { Comment, Role, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks';
import { useLocation, useParams } from 'react-router-dom';
import { isDescriptionView, isRulesView, isSettingsView } from '../../lib/utils/view-utils';
import useIsMobile from '../../hooks/use-is-mobile';
@@ -68,7 +68,7 @@ const PostPage = () => {
// if the comment is a reply, return the post comment instead, then the reply will be highlighted in the thread
const postComment = useComment({ commentCid: comment?.postCid });
let post;
let post: Comment;
if (comment.parentCid) {
post = postComment;
} else {
@@ -82,6 +82,12 @@ const PostPage = () => {
window.scrollTo(0, 0);
}, []);
useEffect(() => {
const boardTitle = title ? title : shortAddress || subplebbitAddress;
const postTitle = post?.title?.slice(0, 30) || post?.content?.slice(0, 30);
document.title = (postTitle ? postTitle.trim() + '... - ' : '') + boardTitle + ' - plebchan';
}, [title, shortAddress, subplebbitAddress, post?.title, post?.content]);
return (
<div className={styles.content}>
{isInSettigsView && <SettingsModal />}