summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2024-11-02 11:30:56 -0400
committerHazelnoot <acomputerdog@gmail.com>2024-11-20 22:22:30 -0500
commit2b0a62287542597f9f53f45cd932efeb8ec0a12e (patch)
tree482e13ef93f9b414d49294e5c38650133b503f68 /packages/frontend/src/scripts
parentfactor out remote followers warning in SkRemoteFollowersWarning.vue (diff)
downloadsharkey-2b0a62287542597f9f53f45cd932efeb8ec0a12e.tar.gz
sharkey-2b0a62287542597f9f53f45cd932efeb8ec0a12e.tar.bz2
sharkey-2b0a62287542597f9f53f45cd932efeb8ec0a12e.zip
separate following feed's menu component from the actual filter options
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/following-feed-utils.ts72
1 files changed, 35 insertions, 37 deletions
diff --git a/packages/frontend/src/scripts/following-feed-utils.ts b/packages/frontend/src/scripts/following-feed-utils.ts
index 3b4020f84b..39f17949d6 100644
--- a/packages/frontend/src/scripts/following-feed-utils.ts
+++ b/packages/frontend/src/scripts/following-feed-utils.ts
@@ -9,6 +9,7 @@ import { deepMerge } from '@/scripts/merge.js';
import { PageHeaderItem } from '@/types/page-header.js';
import { i18n } from '@/i18n.js';
import { popupMenu } from '@/os.js';
+import { MenuItem } from '@/types/menu.js';
export const followingTab = 'following' as const;
export const mutualsTab = 'mutuals' as const;
@@ -80,43 +81,40 @@ export function createOptionsMenu(storage?: Ref<StorageInterface>): MenuItem[] {
onlyFiles,
} = createModel(storage);
- return {
- icon: 'ti ti-dots',
- text: i18n.ts.options,
- handler: ev =>
- popupMenu([
- {
- type: 'switch',
- text: i18n.ts.showNonPublicNotes,
- ref: withNonPublic,
- disabled: userList.value === 'followers',
- },
- {
- type: 'switch',
- text: i18n.ts.showQuotes,
- ref: withQuotes,
- },
- {
- type: 'switch',
- text: i18n.ts.showBots,
- ref: withBots,
- },
- {
- type: 'switch',
- text: i18n.ts.showReplies,
- ref: withReplies,
- disabled: onlyFiles,
- },
- {
- type: 'divider',
- },
- {
- type: 'switch',
- text: i18n.ts.fileAttachedOnly,
- ref: onlyFiles,
- disabled: withReplies,
- },
- ], ev.currentTarget ?? ev.target),
+ return [
+ {
+ type: 'switch',
+ text: i18n.ts.showNonPublicNotes,
+ ref: withNonPublic,
+ disabled: computed(() => userList.value === followersTab),
+ },
+ {
+ type: 'switch',
+ text: i18n.ts.showQuotes,
+ ref: withQuotes,
+ },
+ {
+ type: 'switch',
+ text: i18n.ts.showBots,
+ ref: withBots,
+ },
+ {
+ type: 'switch',
+ text: i18n.ts.showReplies,
+ ref: withReplies,
+ disabled: onlyFiles,
+ },
+ {
+ type: 'divider',
+ },
+ {
+ type: 'switch',
+ text: i18n.ts.fileAttachedOnly,
+ ref: onlyFiles,
+ disabled: withReplies,
+ },
+ ];
+}
export function createModel(storage?: Ref<StorageInterface>): FollowingFeedModel {
// eslint-disable-next-line no-param-reassign