Skip to content

Commit

Permalink
fix: fullfilListing
Browse files Browse the repository at this point in the history
  • Loading branch information
MartianGreed committed Sep 4, 2024
1 parent f63a5a5 commit 2829a5d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const AcceptOffer: React.FC<AcceptOfferProps> = ({
}) => {
const { account } = useAccount();
const { fulfillOffer, status } = useFulfillOffer();
const { fulfill: fulfillAuction, status: statusAuction } =
useFulfillAuction();
const { fulfill: fulfillAuction, status: statusAuction } = useFulfillAuction();

const handleClick = async () => {
if (tokenMarketData.is_listed && tokenMarketData.listing.is_auction) {
Expand All @@ -36,6 +35,7 @@ const AcceptOffer: React.FC<AcceptOfferProps> = ({
orderHash: tokenMarketData.listing.order_hash,
relatedOrderHash: offer.hash,
startAmount: offer.price,
currencyAddress: env.NEXT_PUBLIC_LORDS_TOKEN_ADDRESS,
});
} else {
await fulfillOffer({
Expand All @@ -44,6 +44,7 @@ const AcceptOffer: React.FC<AcceptOfferProps> = ({
tokenAddress: token.collection_address,
tokenId: token.token_id,
orderHash: offer.hash,
currencyAddress: env.NEXT_PUBLIC_LORDS_TOKEN_ADDRESS,
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,20 @@ import ToastRejectedTransactionContent from "./toast-rejected-transaction-conten
import TokenActionsTokenOverview from "./token-actions-token-overview";
import LordsInput from "~/components/lords-input";
import { useTokenBalance } from "~/hooks/useTokenBalance";
import Image from "next/image";

interface TokenActionsMakeOfferProps {
token: Token;
small?: boolean;
}

const backgroundImageStyle = {
backgroundImage: `url(/pink_crown.gif)`,
backgroundPosition: "top",
backgroundRepeat: "repeat-y",
backgroundOpacity: 0.1,
};

function TokenActionsMakeOffer({ token, small }: TokenActionsMakeOfferProps) {
const [isOpen, setIsOpen] = useState(false);
const { account } = useAccount();
Expand Down Expand Up @@ -182,7 +190,15 @@ function TokenActionsMakeOffer({ token, small }: TokenActionsMakeOfferProps) {
>
<DialogHeader className="items-center"></DialogHeader>
<div className="flex flex-col gap-6">
<div className="mx-auto size-20 rounded-full bg-secondary" />
<div style={backgroundImageStyle} className="mx-auto mb-3 mt-3 size-20 rounded-full bg-secondary">
<Image
alt="profile image"
width={16}
height={16}
src="/pink_crown.gif"
className="size-20 rounded-full"
/>
</div>
<div className="text-center text-xl font-semibold">Make an offer</div>
<TokenActionsTokenOverview token={token} amount={startAmount} small />
<Form {...form}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function TokenActions({

const isOwner = areAddressesEqual(address, data?.owner);


if (!data || (!data.has_offer && !data.is_listed)) {
return <TokenActionsEmpty token={token} isOwner={isOwner} />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function TokenActionsBuyNow({
tokenId: token.token_id,
orderHash: tokenMarketData.listing.order_hash,
startAmount: tokenMarketData.listing.start_amount,
currencyAddress: tokenMarketData.listing.currency_address,
currencyAddress: env.NEXT_PUBLIC_LORDS_TOKEN_ADDRESS,
});
};

Expand Down
18 changes: 17 additions & 1 deletion apps/arkmarket/src/components/connect-wallet-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import { Separator } from "@ark-market/ui/separator";

import { useConnectWalletStore } from "~/app/stores/connect-wallet";
import Image from "next/image";

const walletIdToName = new Map([
["argentX", "Argent X"],
Expand All @@ -23,6 +24,13 @@ const walletIdToName = new Map([
["argentMobile", "Argent mobile"],
]);

const backgroundImageStyle = {
backgroundImage: `url(/pink_crown.gif)`,
backgroundPosition: "top",
backgroundRepeat: "repeat-y",
backgroundOpacity: 0.1,
};

export default function ConnectWalletDialog() {
const { isOpen, setIsOpen } = useConnectWalletStore();
const { connectors, connectAsync } = useConnect();
Expand Down Expand Up @@ -61,7 +69,15 @@ export default function ConnectWalletDialog() {
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogContent className="my-auto sm:max-w-[26.25rem]">
<DialogHeader>
<div className="mx-auto mb-3 mt-3 size-20 rounded-full bg-secondary" />
<div style={backgroundImageStyle} className="mx-auto mb-3 mt-3 size-20 rounded-full bg-secondary">
<Image
alt="profile image"
width={16}
height={16}
src="/pink_crown.gif"
className="size-20 rounded-full"
/>
</div>
<DialogTitle className="mx-auto text-xl font-semibold">
Connect to Realms.World Market
</DialogTitle>
Expand Down

0 comments on commit 2829a5d

Please sign in to comment.