Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit df369c3

Browse files
committed
Addresses with-heart's comments
Add typechain's generated types to git. Rename to isLoading.
1 parent 05b8886 commit df369c3

File tree

8 files changed

+1745
-11
lines changed

8 files changed

+1745
-11
lines changed

frontend/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,3 @@ yarn-debug.log*
2323
yarn-error.log*
2424

2525
.next
26-
27-
/types/ethers-contracts

frontend/_tests_/hooks/useDevNFTSupply.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ test('should return correct supply values & transition loading state', async ()
2121

2222
const { result, waitForValueToChange } = renderHook(() => useDevNFTSupply());
2323

24-
expect(result.current.loading).toBe(true);
25-
await waitForValueToChange(() => result.current.loading);
26-
expect(result.current.loading).toBe(false);
24+
expect(result.current.isLoading).toBe(true);
25+
await waitForValueToChange(() => result.current.isLoading);
26+
expect(result.current.isLoading).toBe(false);
2727

2828
expect(result.current.maxSupply).toBe(8000);
2929
expect(result.current.totalSupply).toBe(2345);
@@ -46,9 +46,9 @@ test('should correctly handle "all minted" state', async () => {
4646

4747
const { result, waitForValueToChange } = renderHook(() => useDevNFTSupply());
4848

49-
expect(result.current.loading).toBe(true);
50-
await waitForValueToChange(() => result.current.loading);
51-
expect(result.current.loading).toBe(false);
49+
expect(result.current.isLoading).toBe(true);
50+
await waitForValueToChange(() => result.current.isLoading);
51+
expect(result.current.isLoading).toBe(false);
5252

5353
expect(result.current.maxSupply).toBe(8000);
5454
expect(result.current.totalSupply).toBe(8000);

frontend/src/components/DirectMint/DirectMintBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import useDevNFTSupply from '../../hooks/useDevNFTSupply';
1818
// used on the minting page
1919
const DirectMintBox = () => {
2020
const { t } = useTranslation();
21-
const { loading, remainingPublicSupply } = useDevNFTSupply();
21+
const { isLoading, remainingPublicSupply } = useDevNFTSupply();
2222
return (
2323
<>
2424
<Container maxW="container.md" centerContent>
@@ -41,7 +41,7 @@ const DirectMintBox = () => {
4141
</Text>
4242
<Text fontSize={{ base: 'xs', sm: 'xl' }}>
4343
{t('remainingTokensText', {
44-
remainingTokens: loading ? '...' : remainingPublicSupply,
44+
remainingTokens: isLoading ? '...' : remainingPublicSupply,
4545
})}
4646
</Text>
4747
<DirectMint />

frontend/src/hooks/useDevNFTSupply.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function useDevNFTSupply() {
6767
}, []);
6868

6969
return {
70-
loading: totalSupply === -1 || lockedSupply === -1,
70+
isLoading: totalSupply === -1 || lockedSupply === -1,
7171
// This is the amount of total minted DEV NFTs, same as calling `totalSupply()` on the contract
7272
totalSupply,
7373
// This is the amount of minted DEV NFTs that only the contract owner can mint (TokenIDs 7778-8000, incl.)

0 commit comments

Comments
 (0)