Skip to content

Commit

Permalink
Hide auction search (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
ba1ciu authored Dec 8, 2023
1 parent 1beb57d commit 1810eec
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 deletions.
13 changes: 6 additions & 7 deletions frontend/marketplace/src/components/TransferCreditsModal.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<script setup lang="ts">
import { ref } from "vue";
import InputWithLabel from "@/components/InputWithLabel.vue";
import { CHAIN_ID, RPC_ENDPOINT } from "@/config/config";
import { getWallet, resolveSdkError } from "@/utils/wallet-utils";
import {
empowerchain,
getSigningTM37EmpowerchainClient,
empowerchain,
getSigningTM37EmpowerchainClient,
} from "@empower-plastic/empowerjs";
import { CHAIN_ID, RPC_ENDPOINT } from "@/config/config";
import { ref } from "vue";
import { toast } from "vue3-toastify";
import { getWallet } from "@/utils/wallet-utils";
import { resolveSdkError } from "@/utils/wallet-utils";
const { transferCredits } =
empowerchain.plasticcredit.MessageComposer.withTypeUrl;
Expand Down Expand Up @@ -56,7 +55,7 @@ const handleTransferCredits = async () => {
const response = await chainClient.signAndBroadcast(
props.address,
[transferCreditsMsg],
fee
fee,
);
if (response && !response.code) {
loading.value = false;
Expand Down
31 changes: 14 additions & 17 deletions frontend/marketplace/src/pages/AuctionPage.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<script setup lang="ts">
import SearchBar from "@/components/SearchBar.vue";
import AuctionResultsCard from "@/components/AuctionResultsCard.vue";
import CustomAlert from "@/components/CustomAlert.vue";
import CustomPagination from "@/components/CustomPagination.vue";
import { onMounted, ref, computed } from "vue";
import CustomSpinner from "@/components/CustomSpinner.vue";
import { useQuery } from "@vue/apollo-composable";
import gql from "graphql-tag";
import { ListingsQueryBuilder } from "@/utils/query-builder";
import { DEFAULT_CREDIT_TYPE } from "@/config/config";
import { useRoute } from "@/router";
import { ListingsQueryBuilder } from "@/utils/query-builder";
import { useQuery } from "@vue/apollo-composable";
import gql from "graphql-tag";
import { computed, onMounted, ref } from "vue";
const router = useRoute();
const pageNumber = ref(1);
Expand All @@ -26,7 +25,7 @@ const handlePageChange = (currentPage: number) => {
pageNumber.value = currentPage;
queryBuilder.addPagination(
itemsPerPage.value,
(pageNumber.value - 1) * itemsPerPage.value
(pageNumber.value - 1) * itemsPerPage.value,
);
let query = queryBuilder.build();
loadQueryData(query);
Expand All @@ -43,7 +42,7 @@ const handleQueryParam = () => {
filter[key] = JSON.parse(queryValue);
} else if (Array.isArray(queryValue)) {
filter[key] = queryValue.map((value) =>
typeof value === "string" ? JSON.parse(value) : null
typeof value === "string" ? JSON.parse(value) : null,
);
} else {
filter[key] = null;
Expand All @@ -56,7 +55,7 @@ const handleQueryParam = () => {
queryBuilder.addCreditTypes([DEFAULT_CREDIT_TYPE]);
queryBuilder.addPagination(
itemsPerPage.value,
(pageNumber.value - 1) * itemsPerPage.value
(pageNumber.value - 1) * itemsPerPage.value,
);
let query = queryBuilder.build();
loadQueryData(query);
Expand All @@ -69,11 +68,9 @@ onMounted(() => {
const loadQueryData = (query: string) => {
showSpinner.value = true;
const { result, loading, error } = useQuery(
gql`
${query}
`
);
const { result, loading, error } = useQuery(gql`
${query}
`);
data.value = { result, loading, error };
showSpinner.value = false;
};
Expand All @@ -96,7 +93,7 @@ const handleSearch = (filterValues: any) => {
) {
queryBuilder.addRegistrationDate(
new Date(filterValues.registrationDate[0]),
new Date(filterValues.registrationDate[1])
new Date(filterValues.registrationDate[1]),
);
}
if (filterValues?.organization?.length > 0) {
Expand All @@ -105,12 +102,12 @@ const handleSearch = (filterValues: any) => {
if (filterValues?.price && (filterValues.price[0] || filterValues.price[1])) {
queryBuilder.addPricePerCredit(
filterValues.price[0],
filterValues.price[1]
filterValues.price[1],
);
}
queryBuilder.addPagination(
itemsPerPage.value,
(pageNumber.value - 1) * itemsPerPage.value
(pageNumber.value - 1) * itemsPerPage.value,
);
queryBuilder.addTextSearch(filterValues.searchTerm);
Expand All @@ -121,7 +118,7 @@ const handleSearch = (filterValues: any) => {
<template>
<div class="p-5 md:px-[10%] min-h-[50vh] font-Inter">
<h1 class="text-title24 md:text-title38 text-white mb-5">Auctions</h1>
<SearchBar @search-click="handleSearch" :filter-values="filterVal" />
<!-- <SearchBar @search-click="handleSearch" :filter-values="filterVal" /> -->
<CustomSpinner :visible="showSpinner" />
<template v-if="!showSpinner">
<CustomAlert
Expand Down
19 changes: 8 additions & 11 deletions frontend/marketplace/src/pages/HomePage.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<script setup lang="ts">
import SearchBar from "@/components/SearchBar.vue";
import AuctionSection from "@/components/AuctionSection.vue";
import HomePageHeroBanner from "@/components/HomePageHeroBanner.vue";
import { DEFAULT_CREDIT_TYPE } from "@/config/config";
import { ListingsQueryBuilder } from "@/utils/query-builder";
import { useQuery } from "@vue/apollo-composable";
import gql from "graphql-tag";
import { onMounted, ref } from "vue";
import { ListingsQueryBuilder } from "@/utils/query-builder";
import { DEFAULT_CREDIT_TYPE } from "@/config/config";
const queryBuilder = new ListingsQueryBuilder();
const data = ref();
Expand All @@ -22,11 +21,9 @@ onMounted(() => {
const loadQueryData = (query: string) => {
showSpinner.value = true;
const { result, loading, error } = useQuery(
gql`
${query}
`
);
const { result, loading, error } = useQuery(gql`
${query}
`);
data.value = { result, loading, error };
showSpinner.value = false;
};
Expand All @@ -49,7 +46,7 @@ const handleSearch = (filterValues: any) => {
) {
queryBuilder.addRegistrationDate(
filterValues.registrationDate[0],
filterValues.registrationDate[1]
filterValues.registrationDate[1],
);
}
if (filterValues.organization.length > 0) {
Expand All @@ -59,7 +56,7 @@ const handleSearch = (filterValues: any) => {
if (filterValues.price && (filterValues.price[0] || filterValues.price[1])) {
queryBuilder.addPricePerCredit(
filterValues.price[0],
filterValues.price[1]
filterValues.price[1],
);
}
queryBuilder.addPagination(5, 0);
Expand All @@ -71,7 +68,7 @@ const handleSearch = (filterValues: any) => {
</script>
<template>
<div class="p-5 md:px-[10%]">
<SearchBar @search-click="handleSearch" />
<!-- <SearchBar @search-click="handleSearch" /> -->
<HomePageHeroBanner />
<CustomSpinner :visible="showSpinner" />
<template v-if="!showSpinner">
Expand Down

0 comments on commit 1810eec

Please sign in to comment.