+
+ {bids.length > 0 ? (
+ bids
+ .slice(0, 2)
+ .map((bid, index) => (
+
+ ))
+ ) : (
+
+ No bid has been made for this Loogie yet.
+
+ )}
+
+
+ {/* Button to show all bids */}
+
+
+ );
+};
diff --git a/packages/nextjs/components/loogies/auction/AuctionBids.tsx b/packages/nextjs/components/loogies/auction/AuctionBids.tsx
index 2bd19ec..3027669 100644
--- a/packages/nextjs/components/loogies/auction/AuctionBids.tsx
+++ b/packages/nextjs/components/loogies/auction/AuctionBids.tsx
@@ -5,7 +5,7 @@ import { Address } from "~~/components/scaffold-eth";
export const AuctionBids = ({ address, amount }: { address: string; amount: BigNumberish }) => {
console.log(address, amount);
return (
-
+
diff --git a/packages/nextjs/components/loogies/auction/AuctionDetails.tsx b/packages/nextjs/components/loogies/auction/AuctionDetails.tsx
index 859fb08..15007dd 100644
--- a/packages/nextjs/components/loogies/auction/AuctionDetails.tsx
+++ b/packages/nextjs/components/loogies/auction/AuctionDetails.tsx
@@ -1,34 +1,10 @@
import React from "react";
import { Countdown } from "./Countdown";
-import { gql, useQuery } from "@apollo/client";
import { formatEther } from "@ethersproject/units";
-export const AuctionDetails = ({
- name,
- currentBid,
- deadline,
-}: {
- name: string;
- currentBid: number;
- deadline: string;
-}) => {
- const LOOGIE_GRAPHQL = `
- {loogie(id:1){
- id,
- },
- auction(id:1){
- amount
- endTime
- }
-}
-`;
-
- const LOOGIE_GQL = gql(LOOGIE_GRAPHQL);
- console.log(deadline);
- const { data: loogiesData } = useQuery(LOOGIE_GQL, { pollInterval: 1000 });
-
+export const AuctionDetails = ({ name, currentBid, auction }: { name: string; currentBid: number; auction: any }) => {
const formattedEndDate = (endDate: string | number) => {
- if (endDate && loogiesData && loogiesData.auction) {
+ if (endDate) {
const unixTimeInMilliseconds = Number(endDate) * 1000;
const auctionEndDate = new Date(unixTimeInMilliseconds);
return auctionEndDate.toISOString();
@@ -37,7 +13,7 @@ export const AuctionDetails = ({
}
};
- console.log(loogiesData);
+ console.log(auction, "hi");
return (
@@ -51,14 +27,14 @@ export const AuctionDetails = ({
Current Bid
{currentBid !== undefined ? (
-
Ξ {formatEther(currentBid)}
+
Ξ {formatEther(auction.amount)}
) : (
)}
Auction Ends At
- {loogiesData && }
+
diff --git a/packages/nextjs/components/loogies/utils.tsx b/packages/nextjs/components/loogies/utils.tsx
index 6c35b3f..69d3e8a 100644
--- a/packages/nextjs/components/loogies/utils.tsx
+++ b/packages/nextjs/components/loogies/utils.tsx
@@ -7,6 +7,7 @@ export function RenderLoogie({
mouthLength,
width = 400,
height = 400,
+ className,
}: {
id: string;
color: string;
@@ -14,10 +15,11 @@ export function RenderLoogie({
mouthLength: number;
width?: number;
height?: number;
+ className?: string;
}) {
return (