-
Notifications
You must be signed in to change notification settings - Fork 6
Eason/bugfix #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Eason/bugfix #34
Changes from 6 commits
da5ee34
6f16e0b
59b6207
47e6f77
6282a84
3f6e72d
63d8db3
e5e42a0
34f16a8
a29efb7
f7d17a0
e6ff975
ad0fc7b
01ff89f
c53b8a4
ecfe06a
5953ba3
639ca5c
bee56c3
c65aa78
a02c2e8
c548008
2650084
e0843c8
a19dbee
8ec71c6
063d99c
1b2a0dd
5cabe45
4fa5e69
b9c729f
132976e
bc867db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { Dispatch, SetStateAction, useState } from 'react'; | ||
| import { HiOutlineTrash } from 'react-icons/hi'; | ||
| import { Asset } from '@chain-registry/v2-types'; | ||
| import { Asset } from '@chain-registry/types'; | ||
| import { | ||
| Avatar, | ||
| Box, | ||
|
|
@@ -95,7 +95,7 @@ export const SelectAssetItem = ({ | |
| > | ||
| <PopoverTrigger> | ||
| <SelectButton | ||
| onClick={() => {}} | ||
| onClick={() => { }} | ||
| placeholder={selectedAssetWithAmount?.asset?.symbol ?? 'Select'} | ||
| _css={{ width: isMobile ? '100px' : '140px' }} | ||
| /> | ||
|
|
@@ -108,9 +108,8 @@ export const SelectAssetItem = ({ | |
| py="10px" | ||
| bg="$background" | ||
| borderRadius="4px" | ||
| boxShadow={`0px 4px 20px 0px rgba(${ | ||
| theme === 'light' ? '0,0,0' : '128,128,128' | ||
| }, 0.1)`} | ||
| boxShadow={`0px 4px 20px 0px rgba(${theme === 'light' ? '0,0,0' : '128,128,128' | ||
|
||
| }, 0.1)`} | ||
| maxHeight="220px" | ||
| overflowY="auto" | ||
| > | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,7 @@ export function Voting({ chainName }: VotingProps) { | |
| const { modal, open: openModal, close: closeModal, setTitle } = useModal(''); | ||
| const [tallies, setTallies] = useState<{ [key: string]: TallyResult }>({}); | ||
|
|
||
| const chain = chains.find((c) => c.chain_name === chainName); | ||
| const chain = chains.find((c) => c.chainName === chainName); | ||
|
|
||
| useEffect(() => { | ||
| if (!data.proposals || data.proposals.length === 0) return; | ||
|
|
@@ -86,7 +86,7 @@ export function Voting({ chainName }: VotingProps) { | |
| }; | ||
| }); | ||
| break; | ||
| } catch (e) {} | ||
| } catch (e) { } | ||
|
||
| } | ||
| })(); | ||
| } | ||
|
|
@@ -119,46 +119,46 @@ export function Voting({ chainName }: VotingProps) { | |
| {data.proposals?.length === 0 | ||
| ? empty | ||
| : data.proposals?.map((proposal, index) => { | ||
| let tally = proposal.finalTallyResult; | ||
| if ( | ||
| proposal.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD | ||
| ) { | ||
| tally = tallies[proposal.id.toString()]; | ||
| } | ||
| return ( | ||
| <Box | ||
| my="$8" | ||
| key={proposal.id?.toString() || index} | ||
| position="relative" | ||
| attributes={{ onClick: () => onClickProposal(index) }} | ||
| > | ||
| {data.votes[proposal.id.toString()] ? ( | ||
| <Box | ||
| position="absolute" | ||
| px="$4" | ||
| py="$2" | ||
| top="$4" | ||
| right="$6" | ||
| borderRadius="$md" | ||
| backgroundColor="$green400" | ||
| > | ||
| <Text color="$white" fontSize="$xs" fontWeight="$bold"> | ||
| Voted | ||
| </Text> | ||
| </Box> | ||
| ) : null} | ||
| <GovernanceProposalItem | ||
| id={`# ${proposal.id?.toString()}`} | ||
| key={proposal.submitTime?.getTime()} | ||
| // @ts-ignore | ||
| title={proposal.content?.title || proposal.title || ''} | ||
| status={status(proposal.status)} | ||
| votes={votes(tally!)} | ||
| endTime={formatDate(proposal.votingEndTime)!} | ||
| /> | ||
| </Box> | ||
| ); | ||
| })} | ||
| let tally = proposal.finalTallyResult; | ||
|
||
| if ( | ||
| proposal.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD | ||
| ) { | ||
| tally = tallies[proposal.id.toString()]; | ||
| } | ||
| return ( | ||
| <Box | ||
| my="$8" | ||
| key={proposal.id?.toString() || index} | ||
| position="relative" | ||
| attributes={{ onClick: () => onClickProposal(index) }} | ||
| > | ||
| {data.votes[proposal.id.toString()] ? ( | ||
| <Box | ||
| position="absolute" | ||
| px="$4" | ||
| py="$2" | ||
| top="$4" | ||
| right="$6" | ||
| borderRadius="$md" | ||
| backgroundColor="$green400" | ||
| > | ||
| <Text color="$white" fontSize="$xs" fontWeight="$bold"> | ||
| Voted | ||
| </Text> | ||
| </Box> | ||
| ) : null} | ||
| <GovernanceProposalItem | ||
| id={`# ${proposal.id?.toString()}`} | ||
| key={proposal.submitTime?.getTime()} | ||
| // @ts-ignore | ||
| title={proposal.content?.title || proposal.title || ''} | ||
| status={status(proposal.status)} | ||
| votes={votes(tally!)} | ||
| endTime={formatDate(proposal.votingEndTime)!} | ||
| /> | ||
| </Box> | ||
| ); | ||
| })} | ||
| </Box> | ||
| ); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import { AssetList, Chain } from '@chain-registry/types'; | |
| import { | ||
| Chain as ChainV2, | ||
| AssetList as AssetListV2, | ||
| } from '@chain-registry/v2-types'; | ||
| } from '@chain-registry/types'; | ||
|
|
||
| import { StarshipConfig } from '@/starship'; | ||
| import { convertKeysToCamelCase } from '@/utils'; | ||
|
|
@@ -33,7 +33,8 @@ export const useStarshipChains = () => { | |
|
|
||
| const assets = (await Promise.all( | ||
| chains.map((chain) => | ||
| fetcher<AssetList>(`${baseUrl}/chains/${chain.chain_id}/assets`) | ||
| // @ts-ignore | ||
| 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) | ||
|
||
| ) | ||
| ).then((assetLists) => assetLists.filter(Boolean))) as AssetList[]; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix format