Skip to content

Commit

Permalink
Certificate page redone (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-astrand authored Nov 28, 2023
1 parent 4d7b2ff commit 8602421
Show file tree
Hide file tree
Showing 25 changed files with 5,709 additions and 499 deletions.
409 changes: 210 additions & 199 deletions frontend/marketplace/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/marketplace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"graphql": "^16.8.1",
"graphql-tag": "^2.12.6",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.7.1",
"pinia": "^2.1.7",
"rollbar": "^2.26.2",
"vue": "^3.3.2",
Expand Down
Binary file added frontend/marketplace/src/assets/circular.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/circular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions frontend/marketplace/src/assets/circular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions frontend/marketplace/src/assets/greenlogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/leaf1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
546 changes: 546 additions & 0 deletions frontend/marketplace/src/assets/leaf10.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
380 changes: 380 additions & 0 deletions frontend/marketplace/src/assets/leaf11.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,038 changes: 2,038 additions & 0 deletions frontend/marketplace/src/assets/leaf12.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
464 changes: 464 additions & 0 deletions frontend/marketplace/src/assets/leaf13.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/leaf2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/leaf3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/leaf4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/leaf5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/leaf6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 133 additions & 0 deletions frontend/marketplace/src/assets/leaf9.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/wastePick.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/marketplace/src/assets/wastePick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 17 additions & 5 deletions frontend/marketplace/src/components/CertificateCard.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
<script setup lang="ts">
import { toast } from "vue3-toastify";
import { defineEmits } from 'vue';
export interface CreditCardProps {
cardData: any;
}
defineProps<CreditCardProps>();
const showInfoToast = () => {
toast.info("Coming soon!");
// Define the expected properties from the parent component
const props = defineProps<CreditCardProps>();
// Define the events that this component can emit
const emit = defineEmits(['viewCertificate']);
// Function to emit the 'viewCertificate' event
const viewCertificate = () => {
if (props.cardData?.id) {
emit('viewCertificate', props.cardData.id);
} else {
toast.error('Certificate ID not found');
}
};
</script>
<template>
Expand Down Expand Up @@ -34,7 +46,7 @@ const showInfoToast = () => {
{{ cardData?.denom }}
</p>
<div>
<button class="btn certificate-button" @click="showInfoToast">
<button class="btn certificate-button" @click="viewCertificate">
View certificate
</button>
</div>
Expand All @@ -59,7 +71,7 @@ const showInfoToast = () => {
</div>

<div class="grid grid-col-1 gap-6 p-5">
<button class="btn certificate-button" @click="showInfoToast">
<button class="btn certificate-button" @click="viewCertificate">
View certificate
</button>
</div>
Expand Down
13 changes: 12 additions & 1 deletion frontend/marketplace/src/components/CertificateTabContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@ import CertificateCard from "@/components/CertificateCard.vue";
import { CHAIN_ID } from "@/config/config";
import { toast } from "vue3-toastify";
import { useQuery } from "@vue/apollo-composable";
import CustomSpinner from "@/components/CustomSpinner.vue";
import gql from "graphql-tag";
import CustomAlert from "@/components/CustomAlert.vue";
import { walletConnected, getWallet } from "@/utils/wallet-utils";
import { useRouter } from 'vue-router';
const pageNumber = ref(1);
const itemsPerPage = ref(5);
const searchTerm = ref("");
const data = ref();
const showSpinner = ref(true);
const router = useRouter();
const viewCertificate = (certificateId: string) => {
const url = `${window.location.origin}/certificate/${certificateId}`;
window.open(url, '_blank');
};
const handlePageChange = () => {
getCertificatesData();
Expand Down Expand Up @@ -46,6 +56,7 @@ const getCertificatesData = async () => {
nodes {
amount
denom
id
}
}
}
Expand Down Expand Up @@ -92,7 +103,7 @@ onMounted(() => {
v-for="certificate in data?.result?.creditOffsetCertificates?.nodes"
:key="certificate.id"
>
<CertificateCard :card-data="certificate" />
<CertificateCard :card-data="certificate" @viewCertificate="viewCertificate" />
</div>
<div class="flex justify-center md:justify-end my-10">
<CustomPagination
Expand Down
Loading

0 comments on commit 8602421

Please sign in to comment.