diff --git a/src/components/topbar/topbar.module.css b/src/components/topbar/topbar.module.css index bfb22c83..1cc28969 100644 --- a/src/components/topbar/topbar.module.css +++ b/src/components/topbar/topbar.module.css @@ -44,7 +44,6 @@ background-color: var(--topbar-mobile-background-color); border-bottom: var(--topbar-mobile-border-bottom); font-size: var(--topbar-mobile-font-size); - color: var(--topbar-mobile-button-text-color); position: fixed; width: 100%; z-index: 3; @@ -54,7 +53,7 @@ } .boardNavMobile .pageJump a, .boardNavMobile .pageJump span { - color: var(--topbar-mobile-button-color); + color: var(--topbar-mobile-button-text-color); text-decoration: var(--button-text-decoration-mobile); } diff --git a/src/views/faq/faq.tsx b/src/views/faq/faq.tsx index fa7c09e2..386fd413 100644 --- a/src/views/faq/faq.tsx +++ b/src/views/faq/faq.tsx @@ -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 (
diff --git a/src/views/post/post.tsx b/src/views/post/post.tsx index 429e7cdf..415839cd 100644 --- a/src/views/post/post.tsx +++ b/src/views/post/post.tsx @@ -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 (
{isInSettigsView && }