Skip to content

Commit ecfe06a

Browse files
committed
apply prettier to all modified files
1 parent c53b8a4 commit ecfe06a

File tree

7 files changed

+64
-60
lines changed

7 files changed

+64
-60
lines changed

templates/chain-admin/components/contract/common/SelectAssetItem.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const SelectAssetItem = ({
9595
>
9696
<PopoverTrigger>
9797
<SelectButton
98-
onClick={() => { }}
98+
onClick={() => {}}
9999
placeholder={selectedAssetWithAmount?.asset?.symbol ?? 'Select'}
100100
_css={{ width: isMobile ? '100px' : '140px' }}
101101
/>
@@ -108,8 +108,9 @@ export const SelectAssetItem = ({
108108
py="10px"
109109
bg="$background"
110110
borderRadius="4px"
111-
boxShadow={`0px 4px 20px 0px rgba(${theme === 'light' ? '0,0,0' : '128,128,128'
112-
}, 0.1)`}
111+
boxShadow={`0px 4px 20px 0px rgba(${
112+
theme === 'light' ? '0,0,0' : '128,128,128'
113+
}, 0.1)`}
113114
maxHeight="220px"
114115
overflowY="auto"
115116
>

templates/chain-admin/components/voting/Voting.tsx

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function Voting({ chainName }: VotingProps) {
8686
};
8787
});
8888
break;
89-
} catch (e) { }
89+
} catch (e) {}
9090
}
9191
})();
9292
}
@@ -119,46 +119,46 @@ export function Voting({ chainName }: VotingProps) {
119119
{data.proposals?.length === 0
120120
? empty
121121
: data.proposals?.map((proposal, index) => {
122-
let tally = proposal.finalTallyResult;
123-
if (
124-
proposal.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD
125-
) {
126-
tally = tallies[proposal.id.toString()];
127-
}
128-
return (
129-
<Box
130-
my="$8"
131-
key={proposal.id?.toString() || index}
132-
position="relative"
133-
attributes={{ onClick: () => onClickProposal(index) }}
134-
>
135-
{data.votes[proposal.id.toString()] ? (
136-
<Box
137-
position="absolute"
138-
px="$4"
139-
py="$2"
140-
top="$4"
141-
right="$6"
142-
borderRadius="$md"
143-
backgroundColor="$green400"
144-
>
145-
<Text color="$white" fontSize="$xs" fontWeight="$bold">
146-
Voted
147-
</Text>
148-
</Box>
149-
) : null}
150-
<GovernanceProposalItem
151-
id={`# ${proposal.id?.toString()}`}
152-
key={proposal.submitTime?.getTime()}
153-
// @ts-ignore
154-
title={proposal.content?.title || proposal.title || ''}
155-
status={status(proposal.status)}
156-
votes={votes(tally!)}
157-
endTime={formatDate(proposal.votingEndTime)!}
158-
/>
159-
</Box>
160-
);
161-
})}
122+
let tally = proposal.finalTallyResult;
123+
if (
124+
proposal.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD
125+
) {
126+
tally = tallies[proposal.id.toString()];
127+
}
128+
return (
129+
<Box
130+
my="$8"
131+
key={proposal.id?.toString() || index}
132+
position="relative"
133+
attributes={{ onClick: () => onClickProposal(index) }}
134+
>
135+
{data.votes[proposal.id.toString()] ? (
136+
<Box
137+
position="absolute"
138+
px="$4"
139+
py="$2"
140+
top="$4"
141+
right="$6"
142+
borderRadius="$md"
143+
backgroundColor="$green400"
144+
>
145+
<Text color="$white" fontSize="$xs" fontWeight="$bold">
146+
Voted
147+
</Text>
148+
</Box>
149+
) : null}
150+
<GovernanceProposalItem
151+
id={`# ${proposal.id?.toString()}`}
152+
key={proposal.submitTime?.getTime()}
153+
// @ts-ignore
154+
title={proposal.content?.title || proposal.title || ''}
155+
status={status(proposal.status)}
156+
votes={votes(tally!)}
157+
endTime={formatDate(proposal.votingEndTime)!}
158+
/>
159+
</Box>
160+
);
161+
})}
162162
</Box>
163163
);
164164

templates/chain-admin/hooks/common/useStarshipChains.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ export const useStarshipChains = () => {
3131
const { chains = [] } =
3232
(await fetcher<{ chains: Chain[] }>(`${baseUrl}/chains`)) ?? {};
3333

34-
const chainsWithType = chains.map(chain => ({
34+
const chainsWithType = chains.map((chain) => ({
3535
...chain,
36-
chainType: "cosmos" as const
36+
chainType: 'cosmos' as const,
3737
}));
3838

3939
const assets = (await Promise.all(
40-
chainsWithType.map((chain) =>
41-
// @ts-ignore
42-
fetcher<AssetList>(`${baseUrl}/chains/${chain.chain_id}/assets`) // if use chainId, got error: Cannot read properties of undefined (reading 'chainName') at const { connect, disconnect, address, wallet } = useChain(selectedChain)
40+
chainsWithType.map(
41+
(chain) =>
42+
// @ts-ignore
43+
fetcher<AssetList>(`${baseUrl}/chains/${chain.chain_id}/assets`) // if use chainId, got error: Cannot read properties of undefined (reading 'chainName') at const { connect, disconnect, address, wallet } = useChain(selectedChain)
4344
)
4445
).then((assetLists) => assetLists.filter(Boolean))) as AssetList[];
4546

templates/chain-admin/hooks/contract/useExecuteContractTx.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export const useExecuteContractTx = (chainName: string) => {
3939
fee,
4040
funds,
4141
msg,
42-
onTxFailed = () => { },
43-
onTxSucceed = () => { },
42+
onTxFailed = () => {},
43+
onTxSucceed = () => {},
4444
}: ExecuteTxParams) => {
4545
await handleTx({
4646
txFunction: async () => {
@@ -68,8 +68,8 @@ export const useExecuteContractTx = (chainName: string) => {
6868
contractIndex,
6969
fnName,
7070
arg,
71-
onTxFailed = () => { },
72-
onTxSucceed = () => { },
71+
onTxFailed = () => {},
72+
onTxSucceed = () => {},
7373
}: ExecuteJsdTxParams) => {
7474
const msg = jsd.jsd.MessageComposer.fromPartial.eval({
7575
creator: address,

templates/chain-admin/hooks/contract/useInstantiateTx.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export const useInstantiateTx = (chainName: string) => {
4646

4747
await handleTx<DeliverTxResponse>({
4848
txFunction: async () => {
49-
const instantiateContract = createInstantiateContract(signingClient as any);
49+
const instantiateContract = createInstantiateContract(
50+
signingClient as any
51+
);
5052
const res = await instantiateContract(
5153
address,
5254
{

templates/chain-admin/hooks/contract/useStoreCodeTx.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export const useStoreCodeTx = (chainName: string) => {
3434
wasmFile,
3535
permission,
3636
addresses,
37-
onTxSucceed = () => { },
38-
onTxFailed = () => { },
37+
onTxSucceed = () => {},
38+
onTxFailed = () => {},
3939
}: StoreCodeTxParams) => {
4040
if (!address) return;
4141

templates/hyperweb/ui/utils/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Asset, Chain } from '@chain-registry/types';
2-
import { chains } from 'chain-registry';
1+
import { Asset, Chain } from "@chain-registry/types";
2+
import { chains } from "chain-registry";
33

44
export function getLogo(from: Asset | Chain) {
55
return from.logoURIs?.svg || from.logoURIs?.png;
66
}
77

88
export function getChainLogo(name: string) {
9-
const chain = chains.find(chain => chain.chainName === name)
9+
const chain = chains.find((chain) => chain.chainName === name);
1010
return chain ? getLogo(chain) : null;
11-
}
11+
}

0 commit comments

Comments
 (0)