From 5dff9df704b0651a1170a46658e9fdc1ef4866a5 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 17 Jul 2023 17:10:25 -0700 Subject: [PATCH] feat: :sparkles: copy feeds from user menu --- locales/en-US.yml | 4 +++ packages/client/src/scripts/get-user-menu.ts | 28 ++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/locales/en-US.yml b/locales/en-US.yml index 252092adf..003eb5131 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -2104,3 +2104,7 @@ _skinTones: medium: "Medium" mediumDark: "Medium Dark" dark: "Dark" +_feeds: + rss: "RSS" + atom: "Atom" + jsonFeed: "JSON Feed" diff --git a/packages/client/src/scripts/get-user-menu.ts b/packages/client/src/scripts/get-user-menu.ts index 26d6aab30..a0edda957 100644 --- a/packages/client/src/scripts/get-user-menu.ts +++ b/packages/client/src/scripts/get-user-menu.ts @@ -245,6 +245,34 @@ export function getUserMenu(user, router: Router = mainRouter) { router.push(`/user-info/${user.id}`); }, }, + { + icon: "ph-newspaper ph-bold ph-lg", + text: i18n.ts.copyFeed, + type: "parent", + children: [ + { + icon: "ph-rss ph-bold ph-lg", + text: i18n.ts._feeds.rss, + action: () => { + copyToClipboard(`https://${host}/@${user.username}.rss`); + }, + }, + { + icon: "ph-atom ph-bold ph-lg", + text: i18n.ts._feeds.atom, + action: () => { + copyToClipboard(`https://${host}/@${user.username}.atom`); + }, + }, + { + icon: "ph-brackets-curly ph-bold ph-lg", + text: i18n.ts._feeds.jsonFeed, + action: () => { + copyToClipboard(`https://${host}/@${user.username}.json`); + }, + }, + ], + }, { icon: "ph-envelope-simple-open ph-bold ph-lg", text: i18n.ts.sendMessage,