From 9c575f36b5699300cdd7d4ee902dd4e484490e1e Mon Sep 17 00:00:00 2001 From: tomolld Date: Sat, 23 Nov 2024 17:51:51 +0900 Subject: [PATCH 1/2] Improve layout and add edit button for user-owned translations --- .../components/ContentWithTranslations.tsx | 55 ++++++++++--------- .../routes/$userName+/page+/$slug+/index.tsx | 2 +- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx b/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx index ea403486..63981ed8 100644 --- a/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx +++ b/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx @@ -57,20 +57,35 @@ export function ContentWithTranslations({ ); return ( <> -

- {sourceTitleWithTranslations && ( - - )} -

+
+ +

+ {sourceTitleWithTranslations && ( + + )} +

+ {pageWithTranslations.user.userName === currentUserName && + currentUserName && ( +
+ +
+ )} +
- {pageWithTranslations.user.userName === currentUserName && - currentUserName && ( -
- -
- )} {!isHydrated ? (
diff --git a/web/app/routes/$userName+/page+/$slug+/index.tsx b/web/app/routes/$userName+/page+/$slug+/index.tsx index 64cf36dc..90ea065f 100644 --- a/web/app/routes/$userName+/page+/$slug+/index.tsx +++ b/web/app/routes/$userName+/page+/$slug+/index.tsx @@ -219,7 +219,7 @@ export default function Page() { showOriginal={showOriginal} showTranslation={showTranslation} /> -
+
{pageWithTranslations.tagPages.map((tagPage) => (
Date: Sat, 23 Nov 2024 17:51:58 +0900 Subject: [PATCH 2/2] f --- .../page+/$slug+/components/ContentWithTranslations.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx b/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx index 63981ed8..bee0943e 100644 --- a/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx +++ b/web/app/routes/$userName+/page+/$slug+/components/ContentWithTranslations.tsx @@ -58,7 +58,6 @@ export function ContentWithTranslations({ return ( <>
-

{sourceTitleWithTranslations && (