From 92a9ffd68650eb01a7ed44ffdad5dc4cbcd9ba1b Mon Sep 17 00:00:00 2001 From: Mary Date: Wed, 27 Dec 2023 07:43:34 +0700 Subject: [PATCH] feat: force translate post --- .../items/posts/PostOverflowAction.tsx | 17 +++++++++++++++++ app/com/components/views/PermalinkPost.tsx | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/com/components/items/posts/PostOverflowAction.tsx b/app/com/components/items/posts/PostOverflowAction.tsx index f43b05a5..92be1958 100644 --- a/app/com/components/items/posts/PostOverflowAction.tsx +++ b/app/com/components/items/posts/PostOverflowAction.tsx @@ -13,6 +13,7 @@ import { isProfileTempMuted, useSharedPreferences } from '../../SharedPreference import DeleteIcon from '../../../icons/baseline-delete.tsx'; import LaunchIcon from '../../../icons/baseline-launch.tsx'; import ReportIcon from '../../../icons/baseline-report.tsx'; +import TranslateIcon from '../../../icons/baseline-translate.tsx'; import VolumeOffIcon from '../../../icons/baseline-volume-off.tsx'; const DeletePostConfirmDialog = lazy(() => import('../../dialogs/DeletePostConfirmDialog.tsx')); @@ -21,12 +22,15 @@ const ReportDialog = lazy(() => import('../../dialogs/ReportDialog.tsx')); export interface PostOverflowActionProps { post: SignalizedPost; + onTranslate?: () => void; children: JSX.Element; } const PostOverflowAction = (props: PostOverflowActionProps) => { const { filters } = useSharedPreferences(); + const onTranslate = props.onTranslate; + return (() => { const post = props.post; const author = post.author; @@ -51,6 +55,19 @@ const PostOverflowAction = (props: PostOverflowActionProps) => { Open in Bluesky app + {onTranslate && ( + + )} + {isSameAuthor && (