From fa9d72fc0a6d626cc1cd8284f00802361631b902 Mon Sep 17 00:00:00 2001 From: Nafees Nazik <84864519+G3root@users.noreply.github.com> Date: Fri, 6 Jan 2023 23:05:32 +0530 Subject: [PATCH] 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 --- apps/web/pages/settings/my-account/profile.tsx | 4 +++- packages/ui/v2/core/Meta.tsx | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web/pages/settings/my-account/profile.tsx b/apps/web/pages/settings/my-account/profile.tsx index 4585c34351..33764324e6 100644 --- a/apps/web/pages/settings/my-account/profile.tsx +++ b/apps/web/pages/settings/my-account/profile.tsx @@ -181,7 +181,9 @@ const ProfileView = () => { }; if (isLoading || !user || isLoadingAvatar || !avatar) - return ; + return ( + + ); const defaultValues = { username: user.username || "", diff --git a/packages/ui/v2/core/Meta.tsx b/packages/ui/v2/core/Meta.tsx index 2f143b8384..e868802205 100644 --- a/packages/ui/v2/core/Meta.tsx +++ b/packages/ui/v2/core/Meta.tsx @@ -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 ( - - {title} | {APP_NAME} - + {title_} );