mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 02:35:39 +03:00
Make document titles better
This commit is contained in:
parent
5fae5d8cf5
commit
290243df0a
3 changed files with 25 additions and 5 deletions
|
@ -195,9 +195,26 @@ function AccountStatuses() {
|
||||||
|
|
||||||
const [featuredTags, setFeaturedTags] = useState([]);
|
const [featuredTags, setFeaturedTags] = useState([]);
|
||||||
useTitle(
|
useTitle(
|
||||||
`${account?.displayName ? account.displayName + ' ' : ''}@${
|
account?.acct
|
||||||
account?.acct ? account.acct : 'Account posts'
|
? `${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',
|
'/:instance?/a/:id',
|
||||||
);
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -42,7 +42,10 @@ function Hashtags({ media: mediaView, columnMode, ...props }) {
|
||||||
});
|
});
|
||||||
const { authenticated: currentAuthenticated } = api();
|
const { authenticated: currentAuthenticated } = api();
|
||||||
const hashtagTitle = hashtags.map((t) => `#${t}`).join(' ');
|
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`);
|
useTitle(title, `/:instance?/t/:hashtag`);
|
||||||
const latestItem = useRef();
|
const latestItem = useRef();
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,11 @@ const LIMIT = 20;
|
||||||
const emptySearchParams = new URLSearchParams();
|
const emptySearchParams = new URLSearchParams();
|
||||||
|
|
||||||
function Mentions({ columnMode, ...props }) {
|
function Mentions({ columnMode, ...props }) {
|
||||||
useTitle('Mentions', '/mentions');
|
|
||||||
const { masto, instance } = api();
|
const { masto, instance } = api();
|
||||||
const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();
|
const [searchParams] = columnMode ? [emptySearchParams] : useSearchParams();
|
||||||
const [stateType, setStateType] = useState(null);
|
const [stateType, setStateType] = useState(null);
|
||||||
const type = props?.type || searchParams.get('type') || stateType;
|
const type = props?.type || searchParams.get('type') || stateType;
|
||||||
|
useTitle(`Mentions${type === 'private' ? ' (Private)' : ''}`, '/mentions');
|
||||||
|
|
||||||
const mentionsIterator = useRef();
|
const mentionsIterator = useRef();
|
||||||
const latestItem = useRef();
|
const latestItem = useRef();
|
||||||
|
|
Loading…
Reference in a new issue