Skip to content

Commit

Permalink
Fix: Connect view on safari mobile & Remove unnecessary validation ch…
Browse files Browse the repository at this point in the history
…eck for autoSelect (#1773)

* working as expected

* Bump versions

* Remove testing css

* Remove testing code from demo
  • Loading branch information
Adamj1232 authored Jun 13, 2023
1 parent bf2600f commit d399e0b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
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.20.1",
"version": "2.20.2-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
1 change: 0 additions & 1 deletion packages/core/src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ const connectOptions = Joi.object({
}),
Joi.string()
)
.required()
})

const disconnectOptions = Joi.object({
Expand Down
14 changes: 12 additions & 2 deletions packages/core/src/views/connect/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
export let autoSelect: ConnectOptions['autoSelect']
const { appMetadata, unstoppableResolution } = configuration
const { appMetadata, unstoppableResolution, device } = configuration
const { icon } = appMetadata || {}
const { walletModules, connect } = state.get()
Expand Down Expand Up @@ -414,6 +414,11 @@
function scrollToTop() {
scrollContainer && scrollContainer.scrollTo(0, 0)
}
const isSafariMobile =
device.type === 'mobile' &&
device.browser.name &&
device.browser.name === 'Safari'
</script>

<style>
Expand Down Expand Up @@ -518,6 +523,11 @@
.scroll-container::-webkit-scrollbar {
display: none; /* Chrome, Safari and Opera */
}
.mobile-safari {
/* Handles for Mobile Safari's floating Address Bar
covering the bottom of the connect modal **/
padding-bottom: 80px;
}
@media all and (min-width: 768px) {
.container {
Expand All @@ -541,7 +551,7 @@

{#if !autoSelect.disableModals}
<Modal close={!connect.disableClose && close}>
<div class="container">
<div class="container" class:mobile-safari={isSafariMobile}>
{#if connect.showSidebar}
<Sidebar step={$modalStep$} />
{/if}
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/views/shared/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
}
.modal-styling {
--border-radius: var(--onboard-modal-border-radius,
--border-radius: var(
--onboard-modal-border-radius,
var(--w3o-border-radius, 1rem)
);
border-radius: var(--border-radius) var(--border-radius) 0 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@web3-onboard/cede-store": "^2.0.2",
"@web3-onboard/coinbase": "^2.2.3",
"@web3-onboard/core": "^2.20.1",
"@web3-onboard/core": "^2.20.2-alpha.1",
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.0.3",
"@web3-onboard/fortmatic": "^2.0.18",
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.8.6",
"version": "2.8.7-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 @@ -63,7 +63,7 @@
},
"dependencies": {
"@web3-onboard/common": "^2.3.3",
"@web3-onboard/core": "^2.20.1",
"@web3-onboard/core": "^2.20.2-alpha.1",
"use-sync-external-store": "1.0.0"
},
"peerDependencies": {
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.7.5",
"version": "2.7.6-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 standardized 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.3.3",
"@web3-onboard/core": "^2.20.1",
"@web3-onboard/core": "^2.20.2-alpha.1",
"vue-demi": "^0.12.4"
},
"peerDependencies": {
Expand Down

0 comments on commit d399e0b

Please sign in to comment.