Skip to content

Commit

Permalink
useResetState hook usage
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Sep 7, 2024
1 parent e3a5863 commit 28fb68b
Show file tree
Hide file tree
Showing 82 changed files with 539 additions and 575 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@
"@xylabs/eslint-config-flat": "^4.0.7",
"@xylabs/eslint-config-react-flat": "^4.0.7",
"@xylabs/pixel": "^2.0.4",
"@xylabs/react-button": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-invertible-theme": "^4.2.9",
"@xylabs/react-pixel": "^4.2.9",
"@xylabs/react-shared": "^4.2.9",
"@xylabs/react-button": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-invertible-theme": "^4.2.10",
"@xylabs/react-pixel": "^4.2.10",
"@xylabs/react-shared": "^4.2.10",
"@xylabs/ts-scripts-yarn3": "^4.0.7",
"@xylabs/tsconfig-react": "^4.0.7",
"chromatic": "^11.7.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/modules/packages/archivist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"dependencies": {
"@xylabs/exists": "^4.0.10",
"@xylabs/hex": "^4.0.10",
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-button": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-promise": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/react-button": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-promise": "^4.2.10",
"@xyo-network/archivist-memory": "^3.1.9",
"@xyo-network/archivist-model": "^3.1.9",
"@xyo-network/boundwitness-builder": "^3.1.9",
Expand Down
10 changes: 5 additions & 5 deletions packages/modules/packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
},
"dependencies": {
"@xylabs/eth-address": "^4.0.10",
"@xylabs/react-button": "^4.2.9",
"@xylabs/react-crypto": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-promise": "^4.2.9",
"@xylabs/react-button": "^4.2.10",
"@xylabs/react-crypto": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-promise": "^4.2.10",
"@xyo-network/diviner-model": "^3.1.9",
"@xyo-network/module-model": "^3.1.9",
"@xyo-network/react-shared": "workspace:^"
Expand All @@ -57,7 +57,7 @@
"@mui/material": "^5.16.7",
"@mui/styles": "^5.16.7",
"@storybook/react": "^8.2.9",
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/ts-scripts-yarn3": "^4.0.7",
"@xylabs/tsconfig-react": "^4.0.7",
"@xyo-network/archivist": "^3.1.9",
Expand Down
8 changes: 4 additions & 4 deletions packages/modules/packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
"@xylabs/exists": "^4.0.10",
"@xylabs/logger": "^4.0.10",
"@xylabs/object": "^4.0.10",
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-promise": "^4.2.9",
"@xylabs/react-shared": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-promise": "^4.2.10",
"@xylabs/react-shared": "^4.2.10",
"@xyo-network/module-abstract": "^3.1.9",
"@xyo-network/module-model": "^3.1.9",
"@xyo-network/node-model": "^3.1.9",
Expand Down
4 changes: 2 additions & 2 deletions packages/modules/packages/node/packages/provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
},
"dependencies": {
"@xylabs/forget": "^4.0.10",
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-shared": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/react-shared": "^4.2.10",
"@xyo-network/module-model": "^3.1.9",
"@xyo-network/node-memory": "^3.1.9",
"@xyo-network/node-model": "^3.1.9",
Expand Down
10 changes: 5 additions & 5 deletions packages/modules/packages/sentinal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
},
"dependencies": {
"@xylabs/exists": "^4.0.10",
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-button": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-promise": "^4.2.9",
"@xylabs/react-shared": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/react-button": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-promise": "^4.2.10",
"@xylabs/react-shared": "^4.2.10",
"@xyo-network/account-model": "^3.1.9",
"@xyo-network/archivist-model": "^3.1.9",
"@xyo-network/boundwitness-model": "^3.1.9",
Expand Down
6 changes: 3 additions & 3 deletions packages/modules/packages/witness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
},
"dependencies": {
"@xylabs/exists": "^4.0.10",
"@xylabs/react-button": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-promise": "^4.2.9",
"@xylabs/react-button": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-promise": "^4.2.10",
"@xyo-network/module-model": "^3.1.9",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-module": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/packages/aggregate-price/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
},
"dependencies": {
"@xylabs/decimal-precision": "^4.0.10",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-quick-tip-button": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-quick-tip-button": "^4.2.10",
"@xyo-network/crypto-asset-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-payload-plugin": "workspace:^",
Expand Down
11 changes: 6 additions & 5 deletions packages/plugins/packages/boundwitness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@
"dependencies": {
"@xylabs/arraybuffer": "^4.0.10",
"@xylabs/eth-address": "^4.0.10",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-identicon": "^4.2.9",
"@xylabs/react-promise": "^4.2.9",
"@xylabs/react-quick-tip-button": "^4.2.9",
"@xylabs/react-shared": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-hooks": "^4.2.10",
"@xylabs/react-identicon": "^4.2.10",
"@xylabs/react-promise": "^4.2.10",
"@xylabs/react-quick-tip-button": "^4.2.10",
"@xylabs/react-shared": "^4.2.10",
"@xyo-network/boundwitness-model": "^3.1.9",
"@xyo-network/boundwitness-validator": "^3.1.9",
"@xyo-network/payload-model": "^3.1.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import type { CardProps } from '@mui/material'
import {
Card, Divider, IconButton,
} from '@mui/material'
import { useResetState } from '@xylabs/react-hooks'
import type { BoundWitness } from '@xyo-network/boundwitness-model'
import type { PayloadDetailsRenderProps } from '@xyo-network/react-payload-plugin'
import React, { forwardRef } from 'react'

import { BoundWitnessCardHeader } from '../../Card/index.ts'
import { DetailsCardContent } from './DetailsCardContent.tsx'
import { useResetState } from './useResetState.js'

const BoundWitnessDetailsCardInner = forwardRef<HTMLDivElement, PayloadDetailsRenderProps & CardProps>(

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"dependencies": {
"@xylabs/decimal-precision": "^4.0.10",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-payload-plugin": "workspace:^",
"@xyo-network/react-shared": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/packages/crypto-prices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/coingecko-crypto-market-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-payload-plugin": "workspace:^",
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/packages/elevation-quadkey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-shared": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-shared": "^4.2.10",
"@xyo-network/axios": "^2.91.3",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-map": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/blocknative-ethereum-gas-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-gas-price": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/ethgasstation-ethereum-gas-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-gas-price": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/etherchain-ethereum-gas-v2-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-gas-price": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/ethers-ethereum-gas-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-gas-price": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/etherscan-ethereum-gas-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-gas-price": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-quick-tip-button": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-quick-tip-button": "^4.2.10",
"@xyo-network/gas-price-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-gas-price": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-error": "workspace:^",
"@xyo-network/react-map": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/packages/location-point-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/location-payload-plugin": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-map": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
useMapboxAccessToken,
} from '@xyo-network/react-map'
import type { Feature, Point } from 'geojson'
import React, { useEffect, useState } from 'react'
import React, { useMemo } from 'react'

import { PointMapSettings } from './PointMapSettings.ts'

Expand All @@ -25,24 +25,20 @@ const PointMapInner: React.FC<PointMapInnerProps> = ({
accessToken, payload, ...props
}) => {
const theme = useTheme()
const [feature, setFeature] = useState<Feature<Point>>()
const locationPayload = payload ? (payload as GeographicCoordinateSystemLocationPayload) : undefined
const { accessToken: accessTokenFromContext } = useMapboxAccessToken()
const accessTokenResolved = accessToken ?? accessTokenFromContext

useEffect(() => {
if (locationPayload) {
// convert location payload to geojson to reuse mapbox map render components
setFeature({
const feature = useMemo<Feature<Point> | undefined>(() => locationPayload
? {
geometry: {
coordinates: [locationPayload?.longitude, locationPayload?.latitude],
type: 'Point',
},
properties: {},
type: 'Feature',
})
}
}, [locationPayload])
}
: undefined, [locationPayload])

if (!locationPayload || !locationPayload.latitude || !locationPayload.longitude) {
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/packages/location-points-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-map": "workspace:^",
"@xyo-network/react-payload-plugin": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/packages/nft-score/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/crypto-nft-payload-plugin": "^3.0.17",
"@xyo-network/crypto-nft-score-model": "^3.0.17",
"@xyo-network/payload-model": "^3.1.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/packages/pointer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-payload-details": "workspace:^",
"@xyo-network/react-payload-plugin": "workspace:^"
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/packages/price-forecast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/diviner-forecasting-model": "^3.1.9",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-payload-plugin": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint-pkg": "npmPkgJsonLint ."
},
"dependencies": {
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.10",
"@xyo-network/payload-model": "^3.1.9",
"@xyo-network/react-payload-details": "workspace:^",
"@xyo-network/react-payload-plugin": "workspace:^",
Expand Down
11 changes: 6 additions & 5 deletions packages/sdk/packages/address/packages/history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
},
"dependencies": {
"@xylabs/hex": "^4.0.10",
"@xylabs/react-async-effect": "^4.2.9",
"@xylabs/react-flexbox": "^4.2.9",
"@xylabs/react-promise": "^4.2.9",
"@xylabs/react-quick-tip-button": "^4.2.9",
"@xylabs/react-shared": "^4.2.9",
"@xylabs/react-async-effect": "^4.2.10",
"@xylabs/react-flexbox": "^4.2.10",
"@xylabs/react-hooks": "^4.2.10",
"@xylabs/react-promise": "^4.2.10",
"@xylabs/react-quick-tip-button": "^4.2.10",
"@xylabs/react-shared": "^4.2.10",
"@xyo-network/archivist-model": "^3.1.9",
"@xyo-network/boundwitness-model": "^3.1.9",
"@xyo-network/diviner-address-history-model": "^3.1.9",
Expand Down
Loading

0 comments on commit 28fb68b

Please sign in to comment.