2020-10-24 09:21:41 -07:00
|
|
|
import { computed } from 'vue';
|
2021-03-23 01:30:14 -07:00
|
|
|
import { search } from '@client/scripts/search';
|
|
|
|
import * as os from '@client/os';
|
|
|
|
import { i18n } from '@client/i18n';
|
2020-12-18 17:55:52 -08:00
|
|
|
import { $i } from './account';
|
2021-03-23 01:30:14 -07:00
|
|
|
import { unisonReload } from '@client/scripts/unison-reload';
|
2020-10-17 04:12:00 -07:00
|
|
|
|
|
|
|
export const sidebarDef = {
|
|
|
|
notifications: {
|
|
|
|
title: 'notifications',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-bell',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadNotification),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/notifications',
|
|
|
|
},
|
|
|
|
messaging: {
|
|
|
|
title: 'messaging',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-comments',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadMessagingMessage),
|
2020-11-02 17:43:50 -08:00
|
|
|
to: '/my/messaging',
|
2020-10-17 04:12:00 -07:00
|
|
|
},
|
|
|
|
drive: {
|
|
|
|
title: 'drive',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-cloud',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/drive',
|
|
|
|
},
|
|
|
|
followRequests: {
|
|
|
|
title: 'followRequests',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-user-clock',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null && $i.isLocked),
|
|
|
|
indicated: computed(() => $i != null && $i.hasPendingReceivedFollowRequest),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/follow-requests',
|
|
|
|
},
|
|
|
|
featured: {
|
|
|
|
title: 'featured',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-fire-alt',
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/featured',
|
|
|
|
},
|
|
|
|
explore: {
|
|
|
|
title: 'explore',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-hashtag',
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/explore',
|
|
|
|
},
|
|
|
|
announcements: {
|
|
|
|
title: 'announcements',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-broadcast-tower',
|
2020-12-18 17:55:52 -08:00
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadAnnouncement),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/announcements',
|
|
|
|
},
|
|
|
|
search: {
|
|
|
|
title: 'search',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-search',
|
2020-10-17 04:12:00 -07:00
|
|
|
action: () => search(),
|
|
|
|
},
|
|
|
|
lists: {
|
|
|
|
title: 'lists',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-list-ul',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/lists',
|
|
|
|
},
|
|
|
|
groups: {
|
|
|
|
title: 'groups',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-users',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/groups',
|
|
|
|
},
|
|
|
|
antennas: {
|
|
|
|
title: 'antennas',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-satellite',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/antennas',
|
|
|
|
},
|
|
|
|
mentions: {
|
|
|
|
title: 'mentions',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-at',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadMentions),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/mentions',
|
|
|
|
},
|
|
|
|
messages: {
|
|
|
|
title: 'directNotes',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-envelope',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
indicated: computed(() => $i != null && $i.hasUnreadSpecifiedNotes),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/messages',
|
|
|
|
},
|
|
|
|
favorites: {
|
|
|
|
title: 'favorites',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-star',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/my/favorites',
|
|
|
|
},
|
|
|
|
pages: {
|
|
|
|
title: 'pages',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-file-alt',
|
2020-11-16 21:59:15 -08:00
|
|
|
to: '/pages',
|
2020-10-17 04:12:00 -07:00
|
|
|
},
|
2020-11-14 19:04:54 -08:00
|
|
|
clips: {
|
|
|
|
title: 'clip',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-paperclip',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
2020-11-14 19:04:54 -08:00
|
|
|
to: '/my/clips',
|
|
|
|
},
|
2020-10-17 04:12:00 -07:00
|
|
|
channels: {
|
|
|
|
title: 'channel',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-satellite-dish',
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/channels',
|
|
|
|
},
|
|
|
|
games: {
|
|
|
|
title: 'games',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-gamepad',
|
2020-10-27 02:11:41 -07:00
|
|
|
to: '/games/reversi',
|
2020-10-17 04:12:00 -07:00
|
|
|
},
|
|
|
|
scratchpad: {
|
|
|
|
title: 'scratchpad',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-terminal',
|
2020-10-17 04:12:00 -07:00
|
|
|
to: '/scratchpad',
|
|
|
|
},
|
|
|
|
rooms: {
|
|
|
|
title: 'rooms',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-door-closed',
|
2020-12-18 17:55:52 -08:00
|
|
|
show: computed(() => $i != null),
|
|
|
|
to: computed(() => `/@${$i.username}/room`),
|
2020-10-17 04:12:00 -07:00
|
|
|
},
|
2020-11-03 00:00:47 -08:00
|
|
|
ui: {
|
|
|
|
title: 'switchUi',
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-columns',
|
2020-11-03 00:00:47 -08:00
|
|
|
action: (ev) => {
|
|
|
|
os.modalMenu([{
|
2020-12-25 17:51:00 -08:00
|
|
|
text: i18n.locale.default,
|
2020-11-03 00:00:47 -08:00
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'default');
|
2021-02-17 04:36:56 -08:00
|
|
|
unisonReload();
|
2020-11-03 00:00:47 -08:00
|
|
|
}
|
|
|
|
}, {
|
2020-12-25 17:51:00 -08:00
|
|
|
text: i18n.locale.deck,
|
2020-11-03 00:00:47 -08:00
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'deck');
|
2021-02-17 04:36:56 -08:00
|
|
|
unisonReload();
|
2020-11-03 00:00:47 -08:00
|
|
|
}
|
2021-04-09 20:40:50 -07:00
|
|
|
}, {
|
|
|
|
text: 'pope',
|
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'pope');
|
|
|
|
unisonReload();
|
|
|
|
}
|
2021-02-14 05:26:07 -08:00
|
|
|
}, {
|
|
|
|
text: 'Chat (β)',
|
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'chat');
|
2021-02-17 05:20:35 -08:00
|
|
|
unisonReload();
|
2021-02-14 05:26:07 -08:00
|
|
|
}
|
2020-11-03 00:00:47 -08:00
|
|
|
}, {
|
2020-12-25 17:51:00 -08:00
|
|
|
text: i18n.locale.desktop + ' (β)',
|
2020-11-03 00:00:47 -08:00
|
|
|
action: () => {
|
|
|
|
localStorage.setItem('ui', 'desktop');
|
2021-02-17 04:36:56 -08:00
|
|
|
unisonReload();
|
2020-11-03 00:00:47 -08:00
|
|
|
}
|
|
|
|
}], ev.currentTarget || ev.target);
|
2020-10-17 04:12:00 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|