Make document titles better
This commit is contained in:
parent
5fae5d8cf5
commit
290243df0a
|
@ -195,9 +195,26 @@ function AccountStatuses() {
|
|||
|
||||
const [featuredTags, setFeaturedTags] = useState([]);
|
||||
useTitle(
|
||||
`${account?.displayName ? account.displayName + ' ' : ''}@${
|
||||
account?.acct ? account.acct : 'Account posts'
|
||||
}`,
|
||||
account?.acct
|
||||
? `${account?.displayName ? account.displayName + ' ' : ''}@${
|
||||
account.acct
|
||||
}${
|
||||
!excludeReplies
|
||||
? ' (+ Replies)'
|
||||
: excludeBoosts
|
||||
? ' (- Boosts)'
|
||||
: tagged
|
||||
? ` (#${tagged})`
|
||||
: media
|
||||
? ' (Media)'
|
||||
: month
|
||||
? ` (${new Date(month).toLocaleString('default', {
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
})})`
|
||||
: ''
|
||||
}`
|
||||
: 'Account posts',
|
||||
'/:instance?/a/:id',
|
||||
);
|
||||
useEffect(() => {
|
||||
|
|
|
@ -42,7 +42,10 @@ function Hashtags({ media: mediaView, columnMode, ...props }) {
|
|||
});
|
||||
const { authenticated: currentAuthenticated } = api();
|
||||
const hashtagTitle = hashtags.map((t) => `#${t}`).join(' ');
|
||||
const title = instance ? `${hashtagTitle} on ${instance}` : hashtagTitle;
|
||||
const hashtagPostTitle = media ? ` (Media only)` : '';
|
||||
const title = instance
|
||||
? `${hashtagTitle}${hashtagPostTitle} on ${instance}`
|
||||
: `${hashtagTitle}${hashtagPostTitle}`;
|
||||
useTitle(title, `/:instance?/t/:hashtag`);
|
||||
const latestItem = useRef();
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ const LIMIT = 20;
|
|||
const emptySearchParams = new URLSearchParams();
|
||||
|
||||
function Mentions({ columnMode, ...props }) {
|
||||
useTitle('Mentions', '/mentions');
|
||||
const { masto, instance } = api();
|
||||
const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();
|
||||
const [stateType, setStateType] = useState(null);
|
||||
const type = props?.type || searchParams.get('type') || stateType;
|
||||
useTitle(`Mentions${type === 'private' ? ' (Private)' : ''}`, '/mentions');
|
||||
|
||||
const mentionsIterator = useRef();
|
||||
const latestItem = useRef();
|
||||
|
|
Loading…
Reference in a new issue