fix: flash of untranslated title in `settings/my-account/profile` (#6163)

* fix: flash of untranslated content

* feat: extract loading into a variable

* fix: use optional chaining because typescript complaining

* feat: render Meta component even if not loading for seo purpose

* fix: received an array with more than 1 element as
children warning

* fix: changes

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
pull/6293/head
Nafees Nazik 2023-01-06 23:05:32 +05:30 committed by GitHub
parent 0d485ffed6
commit fa9d72fc0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -181,7 +181,9 @@ const ProfileView = () => {
};
if (isLoading || !user || isLoadingAvatar || !avatar)
return <SkeletonLoader title={t("profile")} description={t("profile_description")} />;
return (
<SkeletonLoader title={t("profile")} description={t("profile_description", { appName: APP_NAME })} />
);
const defaultValues = {
username: user.username || "",

View File

@ -54,11 +54,10 @@ export default function Meta({ title, description, backButton, CTA }: MetaType)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [title, description, backButton, CTA]);
const title_ = `${title} | ${APP_NAME}`;
return (
<Head>
<title>
{title} | {APP_NAME}
</title>
<title>{title_}</title>
<meta name="description" content={description} />
</Head>
);