Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function NamesContainer(props) {
const pageOffset = (props.page - 1) * 25;
const names = useResource(NameResource.listShape(), { offset: pageOffset });
const { limit, total } = useResultCache(NameResource.listShape(), {
offset: pageOffset
});
const pages = Math.ceil(total / limit);
const nameRows = names.map((name, index) => (
));
// 25 blocks per page
return (
<>
TLD Names
const TransactionList = ({ url, page, from }) => {
//@todo these will come from filtering options.
const limit = 10;
const offset = (page - 1) * limit;
from.limit = limit;
from.offset = offset;
const txs = useResource(TransactionResource.listShape(), from);
const { total } = useResultCache(TransactionResource.listShape(), from);
const pages = Math.ceil(total / limit);
const renderTransactions = txs.map((tx, index) => (
Tx {index + 1}: {tx.hash}
<div>
<div>
</div>
<div>
</div>
</div>
));
function BlocksView({ page }) {
const pageOffset = (page - 1) * 25;
const blocks = useResource(BlockResource.listShape(), { offset: pageOffset });
const { limit, total } = useResultCache(BlockResource.listShape(), {
offset: pageOffset
});
const pages = Math.ceil(total / limit);
return (
<>
HNS Blocks
);
function NameView({ name, page, changePage, url }) {
//Run these in parallel
const nameData = useResource(NameResource.detailShape(), { name });
//@todo move this to NameHistory component, since we want to be able to filter it effectively.
const history = useResource(NameHistoryResource.listShape(), { name });
const { limit, total } = useResultCache(NameHistoryResource.listShape(), {
name
});
const pages = Math.ceil(total / limit);
return (
<>
{name.records && }
);
export default function BlocksContainer(props) {
const pageOffset = (props.page - 1) * 25;
const blocks = useResource(BlockResource.listShape(), { offset: pageOffset });
const { limit, total } = useResultCache(BlockResource.listShape(), {
offset: pageOffset
});
const pages = Math.ceil(total / limit);
return (
);
}