Updated page titles.

This commit is contained in:
Mike Cao 2023-04-21 15:14:30 -07:00
parent 39f630400f
commit a7e6c32460
10 changed files with 18 additions and 22 deletions

View File

@ -57,7 +57,13 @@ if (process.env.TRACKER_SCRIPT_NAME) {
}
}
const redirects = [];
const redirects = [
{
source: '/settings',
destination: process.env.CLOUD_MODE ? '/settings/profile' : '/settings/websites',
permanent: true,
},
];
if (process.env.CLOUD_MODE) {
redirects.push({

View File

@ -9,8 +9,10 @@ export default function RealtimeDetailsPage() {
const { id: websiteId } = router.query;
const { formatMessage, labels } = useMessages();
const { get, useQuery } = useApi();
const { data: website } = useQuery(['websites', websiteId], () => get(`/websites/${websiteId}`));
const title = formatMessage(labels.realtime) + ' | ' + website?.name;
const { data: website } = useQuery(['websites', websiteId], () =>
get(`/websites/${websiteId}`, { enabled: !!websiteId }),
);
const title = `${formatMessage(labels.realtime)}${website?.name ? ` - ${website.name}` : ''}`;
if (!websiteId) {
return null;

View File

@ -1,12 +0,0 @@
export default () => null;
export async function getServerSideProps() {
const dest = process.env.CLOUD_MODE ? 'profile' : 'websites';
return {
redirect: {
destination: `/settings/${dest}`,
permanent: true,
},
};
}

View File

@ -6,7 +6,7 @@ import useMessages from 'hooks/useMessages';
export default function ProfilePage() {
const { formatMessage, labels } = useMessages();
return (
<AppLayout title={formatMessage(labels.profile)}>
<AppLayout title={`${formatMessage(labels.settings)} - ${formatMessage(labels.profile)}`}>
<SettingsLayout>
<ProfileSettings />
</SettingsLayout>

View File

@ -14,7 +14,7 @@ export default function TeamDetailPage({ disabled }) {
}
return (
<AppLayout title={formatMessage(labels.teams)}>
<AppLayout title={`${formatMessage(labels.settings)} - ${formatMessage(labels.teams)}`}>
<SettingsLayout>
<TeamSettings teamId={id} />
</SettingsLayout>

View File

@ -10,7 +10,7 @@ export default function TeamsPage({ disabled }) {
}
return (
<AppLayout title={formatMessage(labels.teams)}>
<AppLayout title={`${formatMessage(labels.settings)} - ${formatMessage(labels.teams)}`}>
<SettingsLayout>
<TeamsList />
</SettingsLayout>

View File

@ -14,7 +14,7 @@ export default function TeamDetailPage({ disabled }) {
}
return (
<AppLayout title={formatMessage(labels.users)}>
<AppLayout title={`${formatMessage(labels.settings)} - ${formatMessage(labels.users)}`}>
<SettingsLayout>
<UserSettings userId={id} />
</SettingsLayout>

View File

@ -10,7 +10,7 @@ export default function UsersPage({ disabled }) {
}
return (
<AppLayout title={formatMessage(labels.users)}>
<AppLayout title={`${formatMessage(labels.settings)} - ${formatMessage(labels.users)}`}>
<SettingsLayout>
<UsersList />
</SettingsLayout>

View File

@ -14,7 +14,7 @@ export default function WebsiteSettingsPage({ disabled }) {
}
return (
<AppLayout title={formatMessage(labels.websites)}>
<AppLayout title={`${formatMessage(labels.settings)} - ${formatMessage(labels.websites)}`}>
<SettingsLayout>
<WebsiteSettings websiteId={id} />
</SettingsLayout>

View File

@ -10,7 +10,7 @@ export default function WebsitesPage({ disabled }) {
}
return (
<AppLayout title={formatMessage(labels.websites)}>
<AppLayout title={`${formatMessage(labels.settings)} - ${formatMessage(labels.websites)}`}>
<SettingsLayout>
<WebsitesList />
</SettingsLayout>