Skip to content

Commit

Permalink
🔍️ Add nofollow for tx related links
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 2, 2023
1 parent 3554160 commit b73c4b7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
15 changes: 13 additions & 2 deletions src/components/LinkV2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,30 @@ export default class Link extends Vue {
@Prop({ default: false })
readonly isInline!: boolean;
@Prop({ default: false })
readonly ugc!: boolean;
@Prop({ default: false })
readonly nofollow!: boolean;
@Prop({ default: false })
readonly noreferrer!: boolean;
get tag() {
if (this.to) return 'NuxtLink';
return 'a';
}
get attrs() {
if (this.to) return { to: this.to };
if (this.href)
if (this.href) {
const rel = ['noopener'];
return {
href: this.href,
target: '_blank',
rel: 'noopener',
rel: rel.join(' '),
};
}
return {};
}
Expand Down
1 change: 1 addition & 0 deletions src/components/NFTPage/EventList/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
class="text-left"
:href="getChainExplorerTx(event.txHash)"
:is-inline="true"
:nofollow="true"
@click.native.stop
>
<TimeAgo
Expand Down
9 changes: 8 additions & 1 deletion src/components/NFTPage/MetadataSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
content-class="text-medium-gray font-600"
:text="record.label"
/>
<LinkV2 class="text-medium-gray" :href="record.href">
<LinkV2
class="text-medium-gray"
:href="record.href"
:nofollow="!!record.nofollow"
>
<Label class="truncate" preset="p6" :is-raw="true">{{
record.text
}}</Label>
Expand Down Expand Up @@ -91,20 +95,23 @@ export default {
label: this.$t('nft_details_page_section_metadata_ar'),
href: `${ARWEAVE_ENDPOINT}/${text}`,
text,
nofollow: true,
});
break;
case 'ipfs':
records.push({
label: this.$t('nft_details_page_section_metadata_ipfs'),
href: `${IPFS_VIEW_GATEWAY_URL}/${text}`,
text,
nofollow: true,
});
break;
case 'num':
records.push({
label: this.$t('nft_details_page_section_metadata_ipfs'),
href: `${APP_LIKE_CO_URL_BASE}/api/numbers-protocol/assets/${text}`,
text,
nofollow: true,
});
break;
default:
Expand Down
10 changes: 1 addition & 9 deletions src/pages/eula.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@
described herein. The terms also apply to any oice Limited updates,
supplements, Internet-based services, and support services for the
Software, unless other terms accompany those items on delivery. If so,
those terms apply. This EULA was created by
<a
class="text-like-green"
href="https://www.eulatemplate.com/"
target="_blank"
rel="noopener nofollow"
>EULA Template</a
>
for Liker Land.
those terms apply.
</p>
<h2>License Grant</h2>
<p>
Expand Down

0 comments on commit b73c4b7

Please sign in to comment.