diff --git a/package.json b/package.json index c302c2124..bbec7f231 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "serve": "yarn pre && yarn vue-cli-service serve --port 8081", "build": "yarn pre && yarn vue-cli-service build", "lint": "vue-cli-service lint --no-fix", + "lint:fix": "vue-cli-service lint", "build:bitcoinjs": "yarn --silent browserify bitcoinjs-parts.js -p common-shakeify -s BitcoinJS | yarn terser --compress --mangle --source-map --output public/bitcoin/BitcoinJS.min.js", "build:ci": "yarn pre && build=testnet yarn vue-cli-service build", "i18n:extract": "node ./node_modules/webpack-i18n-tools/index.js ./src/i18n/en.po", diff --git a/src/components/AnnouncementBox.vue b/src/components/AnnouncementBox.vue index 97a806459..032902862 100644 --- a/src/components/AnnouncementBox.vue +++ b/src/components/AnnouncementBox.vue @@ -11,6 +11,7 @@ import { defineComponent, ref } from '@vue/composition-api'; import { ArrowRightSmallIcon } from '@nimiq/vue-components'; import { LocaleMessage } from 'vue-i18n'; +import { RouteName } from '@/router'; import BlueLink from './BlueLink.vue'; import CrossCloseButton from './CrossCloseButton.vue'; @@ -27,7 +28,7 @@ export default defineComponent({ // text = () => context.root.$t('Buy NIM & BTC with OASIS!'); text = () => ''; // Disables AnnouncementBox cta = () => context.root.$t('Try it now'); - action = () => context.root.$router.push('buy'); + action = () => context.root.$router.push({ name: RouteName.Buy }); storageKey = 'buy-with-oasis-1'; const wasDismissed = ref(window.localStorage.getItem(STORAGE_KEY) === storageKey); diff --git a/src/components/MobileActionBar.vue b/src/components/MobileActionBar.vue index 34db4dbe5..1ea89aa60 100644 --- a/src/components/MobileActionBar.vue +++ b/src/components/MobileActionBar.vue @@ -9,7 +9,7 @@ > {{ $t('Send') }} - @@ -19,6 +19,7 @@ import { defineComponent, computed } from '@vue/composition-api'; import { ArrowRightSmallIcon, ScanQrCodeIcon } from '@nimiq/vue-components'; import { useConfig } from '@/composables/useConfig'; +import { RouteName } from '@/router'; import { AddressType, useAddressStore } from '../stores/Address'; import { useAccountStore } from '../stores/Account'; import { CryptoCurrency } from '../lib/Constants'; @@ -58,9 +59,11 @@ export default defineComponent({ && (hasMultipleReceivableAddresses.value || hasBitcoinAddresses.value) ) { // redirect to the address selector - context.root.$router.push('/receive'); + context.root.$router.push({ name: RouteName.Receive }); } else { - context.root.$router.push(nimOrBtcOrStable('/receive/nim', '/receive/btc', '/receive/usdc')); + context.root.$router.push({ + name: nimOrBtcOrStable(RouteName.ReceiveNim, RouteName.ReceiveBtc, RouteName.ReceiveUsdc), + }); } } @@ -73,9 +76,11 @@ export default defineComponent({ && (hasMultipleSendableAddresses.value || hasBitcoinAddresses.value) ) { // redirect to the address selector - context.root.$router.push('/send'); + context.root.$router.push({ name: RouteName.Send }); } else { - context.root.$router.push(nimOrBtcOrStable('/send/nim', '/send/btc', '/send/usdc')); + context.root.$router.push({ + name: nimOrBtcOrStable(RouteName.SendNim, RouteName.SendBtc, RouteName.SendUsdc), + }); } } @@ -98,6 +103,7 @@ export default defineComponent({ receive, send, sendDisabled, + RouteName, }; }, components: { diff --git a/src/components/WalletStatusButton.vue b/src/components/WalletStatusButton.vue index d102dc0c2..8d93ca1fa 100644 --- a/src/components/WalletStatusButton.vue +++ b/src/components/WalletStatusButton.vue @@ -1,5 +1,5 @@