Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Allow users list NFT #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@types/react-dom": "^16.9.8",
"@types/react-lazyload": "^3.0.0",
"antd": "^4.6.0",
"aws-sdk": "^2.792.0",
"bn.js": "^5.1.3",
"craco-less": "^1.17.0",
"immutable-tuple": "^0.4.10",
Expand All @@ -33,7 +34,8 @@
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"styled-components": "^5.1.1",
"typescript": "^3.9.7"
"typescript": "^3.9.7",
"uuid": "^8.3.1"
},
"scripts": {
"predeploy": "git pull --ff-only && yarn && yarn build",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function App() {
<MarketProvider>
<WalletProvider>
<PreferencesProvider>
<Suspense fallback={() => <Spin size="large" />}>
<Suspense fallback={<Spin size="large" />}>
<Routes />
</Suspense>
</PreferencesProvider>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Binary file not shown.
Diff not rendered.
Binary file not shown.
Diff not rendered.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
11 changes: 5 additions & 6 deletions src/components/Orderbook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useInterval } from '../utils/useInterval';
import FloatingElement from './layout/FloatingElement';
import usePrevious from '../utils/usePrevious';
import { ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons';
import { USE_ALL_NFTS } from '../nfts';
import { useNFTs } from '../nfts';

const Title = styled.div`
color: rgba(255, 255, 255, 1);
Expand Down Expand Up @@ -56,11 +56,10 @@ export default function Orderbook({ smallScreen, depth = 7, onPrice, onSize }) {
const [orderbookData, setOrderbookData] = useState(null);

let NFT;
if (market) {
NFT = USE_ALL_NFTS.filter(
(nft) => nft.marketAddress.toBase58() === market.address.toBase58(),
)[0];
}
const [NFTs, setFilter] = useNFTs({
marketAddress: market.address.toBase58(),
});
if (market && NFTs.length > 0) NFT = NFTs[0];

useInterval(() => {
if (
Expand Down
10 changes: 5 additions & 5 deletions src/components/StandaloneBalancesDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { settleFunds } from '../utils/send';
import { useSendConnection } from '../utils/connection';
import { notify } from '../utils/notifications';
import { Balances } from '../utils/types';
import USE_NFTS from '../nfts';
import { useNFTs } from '../nfts';
import StandaloneTokenAccountsSelect from './StandaloneTokenAccountSelect';

const RowBox = styled(Row)`
Expand Down Expand Up @@ -55,11 +55,11 @@ export default function StandaloneBalancesDisplay() {
const quoteCurrencyBalances =
balances && balances.find((b) => b.coin === quoteCurrency);

const [NFTs, setFilter] = useNFTs({marketAddress: market?.address.toBase58()});

let NFT: any;
if (market) {
NFT = USE_NFTS.filter(
(nft) => nft.marketAddress.toBase58() === market.address.toBase58(),
)[0];
if (market && NFTs.length > 0) {
NFT = NFTs[0];
}

async function onSettleFunds() {
Expand Down
3 changes: 3 additions & 0 deletions src/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ export default function TopBar() {
Redeemable
<Emoji symbol="🔥" label="burn" class="emoji-redeem-top-bar" />
</Menu.Item>
<Menu.Item key="/list-nft">
List Your NFT
</Menu.Item>
</Menu>

{windowDimensions.width > 1000 && (
Expand Down
9 changes: 3 additions & 6 deletions src/components/TradeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import { useSendConnection } from '../utils/connection';
import FloatingElement from './layout/FloatingElement';
import { placeOrder } from '../utils/send';
import { USE_ALL_NFTS } from '../nfts';
import { useNFTs } from '../nfts';

const SellButton = styled(Button)`
margin: 20px 0px 0px 0px;
Expand Down Expand Up @@ -74,12 +74,9 @@ export default function TradeForm({
const [submitting, setSubmitting] = useState(false);
const [sizeFraction, setSizeFraction] = useState(0);

const [NFTs, setFilter] = useNFTs({marketAddress: market?.address.toBase58()})
let NFT: any;
if (market) {
NFT = USE_ALL_NFTS.filter(
(nft) => nft.marketAddress.toBase58() === market.address.toBase58(),
)[0];
}
if (NFTs.length > 0) NFT = NFTs[0];

const availableQuote =
openOrdersAccount && market
Expand Down
11 changes: 6 additions & 5 deletions src/components/UserInfoTable/BalancesTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useSendConnection } from '../../utils/connection';
import { useWallet } from '../../utils/wallet';
import { settleFunds } from '../../utils/send';
import { notify } from '../../utils/notifications';
import { USE_ALL_NFTS } from '../../nfts';
import { useNFTs } from '../../nfts';

export default function BalancesTable({
balances,
Expand All @@ -22,12 +22,13 @@ export default function BalancesTable({
const connection = useSendConnection();
const { wallet } = useWallet();
const { market } = useMarket();
const [NFTs, setFilter] = useNFTs({
marketAddress: market.address.toBase58(),
});

let NFT;
if (market) {
NFT = USE_ALL_NFTS.filter(
(nft) => nft.marketAddress.toBase58() === market.address.toBase58(),
)[0];
if (market && NFTs.length > 0) {
NFT = NFTs[0];
}

balances.forEach((item, i) => {
Expand Down
Loading