Skip to content

Commit

Permalink
add update button
Browse files Browse the repository at this point in the history
  • Loading branch information
Takamasa Arakawa committed Feb 4, 2021
1 parent 8aa5718 commit b105ff4
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 46 deletions.
52 changes: 26 additions & 26 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
asset-manifest.json,1612275946479,da64f7cb906437cb7f6310ac1d077a61c137ca2d44996cb92e92e2dc120c490d
index.html,1612275946480,c71bcc5f404e8871a4e389162d7676895eab089bff5d9fb959988249b7ad4a04
favicon.ico,1612275927944,b72f7455f00e4e58792d2bca892abb068e2213838c0316d6b7a0d6d16acd1955
manifest.json,1612275927946,341d52628782f8ac9290bbfc43298afccb47b7cbfcee146ae30cf0f46bc30900
robots.txt,1612275927947,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2
logo192.png,1612275927945,caff018b7f1e8fd481eb1c50d75b0ef236bcd5078b1d15c8bb348453fee30293
logo512.png,1612275927946,191fc21360b4ccfb1cda11a1efb97f489ed22672ca83f4064316802bbfdd750e
Items/hat02.svg,1612275927938,ec6f801224ca242692d65dc8546f8cb2ff5783e724d6a804043e00cfb9a5c66e
Items/hat01.svg,1612275927937,0455a6fbdd3af06de8ea856e602c6620017e22ccbed5f5f05df72b32fddc13a4
Items/hat04.svg,1612275927940,fb5cfffbb92580acc1c1d10eff4a1254822c5cdf2d4906e46e5cea00ed3af732
Items/hat03.svg,1612275927939,e7fe8bb3bb5c7c38e76d0c6a3c9ef35c9ee4b0e735041db59c71dc03b8d07b92
Items/sunglasses01.svg,1612275927941,ef1973b05265c0b08c5845d45ecd8e5b276d6ec4fc5875eb65c478939447e132
Items/sunglasses02.svg,1612275927941,ef72d0587d728565f7a6400fcffd62e1fb71b9f31f5fa0f0767ab36bf173f830
static/js/2.f8f989e4.chunk.js.LICENSE.txt,1612275946489,e8e151dbfecc49f9beea358db00c489a24e708675ab12c6a17d8be9ce282fb2b
static/js/3.b944810f.chunk.js,1612275946490,c318ae13c7df3425b80d9fd90f9ddb2ff0ae7ce33d7f9c377aead4123141a81d
static/js/3.b944810f.chunk.js.map,1612275946489,d939f2f45f12d146849931afdcdc119e08a909bf73ae4f827837f7479dc55655
Items/sunglasses03.svg,1612275927942,76937c1858ded3e3e026118beb683c4b6cc1e78b9cec8c63edd11b98f271d11c
static/js/runtime-main.6012d67e.js,1612275946489,2ccf2274f9b24993830d1f0667a9f209e75b9e275279460c50f721ace3c238c3
Items/sunglasses04.svg,1612275927943,0e3a32cc8344b981950087af9d6ae551cbfae15bfa5160e09308c00f7df390db
static/js/runtime-main.6012d67e.js.map,1612275946489,56e647136fb9940ab48471bb3342ba68f52e636b5a0a0741ef172790aa96ce89
static/js/main.5f751c97.chunk.js,1612275946480,8c09889a37b19160125a34fe1c7df0dda017ed33664bf7fe28b22a7462923b15
static/css/2.1a02f21c.chunk.css,1612275946489,cfad28b796b78540d1ba24f6bb0a47d98519a0bd4c61aa108564c20d2d33b325
static/js/main.5f751c97.chunk.js.map,1612275946489,388fd2ecf0b51f4889431fd2cd1a23264910f6a5ab56098c352171f50a1b58f8
static/css/2.1a02f21c.chunk.css.map,1612275946489,674124252cf3eaf99f750f7877484a54de1f990c7afaaf6dbe5ac75224ae6147
static/js/2.f8f989e4.chunk.js,1612275946490,72e136aceef1705800143d5c4fb836cf6f45d2309d0b8c88ff3d3fb5790ce05d
static/js/2.f8f989e4.chunk.js.map,1612275946491,51153d301a19013a2c475cc97d4b54afd353889d6bc53adb1a142fab5f5fdbe4
asset-manifest.json,1612426104340,130f64ccdcff912e71f459ba0cff94976f4d82c3536a902c31643a6a0f501c90
index.html,1612426104340,2bfb7cfc2b37c9ba625f60281d7ee3491227396f83aef81cdd5a4ea55108ffc4
favicon.ico,1612426084987,b72f7455f00e4e58792d2bca892abb068e2213838c0316d6b7a0d6d16acd1955
manifest.json,1612426084989,341d52628782f8ac9290bbfc43298afccb47b7cbfcee146ae30cf0f46bc30900
robots.txt,1612426084989,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2
logo192.png,1612426084988,caff018b7f1e8fd481eb1c50d75b0ef236bcd5078b1d15c8bb348453fee30293
logo512.png,1612426084988,191fc21360b4ccfb1cda11a1efb97f489ed22672ca83f4064316802bbfdd750e
Items/hat03.svg,1612426084983,e7fe8bb3bb5c7c38e76d0c6a3c9ef35c9ee4b0e735041db59c71dc03b8d07b92
Items/hat01.svg,1612426084981,0455a6fbdd3af06de8ea856e602c6620017e22ccbed5f5f05df72b32fddc13a4
Items/hat04.svg,1612426084984,fb5cfffbb92580acc1c1d10eff4a1254822c5cdf2d4906e46e5cea00ed3af732
Items/sunglasses01.svg,1612426084984,ef1973b05265c0b08c5845d45ecd8e5b276d6ec4fc5875eb65c478939447e132
Items/hat02.svg,1612426084982,ec6f801224ca242692d65dc8546f8cb2ff5783e724d6a804043e00cfb9a5c66e
static/js/2.21247fb6.chunk.js.LICENSE.txt,1612426104353,e8e151dbfecc49f9beea358db00c489a24e708675ab12c6a17d8be9ce282fb2b
Items/sunglasses02.svg,1612426084985,ef72d0587d728565f7a6400fcffd62e1fb71b9f31f5fa0f0767ab36bf173f830
static/js/3.bf4f5dcb.chunk.js,1612426104353,ba477b09b7a370a46f7c753409eddb9dd35d08c3c90260f186cf51384e3522fb
static/js/3.bf4f5dcb.chunk.js.map,1612426104353,4827feb4fe1413a555e3460ffcc599c8ab657a6c8dfce48c9f109b89477079f0
Items/sunglasses04.svg,1612426084986,0e3a32cc8344b981950087af9d6ae551cbfae15bfa5160e09308c00f7df390db
static/js/main.210fec05.chunk.js,1612426104353,0c734ff178bc12b70ffdf8d8cbc30e0ac4e773fc0c0a558ff1d005580253d796
Items/sunglasses03.svg,1612426084986,76937c1858ded3e3e026118beb683c4b6cc1e78b9cec8c63edd11b98f271d11c
static/js/runtime-main.6d4a357c.js,1612426104352,0118fb0d255638d3fce69bc5855b3ba0929f4c2d9a62355b2a81b21c2d711cdd
static/js/runtime-main.6d4a357c.js.map,1612426104353,83792618587605042f6b40d56f945bd9dcd0ce5763fdf416fd667e9cfd8ff20f
static/js/main.210fec05.chunk.js.map,1612426104352,3751b86a1c9fd8025b60d94281615c4c9248c413c11eb73bfd99d9e886445cde
static/css/2.1a02f21c.chunk.css,1612426104352,cfad28b796b78540d1ba24f6bb0a47d98519a0bd4c61aa108564c20d2d33b325
static/css/2.1a02f21c.chunk.css.map,1612426104353,674124252cf3eaf99f750f7877484a54de1f990c7afaaf6dbe5ac75224ae6147
static/js/2.21247fb6.chunk.js,1612426104343,b32d0d6337385dfa4bde20b02e6399e2c8df376b1f36a6255897066cff90c1d1
static/js/2.21247fb6.chunk.js.map,1612426104353,3aa3be86ffc2ccb3649df63cfa4e146a08e42d993267f2d4ef93b7c992e975fb
65 changes: 45 additions & 20 deletions src/parts/market-items-cluster.comp.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {Suspense} from "react"
import {useMarketItems} from "../hooks/use-market-items.hook"
import {useCurrentUser} from "../hooks/use-current-user.hook"
import Item from "./market-item-cluster.comp"
import {Box, Table, Thead, Tbody, Tr, Th, Text, Spinner} from "@chakra-ui/react"
import {STORE_ADDRESS} from "../global/constants"
import {Box, Table, Thead, Tbody, Tr, Th, Text, Spinner, Flex, Alert, Spacer, IconButton} from "@chakra-ui/react"
import {RepeatIcon} from '@chakra-ui/icons'

export function MarketItemsCluster({address}) {
const items = useMarketItems(address)
const [cu] = useCurrentUser()
if (address == null) return null

if (items.items.length <= 0)
Expand All @@ -17,23 +17,48 @@ export function MarketItemsCluster({address}) {
)

return (
<Box borderWidth="1px" borderRadius="lg">
<Table size="sm">
<Thead>
<Tr>
<Th>Item Token Name</Th>
<Th>Id</Th>
<Th isNumeric>Price</Th>
{cu.addr === address ? <Th /> : null}
</Tr>
</Thead>
<Tbody>
{items.items.map(item => (
<Item key={item.key} itemKey={item.key} address={item.collectionAddress} />
))}
</Tbody>
</Table>
</Box>
<div>
{address === STORE_ADDRESS && (
<Flex>
<Alert status="info" colorScheme="gray" solid mb="15px" mr="20px">
It will take up to 1 minute to be updated. Click on the button to refresh.
</Alert>
<Spacer />
<IconButton
icon={<RepeatIcon/>}
colorScheme="blue"
variant="outline"
size="lg"
mb="15px"
aria-label="Update"
onClick={() => items.refresh()}
/>
</Flex>
)}
{items.items.length <= 0 ? (
<Box borderWidth="1px" borderRadius="lg" p="4">
<Text>No Items Listed For Sale</Text>
</Box>
) : (
<Box borderWidth="1px" borderRadius="lg">
<Table size="sm">
<Thead>
<Tr>
<Th>Item Token Name</Th>
<Th>Id</Th>
<Th isNumeric>Price</Th>
<Th />
</Tr>
</Thead>
<Tbody>
{items.items.map(item => (
<Item key={item.key} itemKey={item.key} address={item.collectionAddress} />
))}
</Tbody>
</Table>
</Box>
)}
</div>
)
}

Expand Down

0 comments on commit b105ff4

Please sign in to comment.