fix nft page scroll after modal close

This commit is contained in:
saml33 2023-08-27 22:32:59 +10:00
parent 1fa9a8b836
commit 5970928ee5
2 changed files with 16 additions and 16 deletions

View File

@ -185,7 +185,7 @@ const ListingsView = () => {
const loading = loadingListings || fetchingListings
return (
<div className="flex flex-col">
<div>
<div className="mb-4 mt-2 flex items-center justify-between rounded-md bg-th-bkg-2 p-2 pl-4">
<h3 className="text-sm font-normal text-th-fgd-3">{`Filter Results`}</h3>
<Select
@ -201,13 +201,6 @@ const ListingsView = () => {
</Select.Option>
))}
</Select>
{asssetBidsModal && assetBidsListing ? (
<AssetBidsModal
listing={assetBidsListing}
isOpen={asssetBidsModal}
onClose={closeBidsModal}
></AssetBidsModal>
) : null}
</div>
<div className="grid grid-flow-row auto-rows-max grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-5">
{listingsToShow && listingsToShow.length ? (
@ -285,13 +278,6 @@ const ListingsView = () => {
colorClass="fgd-3"
onClick={() => openBidModal(x)}
/>
{bidNftModal && bidListing && (
<BidNftModal
listing={bidListing}
isOpen={bidNftModal}
onClose={closeBidModal}
></BidNftModal>
)}
</div>
)}
{publicKey && x.sellerAddress.equals(publicKey) && (
@ -340,6 +326,20 @@ const ListingsView = () => {
onPageChange={handlePageClick}
/>
</div> */}
{asssetBidsModal && assetBidsListing ? (
<AssetBidsModal
listing={assetBidsListing}
isOpen={asssetBidsModal}
onClose={closeBidsModal}
/>
) : null}
{bidNftModal && bidListing ? (
<BidNftModal
listing={bidListing}
isOpen={bidNftModal}
onClose={closeBidModal}
/>
) : null}
</div>
)
}

View File

@ -36,7 +36,7 @@ export async function getStaticProps({ locale }: { locale: string }) {
const Market: NextPage = () => {
// const { t } = useTranslation('nft-market')
useMetaplex()
const [activeTab, setActiveTab] = useState('Listings')
const [activeTab, setActiveTab] = useState(LISTINGS)
const [sellNftModal, setSellNftModal] = useState(false)
const [myBidsModal, setMyBidsModal] = useState(false)
const { data: isWhiteListed } = useIsWhiteListed()