diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index f22a76917f..ce9b0dcd6b 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -498,6 +498,9 @@ removeAllFollowing: "フォローを全解除"
removeAllFollowingDescription: "{host}からのフォローをすべて解除します。そのインスタンスがもう存在しなくなった場合などに実行してください。"
userSuspended: "このユーザーは凍結されています。"
userSilenced: "このユーザーはサイレンスされています。"
+sidebar: "サイドバー"
+divider: "分割線"
+addItem: "項目を追加"
_theme:
explore: "テーマを探す"
diff --git a/src/client/app.ts b/src/client/app.ts
new file mode 100644
index 0000000000..6a03526e3e
--- /dev/null
+++ b/src/client/app.ts
@@ -0,0 +1,109 @@
+import { faTerminal, faHashtag, faBroadcastTower, faFireAlt, faSearch, faStar, faAt, faListUl, faUserClock, faUsers, faCloud, faGamepad, faFileAlt, faSatellite } from '@fortawesome/free-solid-svg-icons';
+import { faBell, faEnvelope, faComments } from '@fortawesome/free-regular-svg-icons';
+
+export function createMenuDef(actions) {
+ return {
+ notifications: {
+ title: 'notifications',
+ icon: faBell,
+ show: store => store.getters.isSignedIn,
+ indicate: store => store.getters.isSignedIn && store.state.i.hasUnreadNotification,
+ to: '/my/notifications',
+ },
+ messaging: {
+ title: 'messaging',
+ icon: faComments,
+ show: store => store.getters.isSignedIn,
+ indicate: store => store.getters.isSignedIn && store.state.i.hasUnreadMessagingMessage,
+ to: '/my/messaging',
+ },
+ drive: {
+ title: 'drive',
+ icon: faCloud,
+ show: store => store.getters.isSignedIn,
+ to: '/my/drive',
+ },
+ followRequests: {
+ title: 'followRequests',
+ icon: faUserClock,
+ show: store => store.getters.isSignedIn && store.state.i.isLocked,
+ indicate: store => store.getters.isSignedIn && store.state.i.hasPendingReceivedFollowRequest,
+ to: '/my/follow-requests',
+ },
+ featured: {
+ title: 'featured',
+ icon: faFireAlt,
+ to: '/featured',
+ },
+ explore: {
+ title: 'explore',
+ icon: faHashtag,
+ to: '/explore',
+ },
+ announcements: {
+ title: 'announcements',
+ icon: faBroadcastTower,
+ indicate: store => store.getters.isSignedIn && store.state.i.hasUnreadAnnouncement,
+ to: '/announcements',
+ },
+ search: {
+ title: 'search',
+ icon: faSearch,
+ action: () => actions.search(),
+ },
+ lists: {
+ title: 'lists',
+ icon: faListUl,
+ show: store => store.getters.isSignedIn,
+ to: '/my/lists',
+ },
+ groups: {
+ title: 'groups',
+ icon: faUsers,
+ show: store => store.getters.isSignedIn,
+ to: '/my/groups',
+ },
+ antennas: {
+ title: 'antennas',
+ icon: faSatellite,
+ show: store => store.getters.isSignedIn,
+ to: '/my/antennas',
+ },
+ mentions: {
+ title: 'mentions',
+ icon: faAt,
+ show: store => store.getters.isSignedIn,
+ indicate: store => store.getters.isSignedIn && store.state.i.hasUnreadMentions,
+ to: '/my/mentions',
+ },
+ messages: {
+ title: 'directNotes',
+ icon: faEnvelope,
+ show: store => store.getters.isSignedIn,
+ indicate: store => store.getters.isSignedIn && store.state.i.hasUnreadSpecifiedNotes,
+ to: '/my/messages',
+ },
+ favorites: {
+ title: 'favorites',
+ icon: faStar,
+ show: store => store.getters.isSignedIn,
+ to: '/my/favorites',
+ },
+ pages: {
+ title: 'pages',
+ icon: faFileAlt,
+ show: store => store.getters.isSignedIn,
+ to: '/my/pages',
+ },
+ games: {
+ title: 'games',
+ icon: faGamepad,
+ to: '/games',
+ },
+ scratchpad: {
+ title: 'scratchpad',
+ icon: faTerminal,
+ to: '/scratchpad',
+ },
+ };
+}
diff --git a/src/client/app.vue b/src/client/app.vue
index 4bc5710212..96f1d3ad26 100644
--- a/src/client/app.vue
+++ b/src/client/app.vue
@@ -49,44 +49,20 @@
{{ $store.getters.isSignedIn ? $t('timeline') : $t('home') }}
-
-
- {{ $t('notifications') }}
-
-
-
- {{ $t('messaging') }}
-
-
-
- {{ $t('drive') }}
-
-
- {{ $t('followRequests') }}
-
-
+
+
+ { if (menuDef[item].action) menuDef[item].action() }" :to="menuDef[item].to">
+ {{ $t(menuDef[item].title) }}
+
+
-
- {{ $t('featured') }}
-
-
- {{ $t('explore') }}
-
-
- {{ $t('announcements') }}
-
-
-
-
{{ $t('settings') }}
@@ -141,10 +117,10 @@
-
+
-
+
@@ -156,13 +132,14 @@
+
+
diff --git a/src/client/store.ts b/src/client/store.ts
index 3635e21f1c..c60661d45b 100644
--- a/src/client/store.ts
+++ b/src/client/store.ts
@@ -16,16 +16,27 @@ export const defaultSettings = {
reactions: ['👍', '❤️', '😆', '🤔', '😮', '🎉', '💢', '😥', '😇', '🍮'],
};
-const defaultDeviceUserSettings = {
+export const defaultDeviceUserSettings = {
visibility: 'public',
localOnly: false,
widgets: [],
tl: {
src: 'home'
},
+ menu: [
+ 'notifications',
+ 'messaging',
+ 'drive',
+ '-',
+ 'followRequests',
+ 'featured',
+ 'explore',
+ 'announcements',
+ 'search',
+ ],
};
-const defaultDeviceSettings = {
+export const defaultDeviceSettings = {
lang: null,
loadRawImages: false,
alwaysShowNsfw: false,
@@ -237,6 +248,10 @@ export default () => new Vuex.Store({
};
},
+ setMenu(state, menu) {
+ state.menu = menu;
+ },
+
setVisibility(state, visibility) {
state.visibility = visibility;
},
diff --git a/webpack.config.ts b/webpack.config.ts
index 4d7e4a4ef0..64cf4c8581 100644
--- a/webpack.config.ts
+++ b/webpack.config.ts
@@ -146,13 +146,7 @@ module.exports = {
resolveLoader: {
modules: ['node_modules']
},
- cache: {
- type: 'filesystem',
-
- buildDependencies: {
- config: [__filename]
- }
- },
+ cache: false,
devtool: false, //'source-map',
mode: isProduction ? 'production' : 'development'
};