diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 097436d..68957cf 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -16,6 +16,15 @@ jobs: build-service: runs-on: ubuntu-latest + env: + NEXT_PUBLIC_PRODUCTION: ${{ env.NEXT_PUBLIC_PRODUCTION }} + NEXT_PUBLIC_BASE_URL: ${{ env.NEXT_PUBLIC_BASE_URL }} + NEXT_PUBLIC_TESTNET: ${{ env.NEXT_PUBLIC_TESTNET }} + NEXT_PUBLIC_RPC_URL: ${{ env.NEXT_PUBLIC_RPC_URL }} + NEXT_PUBLIC_LOCAL_RPC_URL: ${{ env.NEXT_PUBLIC_LOCAL_RPC_URL }} + NEXT_PUBLIC_CONTRACT_ADDRESS: ${{ secrets.NEXT_PUBLIC_CONTRACT_ADDRESS }} + NEXT_PUBLIC_WETH_ADDRESS: ${{ secrets.NEXT_PUBLIC_WETH_ADDRESS }} + steps: - name: Check Out Repo uses: actions/checkout@v2 diff --git a/context/NFTContext.js b/context/NFTContext.js index b652de6..0b41d46 100644 --- a/context/NFTContext.js +++ b/context/NFTContext.js @@ -53,7 +53,6 @@ export const NFTProvider = ({ children }) => { if (token) { window.localStorage.setItem("userdata", JSON.stringify(response.data)) window.localStorage.setItem("vendor", response.data.vendorId); - window.localStorage.setItem("token", response.data.token); setIsSigned(true); // window.location.href = "/"; } else { diff --git a/pages/nft-details.jsx b/pages/nft-details.jsx index 3fae5ff..ae7b853 100644 --- a/pages/nft-details.jsx +++ b/pages/nft-details.jsx @@ -1,12 +1,10 @@ import { useState, useEffect, useContext } from "react"; -import Image from "next/image"; import { useRouter } from "next/router"; import axios from "axios"; import { NFTContext } from "../context/NFTContext"; import { Loader, Button, Modal } from "../components"; -import images from "../assets"; import { shortenAddress } from "../utils/shortenAddress"; const calculateRentalCost = (nft, rentalPeriodInDays) => { @@ -129,6 +127,7 @@ const NFTDetails = () => { sold: "", tokenId: "", tokenURI: "", + avatar:"" }); const router = useRouter(); const [paymentModal, setPaymentModal] = useState(false); @@ -163,6 +162,26 @@ const NFTDetails = () => { } }, [nft, nft.tokenId, userOf]); + const fetchNftOwnerDetails = async (address) =>{ + try { + const res = await axios.get(`${API_BASE_URL}/api/address/vendorinfo/${address}`); + return res.data; + } catch (error) { + console.error("Error fetching user details:", error); + } + } + + useEffect(() => { + if (nft.owner) { + fetchNftOwnerDetails(nft.owner.toLowerCase()).then((res) => { + console.log(res); + if(res && res.avatarurl){ + setNft({...nft, avatar: res.avatarurl}) + } + }); + } + }, [nft.owner]) + const buyCheckout = async () => { try { console.log(currency); @@ -228,7 +247,7 @@ const NFTDetails = () => {
-
+
{nft.name}
@@ -270,8 +289,8 @@ const NFTDetails = () => {

-
@@ -423,7 +442,7 @@ const NFTDetails = () => { body={
-
+
@@ -470,7 +489,7 @@ const NFTDetails = () => { body={
-
+