Skip to content

Commit

Permalink
Minor bug fixes (#37)
Browse files Browse the repository at this point in the history
* Add NFT page poll interval

* Minor bug fixes (#36)

* Migrate to react-query

* Fix nft page crash on reload

* Fix nft page price flickering

* Fix rebid

* Fix start sale/auction redudant approval

* Fix mint button display on large collections with user mint limit

* Refactor minted nfts count query

* Fix total nft count update on mint

* Fix list offset duplicates
  • Loading branch information
nikitayutanov authored Apr 2, 2024
1 parent 88b9c1e commit 261cf2b
Show file tree
Hide file tree
Showing 30 changed files with 291 additions and 309 deletions.
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"codegen": "graphql-codegen"
},
"dependencies": {
"@apollo/client": "3.9.6",
"@gear-js/api": "0.36.3",
"@gear-js/react-hooks": "0.10.3",
"@gear-js/vara-ui": "0.0.7",
"@hookform/resolvers": "3.3.3",
"@polkadot/api": "10.11.2",
"@polkadot/react-identicon": "3.6.4",
"graphql-ws": "5.15.0",
"@tanstack/react-query": "5.28.9",
"graphql-request": "6.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.49.2",
Expand Down
168 changes: 24 additions & 144 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/src/components/hocs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { withAccount } from './with-account';
import { withApi } from './with-api';
import { withMarketplaceConfig } from './with-marketplace-config';

export { withAccount, withApi };
export { withAccount, withApi, withMarketplaceConfig };
3 changes: 3 additions & 0 deletions frontend/src/components/hocs/with-marketplace-config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { withMarketplaceConfig } from './with-marketplace-config';

export { withMarketplaceConfig };
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { FunctionComponent } from 'react';

import { useMarketplace } from '@/context';

// alongside with withApi, probably would be better to check loading inside of components where hook is used
// and render loading status directly there
function withMarketplaceConfig<T>(Component: FunctionComponent<T>) {
return function WithApi(props: T & JSX.IntrinsicAttributes) {
const { marketplace } = useMarketplace();

return marketplace ? <Component {...props} /> : null;
};
}

export { withMarketplaceConfig };
3 changes: 2 additions & 1 deletion frontend/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CopyButton, FilterButton, LinkButton } from './buttons';
import { Form, Input, Checkbox, Radio, Select, Textarea } from './form';
import { withAccount, withApi } from './hocs';
import { withAccount, withApi, withMarketplaceConfig } from './hocs';
import { InfoCard, InfoCardProps } from './info-card';
import { PriceInput, SearchInput } from './inputs';
import {
Expand Down Expand Up @@ -51,6 +51,7 @@ export {
TruncatedText,
Identicon,
Balance,
withMarketplaceConfig,
};

export type { InfoCardProps };
4 changes: 2 additions & 2 deletions frontend/src/components/price-info-card/price-info-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import VaraSVG from '@/assets/vara.svg?react';
import { InfoCard, InfoCardProps } from '../info-card';

function PriceInfoCard({ text, ...props }: Omit<InfoCardProps, 'SVG'>) {
const { api } = useApi();
const { isApiReady, api } = useApi();
const [unit] = api?.registry.chainTokens || ['Unit'];

return <InfoCard SVG={VaraSVG} text={`${text} ${unit}`} {...props} />;
return <InfoCard SVG={VaraSVG} text={isApiReady ? `${text} ${unit}` : undefined} {...props} />;
}

export { PriceInfoCard };
Loading

0 comments on commit 261cf2b

Please sign in to comment.