Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Add grants link on donation detail page #135

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface NFT extends Asset {
}

export interface GrantInfo {
id?: string;
active: boolean;
title?: string;
slug?: string;
Expand Down
21 changes: 15 additions & 6 deletions src/components/Donation/GitcoinDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
<h2 class="break-words text-xl font-semibold">
{{ details.title || 'Inactive Project' }}
</h2>
<div
class="text-gitcoin-title text-sm leading-normal cursor-pointer truncate"
@click="toExternalLink(details.reference_url)"
>
<i class="bx bx-link align-middle" />
{{ details.reference_url }}
<div class="inline-flex text-gitcoin-title leading-normal space-x-1">
<p class="text-sm cursor-pointer truncate" @click="toExternalLink(details.reference_url)">
<i class="bx bx-link align-middle" />
{{ details.reference_url }}
</p>
<span v-if="grantsUrl">-</span>
<p class="text-sm cursor-pointer truncate" @click="toExternalLink(grantsUrl)">
<i class="bx bx-link align-middle" />
{{ grantsUrl }}
</p>
</div>
</div>
<div class="w-full">
Expand Down Expand Up @@ -94,6 +98,11 @@ export default class GitcoinDetails extends Vue {
details!: GrantInfo;
donationInfo!: DonationInfo[];

get grantsUrl() {
if (!this.details?.id) return null;
return `https://gitcoin.co/grants/${this.details.id}/${this.details.slug}`;
}

timeDifferent(timeStamp: number) {
const date1: any = new Date(timeStamp * 1000);
const date2: any = Date.now();
Expand Down