Skip to content
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

[core-v2.8.4-alpha.1, react-v2.3.4-alpha.1, vue-v2.2.4-alpha.1]: Fix - AC UI balance & rpcUrl whitespace bug #1270

Merged
merged 6 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ assignees:
- taylorjdawson
- aaronbarnardsound
- Adamj1232
- mahmud-bn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

body:
- type: markdown
attributes:
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/FEATURE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ labels: [feature]
assignees:
- taylorjdawson
- aaronbarnardsound
- Adamj1232
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.8.3",
"version": "2.8.4-alpha.1",
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ export function addChains(chains: Chain[]): void {
// chains are validated on init
const action = {
type: ADD_CHAINS,
payload: chains.map(({ namespace = 'evm', id, ...rest }) => ({
payload: chains.map(({ namespace = 'evm', id, rpcUrl, ...rest }) => ({
...rest,
namespace,
id: id.toLowerCase()
id: id.toLowerCase(),
rpcUrl: rpcUrl.trim()
}))
}

Expand Down
8 changes: 5 additions & 3 deletions packages/core/src/views/account-center/Maximized.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import WalletAppBadge from '../shared/WalletAppBadge.svelte'
import { getDefaultChainStyles, unrecognizedChainStyle } from '../../utils.js'
import SuccessStatusIcon from '../shared/SuccessStatusIcon.svelte'
import NetworkBadgeSelector from '../shared/NetworkSelector.svelte'
import NetworkSelector from '../shared/NetworkSelector.svelte'
import caretLightIcon from '../../icons/caret-light.js'
import warningIcon from '../../icons/warning.js'
import questionIcon from '../../icons/question.js'
Expand Down Expand Up @@ -137,6 +137,7 @@

.network-selector-container {
margin-left: 1rem;
width: 100%;
}

.network-selector-label {
Expand Down Expand Up @@ -336,12 +337,13 @@
default: en.accountCenter.currentNetwork
})}
</div>
<div on:click class="flex items-center">
<NetworkBadgeSelector
<div on:click class="flex items-center" style=" width: 100%;">
<NetworkSelector
chains={appChains}
colorVar="--account-center-maximized-network-selector-color"
bold={true}
selectIcon={caretLightIcon}
parentCSSId="maximized_ac"
/>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/views/account-center/Minimized.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@
font-weight: 400;
line-height: var(--onboard-font-line-height-2, var(--font-line-height-2));
color: var(--onboard-gray-400, var(--gray-400));
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 7.25rem;
}

.network {
margin-left: 0.5rem;
margin-left: 0.2rem;
}

.chain-icon {
Expand Down Expand Up @@ -210,6 +214,7 @@
{chains}
colorVar="--account-center-minimized-network-selector-color"
selectIcon={caretIcon}
parentCSSId="minimized_ac"
/>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/views/account-center/WalletRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,15 @@
margin-left: 0.5rem;
color: var(--onboard-gray-300, var(--gray-300));
transition: color 150ms ease-in-out, background-color 150ms ease-in-out;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 7.25rem;
}

.elipsis-container {
padding: 0.25rem;
margin-left: 0.5rem;
margin-left: 0.25rem;
border-radius: 24px;
transition: color 150ms ease-in-out, background-color 150ms ease-in-out;
background-color: transparent;
Expand Down
28 changes: 20 additions & 8 deletions packages/core/src/views/shared/NetworkSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
export let colorVar: string
export let chains: Chain[]
export let bold = false
export let parentCSSId = ''

const switching$ = new BehaviorSubject<boolean>(false)
let selectElement: HTMLSelectElement
Expand Down Expand Up @@ -73,39 +74,50 @@
appearance: none;
font-size: var(--onboard-font-size-7, var(--font-size-7));
line-height: var(--onboard-font-line-height-3, var(--font-line-height-3));
max-width: 90px;
min-width: 72px;
transition: width 250ms ease-in-out;
background-repeat: no-repeat, repeat;
background-position: right 0px top 0px, 0 0;
scrollbar-width: none;
-ms-overflow-style: none;
padding: 0 16px 0 0;
padding: 0 14px 0 0;
white-space: nowrap;
text-overflow: ellipsis;
}

select.minimized_ac {
min-width: 80px;
max-width: 80px;
}

select.maximized_ac {
width: auto !important;
}

select:focus {
outline: none;
}

span {
span.switching-placeholder {
font-size: var(--onboard-font-size-7, var(--font-size-7));
line-height: var(--onboard-font-line-height-3, var(--font-line-height-3));
min-width: 80px;
max-width: 80px;
padding: 0 8px 0 4px;
}
</style>

{#if wallet}
{#if $switching$}
<span
class={`switching-placeholder ${parentCSSId}`}
style={`
color: var(${colorVar},
var(--account-center-network-selector-color, var (--gray-500)));
padding: 0 8px 0 4px;
`}
>switching...</span
`}>switching...</span
>
{:else}
<select
class="flex justify-center items-center pointer"
class={`flex justify-center items-center pointer ${parentCSSId}`}
bind:this={selectElement}
value={wallet.chains[0].id}
on:change={handleSelect}
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@web3-onboard/coinbase": "^2.1.2",
"@web3-onboard/core": "^2.8.2",
"@web3-onboard/core": "^2.8.4-alpha.1",
"@web3-onboard/dcent": "^2.2.0",
"@web3-onboard/fortmatic": "^2.0.13",
"@web3-onboard/gas": "^2.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/react",
"version": "2.3.3",
"version": "2.3.4-alpha.1",
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -62,7 +62,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/core": "^2.8.3",
"@web3-onboard/core": "^2.8.4-alpha.1",
"@web3-onboard/common": "^2.2.2",
"use-sync-external-store": "1.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/vue",
"version": "2.2.3",
"version": "2.2.4-alpha.1",
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -63,7 +63,7 @@
"@vueuse/core": "^8.4.2",
"@vueuse/rxjs": "^8.2.0",
"@web3-onboard/common": "^2.2.2",
"@web3-onboard/core": "^2.8.3",
"@web3-onboard/core": "^2.8.4-alpha.1",
"vue-demi": "^0.12.4"
},
"peerDependencies": {
Expand Down
19 changes: 0 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2953,25 +2953,6 @@
dependencies:
"@walletconnect/window-getters" "^1.0.0"

"@web3-onboard/core@^2.8.2":
version "2.8.2"
resolved "https://registry.yarnpkg.com/@web3-onboard/core/-/core-2.8.2.tgz#70d1730384a3e028bbe07769086361db5c631d78"
integrity sha512-AE2xQVKsmjtvW7lI7xFFdfAtoLxmZRa9qfCv5MtHRDY9Ojqkj06dLgteJmB4FBFZnh79iXoKbIj7N+vRpvjHIw==
dependencies:
"@web3-onboard/common" "^2.2.2"
bignumber.js "^9.0.0"
bnc-sdk "^4.4.1"
bowser "^2.11.0"
ethers "5.5.3"
eventemitter3 "^4.0.7"
joi "17.6.0"
lodash.merge "^4.6.2"
lodash.partition "^4.6.0"
nanoid "^4.0.0"
rxjs "^7.5.2"
svelte "^3.49.0"
svelte-i18n "^3.3.13"

"@web3auth/base-plugin@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-1.0.1.tgz#1e2a87acf745299fdff6f92e6c46ee9bc38aa670"
Expand Down