diff --git a/src/boot/routes.js b/src/boot/routes.js
index 05513794..9dba532a 100644
--- a/src/boot/routes.js
+++ b/src/boot/routes.js
@@ -16,6 +16,7 @@ import Notifications from 'components/notifications/notifications.vue'
import UserPanel from 'components/user_panel/user_panel.vue'
import LoginForm from 'components/login_form/login_form.vue'
import ChatPanel from 'components/chat_panel/chat_panel.vue'
+import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
import About from 'components/about/about.vue'
export default (store) => {
@@ -47,6 +48,7 @@ export default (store) => {
{ name: 'chat', path: '/chat', component: ChatPanel, props: () => ({ floating: false }) },
{ name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
{ name: 'user-search', path: '/user-search', component: UserSearch, props: (route) => ({ query: route.query.query }) },
+ { name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow },
{ name: 'about', path: '/about', component: About },
{ name: 'user-profile', path: '/(users/)?:name', component: UserProfile }
]
diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js
index 538b919d..754a57e0 100644
--- a/src/components/side_drawer/side_drawer.js
+++ b/src/components/side_drawer/side_drawer.js
@@ -23,6 +23,9 @@ const SideDrawer = {
},
unseenNotificationsCount () {
return this.unseenNotifications.length
+ },
+ suggestionsEnabled () {
+ return this.$store.state.instance.suggestionsEnabled
}
},
methods: {
diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue
index 7c792deb..386fff6a 100644
--- a/src/components/side_drawer/side_drawer.vue
+++ b/src/components/side_drawer/side_drawer.vue
@@ -62,12 +62,17 @@
-
-
+
{{ $t("nav.user_search") }}
+ -
+
+ {{ $t("nav.who_to_follow") }}
+
+
-
-
+
{{ $t("settings.settings") }}
diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js
new file mode 100644
index 00000000..82098fc2
--- /dev/null
+++ b/src/components/who_to_follow/who_to_follow.js
@@ -0,0 +1,48 @@
+import apiService from '../../services/api/api.service.js'
+import UserCard from '../user_card/user_card.vue'
+
+const WhoToFollow = {
+ components: {
+ UserCard
+ },
+ data () {
+ return {
+ users: []
+ }
+ },
+ mounted () {
+ this.getWhoToFollow()
+ },
+ methods: {
+ showWhoToFollow (reply) {
+ reply.forEach((i, index) => {
+ const user = {
+ id: 0,
+ name: i.display_name,
+ screen_name: i.acct,
+ profile_image_url: i.avatar || '/images/avi.png'
+ }
+ this.users.push(user)
+
+ this.$store.state.api.backendInteractor.externalProfile(user.screen_name)
+ .then((externalUser) => {
+ if (!externalUser.error) {
+ this.$store.commit('addNewUsers', [externalUser])
+ user.id = externalUser.id
+ }
+ })
+ })
+ },
+ getWhoToFollow () {
+ const credentials = this.$store.state.users.currentUser.credentials
+ if (credentials) {
+ apiService.suggestions({credentials: credentials})
+ .then((reply) => {
+ this.showWhoToFollow(reply)
+ })
+ }
+ }
+ }
+}
+
+export default WhoToFollow
diff --git a/src/components/who_to_follow/who_to_follow.vue b/src/components/who_to_follow/who_to_follow.vue
new file mode 100644
index 00000000..df2e03c8
--- /dev/null
+++ b/src/components/who_to_follow/who_to_follow.vue
@@ -0,0 +1,15 @@
+
+
+
+ {{$t('who_to_follow.who_to_follow')}}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js
index fddc7c7d..5e204001 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.js
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.js
@@ -50,14 +50,6 @@ const WhoToFollowPanel = {
user: function () {
return this.$store.state.users.currentUser.screen_name
},
- moreUrl: function () {
- const host = window.location.hostname
- const user = this.user
- const suggestionsWeb = this.$store.state.instance.suggestionsWeb
- const url = suggestionsWeb.replace(/{{host}}/g, encodeURIComponent(host))
- .replace(/{{user}}/g, encodeURIComponent(user))
- return url
- },
suggestionsEnabled () {
return this.$store.state.instance.suggestionsEnabled
}
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue
index 272c41d3..25e3a9f6 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.vue
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue
@@ -13,7 +13,7 @@
{{user.name}}
- {{$t('who_to_follow.more')}}
+ {{$t('who_to_follow.more')}}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 8a6d1310..1dd3462b 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -39,6 +39,7 @@
"timeline": "Timeline",
"twkn": "The Whole Known Network",
"user_search": "User Search",
+ "who_to_follow": "Who to follow",
"preferences": "Preferences"
},
"notifications": {