Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
samsiegart committed Feb 23, 2024
1 parent 12a5ade commit 3bd5c9e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 31 deletions.
6 changes: 3 additions & 3 deletions packages/react-components/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"semi": false,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"endOfLine": "auto"
"printWidth": 80,
"endOfLine": "auto",
"arrowParens": "avoid"
}
10 changes: 6 additions & 4 deletions packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
"build": "tsc && vite build",
"lint": "eslint --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx --fix",
"test": "vitest",
"test:cov": "vitest run --coverage"
"test": "vitest run --passWithNoTests",
"test:cov": "vitest run --coverage",
"prettier": "prettier -c src/*",
"prettier:fix": "prettier -w src/*"
},
"dependencies": {
"@cosmos-kit/core": "2.8.9",
Expand Down Expand Up @@ -70,10 +72,10 @@
"peerDependencies": {
"@cosmos-kit/core": "2.8.9",
"@cosmos-kit/react": "2.10.10",
"@interchain-ui/react": "1.21.18",
"chain-registry": "1.28.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"@interchain-ui/react": "1.21.18"
"react-dom": "18.2.0"
},
"files": [
"dist"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export const ConnectWalletButton = ({ className }: { className?: string }) => {
{agoric.address ? truncate(agoric.address, 8, 7) : 'Connect Wallet'}
</button>
);
};
};
14 changes: 3 additions & 11 deletions packages/react-components/src/lib/components/NodeSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ type Props = {
onClose: () => void;
};

export const NodeSelectorModal = ({
onClose,
isOpen = false,
}: Props) => {
export const NodeSelectorModal = ({ onClose, isOpen = false }: Props) => {
const { networkConfig, setNetworkConfig } = useContext(NetworkContext);
const defaultRest = networkConfig?.apis?.rest?.at(0);
const defaultRpc = networkConfig?.apis?.rpc?.at(0);
Expand All @@ -29,12 +26,7 @@ export const NodeSelectorModal = ({
const [initialRpc] = useState(rpc);

const isNetworkUnchanged =
(
initialRest === rest &&
initialRpc === rpc
) ||
!rpc ||
!rest;
(initialRest === rest && initialRpc === rpc) || !rpc || !rest;

const save = () => {
setNetworkConfig({
Expand Down Expand Up @@ -137,4 +129,4 @@ export const NodeSelectorModal = ({
</Dialog>
</Transition>
);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ const AgoricProviderInner = ({
</AgoricProviderLite>
</ChainProvider>
);
};
};
20 changes: 10 additions & 10 deletions packages/react-components/src/lib/context/AgoricProviderLite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Props = {
*/
export const AgoricProviderLite = ({
children,
onConnectionError = () => { },
onConnectionError = () => {},
chainName = 'agoric',
useCustomEndpoints = true,
}: PropsWithChildren<Props>) => {
Expand Down Expand Up @@ -131,12 +131,12 @@ export const AgoricProviderLite = ({
const watcher = makeAgoricChainStorageWatcher(
apiAddr,
chainName,
onConnectionError
onConnectionError,
);
setChainStorageWatcher(watcher);
};

getWatcher().catch((e) => {
getWatcher().catch(e => {
console.error('error making agoric chain storage watcher', e);
onConnectionError(e);
});
Expand All @@ -153,7 +153,7 @@ export const AgoricProviderLite = ({

assert(
aminoSigner !== undefined,
'Cannot getOfflineSigner, is wallet connected?'
'Cannot getOfflineSigner, is wallet connected?',
);
const signingStargateClient =
await SigningStargateClient.connectWithSigner(
Expand All @@ -170,7 +170,7 @@ export const AgoricProviderLite = ({
...defaultRegistryTypes,
...agoricRegistryTypes,
]),
}
},
);
assert(chain.address, 'Cannot get address, is wallet connected?');
assert(chainStorageWatcher);
Expand All @@ -181,7 +181,7 @@ export const AgoricProviderLite = ({
console.error('wallet connection error', e);
onConnectionError(e);
},
{ address: chain.address, client: signingStargateClient }
{ address: chain.address, client: signingStargateClient },
);
setWalletConnection(agoricWalletConnection);
};
Expand All @@ -191,7 +191,7 @@ export const AgoricProviderLite = ({
chain.address !== undefined &&
chainStorageWatcher !== undefined
) {
getAgoricWalletConnection().catch((e) => {
getAgoricWalletConnection().catch(e => {
onConnectionError(e);
console.error('error making agoric wallet connection', e);
});
Expand All @@ -211,11 +211,11 @@ export const AgoricProviderLite = ({
purses,
offerIdsToPublicSubscribers,
isSmartWalletProvisioned,
makeOffer: walletConnection?.makeOffer ,
provisionSmartWallet: walletConnection?.provisionSmartWallet
makeOffer: walletConnection?.makeOffer,
provisionSmartWallet: walletConnection?.provisionSmartWallet,
};

return (
<AgoricContext.Provider value={state}>{children}</AgoricContext.Provider>
);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export const NetworkProvider = ({
{children}
</NetworkContext.Provider>
);
};
};

0 comments on commit 3bd5c9e

Please sign in to comment.