Skip to content

Commit

Permalink
feat: send tx on enter press (#84)
Browse files Browse the repository at this point in the history
* feat: send tx on enter press

* fix: null check endsWith on extension startup

* Update ProposalHeader.tsx
  • Loading branch information
ericHgorski authored Feb 20, 2023
1 parent db1738d commit 9a5e6d6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/components/form/ChainSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ const ChainSelector = ({ chainsList, onChange, value, small }: Props) => {
<button
className={styles.selector}
onClick={(e) => {
e.preventDefault()
e.stopPropagation()
setOpen((o) => !o)
if (e.screenX && e.screenY) setOpen((o) => !o) // negate onClick triggered by enter key press
}}
>
<span>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/gov/ProposalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ProposalHeader = ({
<section className={styles.meta}>
<aside>
{chain && (
<img src={networks[chain].icon} alt={networks[chain].name} />
<img src={networks[chain]?.icon} alt={networks[chain]?.name} />
)}
{id} | {type}
</aside>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/AssetPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AssetPage = () => {
(acc, b) => acc + parseInt(b.amount),
0
)
const price = symbol.endsWith("...") ? 0 : prices?.[token]?.price ?? 0
const price = symbol?.endsWith("...") ? 0 : prices?.[token]?.price ?? 0

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/NetWorth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const NetWorth = () => {
return (
acc +
(parseInt(amount) *
(symbol.endsWith("...") ? 0 : prices?.[token]?.price ?? 0)) /
(symbol?.endsWith("...") ? 0 : prices?.[token]?.price ?? 0)) /
10 ** decimals
)
}, 0)
Expand Down
4 changes: 2 additions & 2 deletions src/txs/AddressBook/AddressBookList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const AddressBookList = ({ onClick }: Props) => {
>
<span>
<img
src={networks[chain].icon}
alt={networks[chain].name}
src={networks[chain]?.icon}
alt={networks[chain]?.name}
/>
{networks[chain].name}
</span>
Expand Down

0 comments on commit 9a5e6d6

Please sign in to comment.