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

Commit

Permalink
Merge pull request #135 from AmagiDDmxh/feature/links
Browse files Browse the repository at this point in the history
Add grants link on donation detail page
resolve #128
  • Loading branch information
Candinya committed Dec 1, 2021
2 parents 66affbd + 71ae899 commit d51fc92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
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

0 comments on commit d51fc92

Please sign in to comment.