Skip to content

Commit

Permalink
Change help url to link specific docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lserra-iov authored and alexjavabraz committed Nov 8, 2023
1 parent 81ccd09 commit e44530d
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions src/common/components/layouts/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
<a href="https://www.iovlabs.org/" target="_blank">
About IOV Labs
</a>
<a href="https://dev.rootstock.io/guides/two-way-peg-app/" target="_blank">Help</a>
<a :href="helpUrl" target="_blank">Help</a>
<a href="https://open-rsk-dev.slack.com/messages/support" target="_blank">Support</a>
<a href="https://rootstock.io/terms-conditions/" target="_blank">
Terms & Conditions
</a>
<a :href="`https://github.com/rsksmart/2wp-app/releases/tag/v${apiVersion}`" target="_blank">Api Version: {{apiVersion}}</a>
<a :href="`https://github.com/rsksmart/2wp-api/releases/tag/v${apiVersion}`" target="_blank">Api Version: {{apiVersion}}</a>
<a :href="`https://github.com/rsksmart/2wp-app/releases/tag/v${appVersion}`" target="_blank">App Version: {{appVersion}}</a>
</v-row>
</v-col>
Expand Down Expand Up @@ -56,25 +56,51 @@ import { useStore } from 'vuex';
import { mdiTwitter, mdiSlack, mdiGithub } from '@mdi/js';
import { ApiInformation } from '@/common/types/ApiInformation';
import { ApiService } from '@/common/services';
import { useRoute } from 'vue-router';
import { useGetter } from '@/common/store/helper';
import * as constants from '@/common/store/constants';
export default {
name: 'FooterRsk',
setup() {
const apiVersion = ref('0');
const store = useStore();
const appVersion = computed<string>(() => store.getters.appVersion);
const route = useRoute();
const isLedger = useGetter<boolean>('web3Session', constants.SESSION_IS_LEDGER_CONNECTED);
const isTrezor = useGetter<boolean>('web3Session', constants.SESSION_IS_TREZOR_CONNECTED);
const isMetamask = useGetter<boolean>('web3Session', constants.SESSION_IS_METAMASK_CONNECTED);
const isRloginDefined = useGetter<boolean>('web3Session', constants.SESSION_IS_RLOGIN_DEFINED);
const url = computed(() => `https://github.com/rsksmart/2wp-app/releases/tag/v${appVersion.value}`);
const urlApi = computed(() => `https://github.com/rsksmart/2wp-api/releases/tag/v${apiVersion.value}`);
function getDevPortalSlug() {
const [, feature, wallet] = route.path.split('/');
if (feature === 'pegin' && wallet) {
return `${feature}/${wallet}`;
}
if (feature === 'pegout' && isRloginDefined.value) {
if (isLedger.value) {
return `${feature}/ledger`;
}
if (isTrezor.value) {
return `${feature}/trezor`;
}
if (isMetamask.value) {
return `${feature}/metamask`;
}
return `${feature}/liquality`;
}
return feature;
}
const helpUrl = computed(() => `https://dev.rootstock.io/guides/two-way-peg-app/${getDevPortalSlug()}`);
ApiService.getApiInformation()
.then((res: ApiInformation) => {
apiVersion.value = res.version;
});
return {
urlApi,
url,
helpUrl,
appVersion,
apiVersion,
mdiTwitter,
Expand Down

0 comments on commit e44530d

Please sign in to comment.