diff --git a/src/components/ListOfTipsAndComments.vue b/src/components/ListOfTipsAndComments.vue index 28499b2ae..deb61f3c0 100644 --- a/src/components/ListOfTipsAndComments.vue +++ b/src/components/ListOfTipsAndComments.vue @@ -58,7 +58,7 @@
{{ $t('components.ListOfTipsAndComments.NoActivity') }}
@@ -66,41 +66,24 @@ v-for="(comment, index) in comments" :key="index" :comment="comment" - :sender-link="openExplorer(comment.author)" />
-
-
- {{ $t('components.ListOfTipsAndComments.NoPinnedItems') }} -
- -
-
-
- {{ $t('components.ListOfTipsAndComments.NoPinnedItems') }} -
- +
+ {{ $t('components.ListOfTipsAndComments.NoPinnedItems') }}
+
@@ -110,7 +93,6 @@ import { mapState } from 'vuex'; import Backend from '../utils/backend'; import { EventBus } from '../utils/eventBus'; -import { EXPLORER_URL } from '../config/constants'; import Loading from './Loading.vue'; import TipsPagination from './TipsPagination.vue'; import TipComment from './tipRecords/TipComment.vue'; @@ -131,7 +113,6 @@ export default { }, props: { address: { type: String, required: true } }, data: () => ({ - explorerUrl: `${EXPLORER_URL}account/transactions/`, showLoading: false, error: false, comments: [], @@ -140,7 +121,10 @@ export default { userPinnedItems: [], }), computed: { - ...mapState(['loading', 'pinnedItems', 'account']), + ...mapState(['loading', 'account']), + pinnedItems() { + return this.address === this.account ? this.$store.state.pinnedItems : this.userPinnedItems; + }, showNoResultsMsg() { return this.activeTab === 'comments' && this.comments.length === 0 && !this.showLoading && !this.loading.tips; @@ -168,9 +152,6 @@ export default { setActiveTab(tab) { this.activeTab = tab; }, - openExplorer(address) { - return this.explorerUrl + address; - }, reloadData() { this.showLoading = true; Backend.getUserComments(this.address) diff --git a/src/components/TipInput.vue b/src/components/TipInput.vue index a428e399e..c34f461c9 100644 --- a/src/components/TipInput.vue +++ b/src/components/TipInput.vue @@ -115,7 +115,7 @@ import Loading from './Loading.vue'; import AeButton from './AeButton.vue'; import AeAmountFiat from './AeAmountFiat.vue'; import Modal from './Modal.vue'; -import { i18n } from '../utils/i18nHelper'; +import i18n from '../utils/i18nHelper'; export default { name: 'TipInput', diff --git a/src/components/TipsPagination.vue b/src/components/TipsPagination.vue index a71f5acdf..0b0e85fb1 100644 --- a/src/components/TipsPagination.vue +++ b/src/components/TipsPagination.vue @@ -10,7 +10,6 @@ :key="tip.id" :tip="tip" :fiat-value="tip.fiatValue" - :sender-link="openExplorer(tip.sender)" /> diff --git a/src/components/tipRecords/TipComment.vue b/src/components/tipRecords/TipComment.vue index 552f07dd2..fe886c5e8 100644 --- a/src/components/tipRecords/TipComment.vue +++ b/src/components/tipRecords/TipComment.vue @@ -87,7 +87,6 @@ import { mapState } from 'vuex'; import FormatDate from './FormatDate.vue'; import Avatar from '../Avatar.vue'; -import Backend from '../../utils/backend'; import TipInput from '../TipInput.vue'; export default { @@ -116,10 +115,6 @@ export default { }, }, methods: { - getAvatar(address) { - const userImage = Backend.getProfileImageUrl(address); - return userImage || this.defaultAvatar; - }, goToCommentPage(tipId, id) { this.$router.push({ name: 'comment', diff --git a/src/components/tipRecords/TipRecord.vue b/src/components/tipRecords/TipRecord.vue index a7e6959e0..18597f1b3 100644 --- a/src/components/tipRecords/TipRecord.vue +++ b/src/components/tipRecords/TipRecord.vue @@ -173,8 +173,6 @@ export default { }, props: { tip: { type: Object, required: true }, - foundWallet: { type: Boolean }, - senderLink: { type: String, default: '' }, }, data() { return { diff --git a/src/main.js b/src/main.js index b754cd167..b85d671af 100644 --- a/src/main.js +++ b/src/main.js @@ -6,7 +6,7 @@ import { sync } from 'vuex-router-sync'; import App from './App.vue'; import store from './store'; import router from './router'; -import { i18n } from './utils/i18nHelper'; +import i18n from './utils/i18nHelper'; Vue.use(VueRouter); diff --git a/src/router.js b/src/router.js index 3dcd07d1d..bace6e690 100644 --- a/src/router.js +++ b/src/router.js @@ -173,7 +173,7 @@ const routes = [ }, }, { - path: '/admin/tracing/:id', + path: '/admin/tracing/:tipId', name: 'tracing', props: true, component: Tracing, diff --git a/src/utils/i18nHelper.js b/src/utils/i18nHelper.js index 572aa1329..d5dd021a3 100644 --- a/src/utils/i18nHelper.js +++ b/src/utils/i18nHelper.js @@ -1,6 +1,3 @@ -/* eslint no-param-reassign: ["error", { "ignorePropertyModificationsFor": ["state"] }] */ -/* eslint-disable global-require */ - import Vue from 'vue'; import VueI18n from 'vue-i18n'; import en from '../locales/en.json'; @@ -9,26 +6,9 @@ Vue.use(VueI18n); const fallbackLocale = 'en'; -export const i18n = new VueI18n({ +export default new VueI18n({ locale: fallbackLocale, fallbackLocale, formatFallbackMessages: true, messages: { en }, }); - -export const langs = { - en: { - getMessages: () => require('../locales/en.json'), - }, - zh: { - getMessages: () => require(/* webpackChunkName: "locale-zh" */ '../locales/zh.json'), - }, -}; - -export const fetchAndSetLocale = async (languageCode) => { - if (!i18n.availableLocales.includes(languageCode)) { - const messages = (await langs[languageCode].getMessages()); - i18n.setLocaleMessage(languageCode, messages); - } - i18n.locale = languageCode; -}; diff --git a/src/utils/util.js b/src/utils/util.js index 563c4ce42..5f7be0e45 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -1,7 +1,7 @@ import { get } from 'lodash-es'; import BigNumber from 'bignumber.js'; import { EventBus } from './eventBus'; -import { i18n } from './i18nHelper'; +import i18n from './i18nHelper'; const atomsToAe = (atoms) => (new BigNumber(atoms)).dividedBy(new BigNumber(1000000000000000000)); const aeToAtoms = (ae) => (new BigNumber(ae)).times(new BigNumber(1000000000000000000)); diff --git a/src/views/SingleComment.vue b/src/views/SingleComment.vue index f0114a1fd..292ff6c54 100644 --- a/src/views/SingleComment.vue +++ b/src/views/SingleComment.vue @@ -43,7 +43,6 @@