diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2024-11-02 11:30:56 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2024-11-20 22:22:30 -0500 |
| commit | 2b0a62287542597f9f53f45cd932efeb8ec0a12e (patch) | |
| tree | 482e13ef93f9b414d49294e5c38650133b503f68 /packages/frontend/src/scripts | |
| parent | factor out remote followers warning in SkRemoteFollowersWarning.vue (diff) | |
| download | sharkey-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.ts | 72 |
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 |