Skip to content

Commit c6b0d6b

Browse files
committed
refactor: replace all external links with enumeration object
1 parent dff88ba commit c6b0d6b

File tree

10 files changed

+52
-24
lines changed

10 files changed

+52
-24
lines changed

frontend/components/bc/CookieModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const visible = computed(() => cookiePreference.value === undefined)
3030
class="text-container"
3131
keypath="cookies.text.template"
3232
linkpath="cookies.text.link"
33-
to="https://storage.googleapis.com/legal.beaconcha.in/privacy.pdf"
33+
:to="externalLink.beaconchain.privacyPolicy"
3434
/>
3535
<div class="button-container">
3636
<div

frontend/components/dashboard/slot-viz/DashboardSlotViz.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ watch(
9898
dont-open-permanently
9999
>
100100
<BcLink
101-
to="https://kb.beaconcha.in/v2beta/slot-visualization#how-does-it-work"
101+
:to="externalLink.knowledgeBase.slotVisualization"
102102
target="_blank"
103103
class="link"
104104
>

frontend/components/notifications/NotificationsOverview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const emit = defineEmits<{
7474
<BcTranslation
7575
keypath="notifications.overview.notifications_activate_premium.template"
7676
linkpath="notifications.overview.notifications_activate_premium.link"
77-
to="https://discord.com/developers/docs/resources/webhook"
77+
:to="externalLink.docs.discordWebhook"
7878
>
7979
<template #link>
8080
<BcButtonText

frontend/components/notifications/management/modal/NotificationsManagementModalWebhook.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const id = useId()
145145
<BcTranslation
146146
keypath="notifications.dashboards.dialog.info_send_via_discord.template"
147147
linkpath="notifications.dashboards.dialog.info_send_via_discord.link"
148-
to="https://discord.com/developers/docs/resources/webhook"
148+
:to="externalLink.docs.discordWebhook"
149149
/>
150150
</template>
151151
</BcInputCheckbox>

frontend/components/pricing/PremiumAddonBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ const handleSubmitPurchase = async () => {
259259
v-if="isQuantityLimitReached"
260260
keypath="pricing.addons.contact_support.template"
261261
linkpath="pricing.addons.contact_support.link"
262-
to="https://dsc.gg/beaconchain"
262+
:to="externalLink.beaconchain.discord"
263263
/>
264264
</span>
265265

frontend/layers/base/app/components/TheFooter.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const resourceLinks: Link[] = [
2828
href: '/premium', icon: 'ufo', text: $t('base.footer.resources.links.beaconchain_premium'),
2929
},
3030
{
31-
href: 'https://shop.beaconcha.in/#!/', icon: 'shirt', text: $t('base.footer.resources.links.swag_shop'),
31+
href: externalLink.beaconchain.shop, icon: 'shirt', text: $t('base.footer.resources.links.swag_shop'),
3232
},
3333
{
3434
href: '/products/pricing', icon: 'code', text: $t('base.footer.resources.links.api_pricing'),
@@ -37,7 +37,7 @@ const resourceLinks: Link[] = [
3737
href: '/products/contact-sales', icon: 'mail-up', text: $t('base.footer.resources.links.contact_sales'),
3838
},
3939
{
40-
href: 'https://status.beaconcha.in/', icon: 'circle-check-filled', text: $t('base.footer.resources.links.site_status'),
40+
href: externalLink.beaconchain.status, icon: 'circle-check-filled', text: $t('base.footer.resources.links.site_status'),
4141
},
4242
]
4343
</script>
@@ -145,23 +145,23 @@ const resourceLinks: Link[] = [
145145
<ul class="flex gap-md">
146146
<li>
147147
<BaseButtonIcon
148-
to="https://dsc.gg/beaconchain"
148+
:to="externalLink.beaconchain.discord"
149149
name="brand-discord"
150150
variant="secondary"
151151
screenreader-text="base.footer.links.text_discord"
152152
/>
153153
</li>
154154
<li>
155155
<BaseButtonIcon
156-
to="https://x.com/beaconcha_in"
156+
:to="externalLink.beaconchain.x"
157157
name="brand-x"
158158
variant="secondary"
159159
screenreader-text="base.footer.links.text_x"
160160
/>
161161
</li>
162162
<li>
163163
<BaseButtonIcon
164-
to="https://github.com/gobitfly"
164+
:to="externalLink.beaconchain.github.organization"
165165
name="brand-github"
166166
variant="secondary"
167167
screenreader-text="base.footer.links.text_github"
@@ -179,19 +179,19 @@ const resourceLinks: Link[] = [
179179
<div class="flex flex-col sm:flex-row gap-xl text-xs sm:justify-between">
180180
<div class="flex justify-around sm:order-2 sm:w-1/2">
181181
<NuxtLink
182-
to="https://beaconcha.in/imprint"
182+
:to="externalLink.beaconchain.imprint"
183183
class="hover:text-link-500"
184184
>
185185
{{ $t('base.footer.imprint') }}
186186
</NuxtLink>
187187
<NuxtLink
188-
to="https://storage.googleapis.com/legal.beaconcha.in/tos.pdf"
188+
:to="externalLink.beaconchain.termsOfService"
189189
class="hover:text-link-500"
190190
>
191191
{{ $t('base.footer.terms_of_service') }}
192192
</NuxtLink>
193193
<NuxtLink
194-
to="https://storage.googleapis.com/legal.beaconcha.in/privacy.pdf"
194+
:to="externalLink.beaconchain.privacyPolicy"
195195
class="hover:text-link-500"
196196
>
197197
{{ $t('base.footer.privacy') }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export const externalLink = {
2+
beaconchain: {
3+
apiDocs: 'https://docs.beaconcha.in ',
4+
discord: 'https://dsc.gg/beaconchain',
5+
github: {
6+
beaconchain: 'https://github.com/gobitfly/beaconchain',
7+
mobileApp: 'https://github.com/gobitfly/eth2-beaconchain-explorer-app',
8+
organization: 'https://github.com/gobitfly',
9+
},
10+
imprint: 'https://beaconcha.in/imprint',
11+
privacyPolicy: 'https://storage.googleapis.com/legal.beaconcha.in/privacy.pdf',
12+
shop: 'https://shop.beaconcha.in',
13+
status: 'https://status.beaconcha.in',
14+
store: {
15+
apple: 'https://apps.apple.com/app/beaconchain-dashboard/id1541822121',
16+
google: 'https://play.google.com/store/apps/details?id=in.beaconcha.mobile',
17+
},
18+
termsOfService: 'https://storage.googleapis.com/legal.beaconcha.in/tos.pdf',
19+
x: 'https://x.com/beaconcha_in',
20+
},
21+
docs: {
22+
discordWebhook: 'https://discord.com/developers/docs/resources/webhook',
23+
},
24+
knowledgeBase: {
25+
beaconScore: 'https://kb.beaconcha.in/v2-beaconcha.in-explorer/metric-validator-efficiency',
26+
slotVisualization: 'https://kb.beaconcha.in/v2beta/slot-visualization#how-does-it-work',
27+
},
28+
}

frontend/layers/products/app/components/ProductLandingpageSectionStakinghub.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ onUnmounted(() => {
120120
<template #footer>
121121
<div class="flex gap-2xl justify-center items-start relative z-10">
122122
<NuxtLink
123-
to="https://apps.apple.com/app/beaconchain-dashboard/id1541822121"
123+
:to="externalLink.beaconchain.store.apple"
124124
class="rounded-xs"
125125
target="_blank"
126126
>
@@ -131,7 +131,7 @@ onUnmounted(() => {
131131
>
132132
</NuxtLink>
133133
<NuxtLink
134-
to="https://play.google.com/store/apps/details?id=in.beaconcha.mobile"
134+
:to="externalLink.beaconchain.store.google"
135135
class="rounded-xs"
136136
target="_blank"
137137
>

frontend/layers/products/app/pages/products/api/docs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
definePageMeta({
33
layout: 'base',
44
middleware: () => {
5-
return navigateTo('https://docs.beaconcha.in ', { external: true })
5+
return navigateTo(externalLink.beaconchain.apiDocs, { external: true })
66
},
77
})
88
</script>

frontend/middleware/redirect.global.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ export default function ({
2121
case 'address':
2222
return redirectToV1(`/address/${params.id || params.slug?.[1]}`)
2323
case 'beaconchain-dashboard-mobile-app-on-github':
24-
return redirect('https://github.com/gobitfly/eth2-beaconchain-explorer-app')
24+
return redirect(externalLink.beaconchain.github.mobileApp)
2525
case 'beaconchain-on-discord':
26-
return redirect('https://dsc.gg/beaconchain')
26+
return redirect(externalLink.beaconchain.discord)
2727
case 'beaconchain-on-github':
28-
return redirect('https://github.com/gobitfly/beaconchain')
28+
return redirect(externalLink.beaconchain.github.beaconchain)
2929
case 'beaconchain-on-x':
30-
return redirect('https://x.com/beaconcha_in')
30+
return redirect(externalLink.beaconchain.x)
3131
case 'block':
3232
return redirectToV1(`/block/${params.id || params.slug?.[1]}`)
3333
case 'epoch':
@@ -46,17 +46,17 @@ export default function ({
4646
}
4747
break
4848
case 'privacy':
49-
return redirect('https://storage.googleapis.com/legal.beaconcha.in/privacy.pdf')
49+
return redirect(externalLink.beaconchain.privacyPolicy)
5050
case 'requestReset':
5151
return redirectToV1('/requestReset')
5252
case 'shop':
53-
return redirect('https://shop.beaconcha.in')
53+
return redirect(externalLink.beaconchain.shop)
5454
case 'slot':
5555
return redirectToV1(`/slot/${params.id || params.slug?.[1]}`)
5656
case 'status':
57-
return redirect('https://status.beaconcha.in/')
57+
return redirect(externalLink.beaconchain.status)
5858
case 'terms':
59-
return redirect('https://storage.googleapis.com/legal.beaconcha.in/tos.pdf')
59+
return redirect(externalLink.beaconchain.termsOfService)
6060
case 'tx':
6161
return redirectToV1(`/tx/${params.id || params.slug?.[1]}`)
6262
case 'validator':

0 commit comments

Comments
 (0)