feat(mobile): copy inbox email address

This commit is contained in:
Stephen Zhou 2025-04-28 20:53:59 +08:00
parent b1f6f45166
commit 2524defbc2
No known key found for this signature in database
25 changed files with 86 additions and 47 deletions

View File

@ -203,13 +203,17 @@ const generateSubscriptionContextMenu = (navigation: Navigation, id: string) =>
const feed = getFeed(subscription.feedId)
if (!feed) return
setStringAsync(feed.url)
toast.success("Link copied to clipboard")
toast.success(t("operation.copy_which_success", { which: t("operation.copy.link") }))
return
}
}
}}
>
<ContextMenu.ItemTitle>{t("operation.copy_link")}</ContextMenu.ItemTitle>
<ContextMenu.ItemTitle>
{t("operation.copy_which", {
which: t("operation.copy.link"),
})}
</ContextMenu.ItemTitle>
<ContextMenu.ItemIcon
ios={{
name: "link",

View File

@ -0,0 +1,48 @@
import { setStringAsync } from "expo-clipboard"
import type { PropsWithChildren } from "react"
import { useTranslation } from "react-i18next"
import { ContextMenu } from "@/src/components/ui/context-menu"
import { toast } from "@/src/lib/toast"
import { useInbox } from "@/src/store/inbox/hooks"
type InboxContextMenuProps = PropsWithChildren<{
inboxId: string
}>
export const InboxContextMenu = ({ inboxId, children }: InboxContextMenuProps) => {
const { t } = useTranslation()
const inbox = useInbox(inboxId)
if (!inbox) {
return children
}
return (
<ContextMenu.Root>
<ContextMenu.Trigger>{children}</ContextMenu.Trigger>
<ContextMenu.Content>
<ContextMenu.Item
key="CopyEmailAddress"
onSelect={() => {
setStringAsync(`${inbox.id}@follow.re`).then(() => {
toast.success(
t("operation.copy_which_success", { which: t("operation.copy.email_address") }),
)
})
}}
>
<ContextMenu.ItemTitle>
{t("operation.copy_which", { which: t("operation.copy.email_address") })}
</ContextMenu.ItemTitle>
<ContextMenu.ItemIcon
ios={{
name: "mail",
}}
/>
</ContextMenu.Item>
</ContextMenu.Content>
</ContextMenu.Root>
)
}

View File

@ -32,11 +32,11 @@ export const SubscriptionListItemContextMenu: FC<
},
},
{
title: t("operation.copy_link"),
title: t("operation.copy_which", { which: t("operation.copy.link") }),
onSelect: () => {
const list = getList(id)
if (!list) return
toast.success("Link copied to clipboard")
toast.success(t("operation.copy_which_success", { which: t("operation.copy.link") }))
Clipboard.setString(`${env.WEB_URL}/share/lists/${list.id}`)
},
},

View File

@ -208,7 +208,7 @@ const HeaderRightActionsImpl = ({
},
{
key: "CopyLink",
title: t("operation.copy_link"),
title: t("operation.copy_which", { which: t("operation.copy.link") }),
iconIOS: { name: "link" },
onPress: handleCopyLink,
inMenu: true,

View File

@ -15,6 +15,7 @@ import { useSubscription } from "@/src/store/subscription/hooks"
import { getInboxStoreId } from "@/src/store/subscription/utils"
import { useUnreadCount } from "@/src/store/unread/hooks"
import { InboxContextMenu } from "../../context-menu/inbox"
import type { SubscriptionItemBaseProps } from "./types"
import { UnreadCount } from "./UnreadCount"
@ -33,29 +34,31 @@ export const InboxItem = memo(({ id, isFirst, isLast }: SubscriptionItemBaseProp
"rounded-b-[10px]": isLast,
})}
>
<ItemPressable
itemStyle={ItemPressableStyle.Grouped}
className="h-12 flex-row items-center px-3"
onPress={() => {
selectFeed({ type: "inbox", inboxId: id })
navigation.pushControllerView(FeedScreen, {
feedId: id,
})
}}
>
<View className="ml-0.5 overflow-hidden rounded">
<InboxCuteFiIcon
height={20}
width={20}
color={colorScheme === "dark" ? "white" : "black"}
/>
</View>
<InboxContextMenu inboxId={id}>
<ItemPressable
itemStyle={ItemPressableStyle.Grouped}
className="h-12 flex-row items-center px-3"
onPress={() => {
selectFeed({ type: "inbox", inboxId: id })
navigation.pushControllerView(FeedScreen, {
feedId: id,
})
}}
>
<View className="ml-0.5 overflow-hidden rounded">
<InboxCuteFiIcon
height={20}
width={20}
color={colorScheme === "dark" ? "white" : "black"}
/>
</View>
<Text className="text-label font-medium" style={{ marginLeft: GROUPED_ICON_TEXT_GAP }}>
{subscription.title}
</Text>
<UnreadCount unread={unreadCount} className="ml-auto" />
</ItemPressable>
<Text className="text-label font-medium" style={{ marginLeft: GROUPED_ICON_TEXT_GAP }}>
{subscription.title}
</Text>
<UnreadCount unread={unreadCount} className="ml-auto" />
</ItemPressable>
</InboxContextMenu>
</Animated.View>
)
})

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "التغيير إلى عرض آخر",
"operation.copy_link": "نسخ الرابط",
"operation.delete_category": "حذف الفئة",
"operation.edit": "تحرير",
"operation.error_since": "خطأ منذ",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "تغيير إلى عرض آخر",
"operation.copy_link": "نسخ الرابط",
"operation.delete_category": "حذف الفئة",
"operation.edit": "تحرير",
"operation.error_since": "خطأ منذ",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "التبديل إلى طريقة عرض أخرى",
"operation.copy_link": "نسخ الرابط",
"operation.delete_category": "حذف الفئة",
"operation.edit": "تحرير",
"operation.error_since": "خطأ منذ",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "تغيير إلى عرض آخر",
"operation.copy_link": "نسخ الرابط",
"operation.delete_category": "حذف الفئة",
"operation.edit": "تعديل",
"operation.error_since": "خطأ منذ",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "التغيير إلى عرض آخر",
"operation.copy_link": "نسخ الرابط",
"operation.delete_category": "حذف الفئة",
"operation.edit": "تحرير",
"operation.error_since": "خطأ منذ",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "التغيير إلى عرض آخر",
"operation.copy_link": "نسخ الرابط",
"operation.delete_category": "حذف الفئة",
"operation.edit": "تحرير",
"operation.error_since": "خطأ منذ",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "Zu anderer Ansicht wechseln",
"operation.copy_link": "Link kopieren",
"operation.delete_category": "Kategorie löschen",
"operation.edit": "Bearbeiten",
"operation.error_since": "Fehler seit",

View File

@ -23,7 +23,10 @@
"onboarding.welcome_title": "Welcome to Folo!",
"operation.add_feeds_to_category": "Move to Category",
"operation.change_to_other_view": "Switch to Another View",
"operation.copy_link": "Copy Link",
"operation.copy.email_address": "Email Address",
"operation.copy.link": "Link",
"operation.copy_which": "Copy {{which}}",
"operation.copy_which_success": "{{which}} Copied to Clipboard",
"operation.delete_category": "Delete Category",
"operation.edit": "Edit",
"operation.error_since": "Error since",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "Cambiar a otra vista",
"operation.copy_link": "Copiar enlace",
"operation.delete_category": "Eliminar categoría",
"operation.edit": "Editar",
"operation.mark_all_as_read": "Marcar todo como leído",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "Vaihda toiseen näkymään",
"operation.copy_link": "Kopioi linkki",
"operation.delete_category": "Poista kategoria",
"operation.edit": "Muokkaa",
"operation.error_since": "Virhe alkaen",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "Changer pour une autre vue",
"operation.copy_link": "Copier le lien",
"operation.delete_category": "Supprimer la catégorie",
"operation.edit": "Éditer",
"operation.error_since": "Erreur depuis",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "Cambia ad altra visualizzazione",
"operation.copy_link": "Copia link",
"operation.delete_category": "Elimina categoria",
"operation.edit": "Modifica",
"operation.error_since": "Errore da",

View File

@ -23,7 +23,6 @@
"onboarding.welcome_title": "Foloへようこそ",
"operation.add_feeds_to_category": "カテゴリーに移動",
"operation.change_to_other_view": "他のビューに切り替え",
"operation.copy_link": "リンクをコピー",
"operation.delete_category": "カテゴリーを削除",
"operation.edit": "編集",
"operation.error_since": "エラー発生時刻",

View File

@ -1,7 +1,6 @@
{
"operation.add_feeds_to_category": "카테고리로 이동",
"operation.change_to_other_view": "다른 보기로 변경",
"operation.copy_link": "링크 복사",
"operation.delete_category": "카테고리 삭제",
"operation.edit": "편집",
"operation.error_since": "오류 발생:",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "他のビューに切り替え",
"operation.copy_link": "リンクをコピー",
"operation.delete_category": "カテゴリーを削除",
"operation.edit": "編集",
"operation.error_since": "エラー発生時刻",

View File

@ -1,7 +1,6 @@
{
"operation.add_feeds_to_category": "Переместить в категорию",
"operation.change_to_other_view": "Изменить на другой вид",
"operation.copy_link": "Копировать ссылку",
"operation.delete_category": "Удалить категорию",
"operation.edit": "Редактировать",
"operation.error_since": "Ошибка с",

View File

@ -1,6 +1,5 @@
{
"operation.change_to_other_view": "Diğer görünüme geç",
"operation.copy_link": "Bağlantıyı kopyala",
"operation.delete_category": "Kategoriyi sil",
"operation.edit": "Düzenle",
"operation.error_since": "Hata başlangıcı",

View File

@ -23,7 +23,6 @@
"onboarding.welcome_title": "欢迎使用 Folo",
"operation.add_feeds_to_category": "移动至分类",
"operation.change_to_other_view": "更改为其他视图",
"operation.copy_link": "复制链接",
"operation.delete_category": "删除分类",
"operation.edit": "编辑",
"operation.error_since": "源失效:",

View File

@ -23,7 +23,6 @@
"onboarding.welcome_title": "歡迎使用 Folo",
"operation.add_feeds_to_category": "移至分類",
"operation.change_to_other_view": "切換到其他視圖",
"operation.copy_link": "複製連結",
"operation.delete_category": "刪除分類",
"operation.edit": "編輯",
"operation.error_since": "錯誤始於",

View File

@ -23,7 +23,6 @@
"onboarding.welcome_title": "歡迎使用 Folo",
"operation.add_feeds_to_category": "新增 RSS 摘要到類別",
"operation.change_to_other_view": "切換到其他視圖",
"operation.copy_link": "複製連結",
"operation.delete_category": "刪除類別",
"operation.edit": "編輯",
"operation.error_since": "RSS 摘要失效:",