Skip to content

Commit

Permalink
version 0.9.1 (#315)
Browse files Browse the repository at this point in the history
* Fix iframe error (#310)

* Check for headless mode bfore removing notifications

* Add reason property to documentation

* Fix config validation for minimumBalance (#312)

* Enhancement/supported browsers (#314)

* add more supported browsers

* opera and brave logos

* opera touch

* add images with correct sizing so not pixelated on retina display

* updated to version 0.9.1
  • Loading branch information
cmeisl authored Jun 24, 2019
1 parent 797acaa commit aac9654
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 17 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ yarn add bnc-assist
#### Script Tag

The library uses [semantic versioning](https://semver.org/spec/v2.0.0.html).
The current version is 0.9.0.
The current version is 0.9.1.
There are minified and non-minified versions.
Put this script at the top of your `<head>`

```html
<script src="https://assist.blocknative.com/0-9-0/assist.js"></script>
<script src="https://assist.blocknative.com/0-9-1/assist.js"></script>

<!-- OR... -->

<script src="https://assist.blocknative.com/0-9-0/assist.min.js"></script>
<script src="https://assist.blocknative.com/0-9-1/assist.min.js"></script>
```

### Initialize the Library
Expand Down Expand Up @@ -261,6 +261,7 @@ The function that is defined on the `handleNotificationEvent` property of the co
parameters: Array, // the parameters the method was called with
},
inlineCustomMsgs: Object | Boolean, // the inline custom messages passed to the transaction
reason: String, // reason for error type notifications
transaction: {
id: String, // internal unique id for the transaction
from: String, // the address the transaction was sent from
Expand Down
Binary file added lib/images/brave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/images/opera-touch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/images/opera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bnc-assist",
"version": "0.9.0",
"version": "0.9.1",
"description": "Blocknative Assist js library for Dapp developers",
"main": "lib/assist.min.js",
"scripts": {
Expand Down

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,10 @@ input[type='button'].bn-btn-block {
color: #fff;
}

.btn-row {
margin-bottom: 6px;
}

/* GENERAL */

.flex-row {
Expand Down
2 changes: 1 addition & 1 deletion src/js/helpers/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function handleEvent(eventObj, clickHandlers) {
? handleNotificationEvent(eventObj)
: true

if (!showNotification) {
if (!showNotification && !headlessMode) {
removeUnwantedNotifications(eventCode, transaction.id)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/helpers/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function validateConfig(config) {
web3: ow.optional.object,
ethers: ow.optional.object,
mobileBlocked: ow.optional.boolean,
minimumBalance: ow.optional.number,
minimumBalance: ow.optional.string,
headlessMode: ow.optional.boolean,
messages: ow.optional.object.exactShape({
txRequest: ow.optional.function,
Expand Down
4 changes: 3 additions & 1 deletion src/js/logic/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ function getWeb3Wallet(categoryCode) {
}, timeouts.changeUI),
onClick: () => {
if (state.mobileDevice) {
window.location = `https://links.trustwalletapp.com/a/key_live_lfvIpVeI9TFWxPCqwU8rZnogFqhnzs4D?&event=openURL&url=${window.location.href}`
window.location = `https://links.trustwalletapp.com/a/key_live_lfvIpVeI9TFWxPCqwU8rZnogFqhnzs4D?&event=openURL&url=${
window.location.href
}`
} else {
window.location.reload()
}
Expand Down
27 changes: 25 additions & 2 deletions src/js/views/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ import trustLogo2x from '../../../lib/images/[email protected]'
import coinbaseLogo from '../../../lib/images/coinbase.png'
import coinbaseLogo2x from '../../../lib/images/[email protected]'

import braveLogo from '../../../lib/images/brave.png'
import braveLogo2x from '../../../lib/images/[email protected]'

import operaLogo from '../../../lib/images/opera.png'
import operaLogo2x from '../../../lib/images/[email protected]'

import operaTouchLogo from '../../../lib/images/opera-touch.png'
import operaTouchLogo2x from '../../../lib/images/[email protected]'

export const notSupported = {
mobileNotSupported: {
heading: 'Mobile Not Supported',
Expand All @@ -67,12 +76,14 @@ export const notSupported = {
browserNotSupported: {
heading: 'This Browser is Not Supported',
description: () =>
`This Dapp is not supported in ${state.userAgent.browser.name}. Please visit us in one of the following browsers. Thank You!`
`This Dapp is not supported in ${
state.userAgent.browser.name
}. Please visit us in one of the following browsers. Thank You!`
},
mobileWalletNotSupported: {
heading: 'Install A Mobile Dapp Wallet',
description: () =>
'A mobile ethereum wallet is needed to use this dapp. We recommend Trust or Coinbase wallet.'
'A mobile ethereum wallet is needed to use this dapp. We recommend one of the following mobile wallets.'
}
}

Expand Down Expand Up @@ -293,6 +304,18 @@ export const imageSrc = {
src: coinbaseLogo,
srcset: coinbaseLogo2x
},
braveLogo: {
src: braveLogo,
srcset: braveLogo2x
},
operaLogo: {
src: operaLogo,
srcset: operaLogo2x
},
operaTouchLogo: {
src: operaTouchLogo,
srcset: operaTouchLogo2x
},
mobileWallet: {
src: mobileWallet,
srcset: mobileWallet2x
Expand Down
45 changes: 38 additions & 7 deletions src/js/views/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ export function notSupportedImage(type) {
}

export function browserLogos() {
const { chromeLogo, firefoxLogo } = imageSrc
const { chromeLogo, firefoxLogo, braveLogo, operaLogo } = imageSrc
return `
<p>
<p class="btn-row">
<a href="https://www.google.com/chrome/" target="_blank" class="bn-btn bn-btn-primary bn-btn-outline text-center">
<img
src="${chromeLogo.src}"
Expand All @@ -238,18 +238,38 @@ export function browserLogos() {
Firefox
</a>
</p>
<p>
<a href="https://www.opera.com/download" target="_blank" class="bn-btn bn-btn-primary bn-btn-outline text-center">
<img
src="${operaLogo.src}"
alt="Opera Logo"
srcset="${operaLogo.srcset} 2x" />
<br>
Opera
</a>
<a href="https://brave.com/" target="_blank" class="bn-btn bn-btn-primary bn-btn-outline text-center">
<img
src="${braveLogo.src}"
alt="Brave Logo"
srcset="${braveLogo.srcset} 2x" />
<br>
Brave
</a>
</p>
`
}

function walletLogos() {
const { trustLogo, coinbaseLogo } = imageSrc
const { trustLogo, coinbaseLogo, operaTouchLogo } = imageSrc

return `
<p class="flex-row">
<a href="https://links.trustwalletapp.com/a/key_live_lfvIpVeI9TFWxPCqwU8rZnogFqhnzs4D?&event=openURL&url=${window.location.href}" target="_blank" style="margin: 0 10px;" class="bn-btn bn-btn-primary bn-btn-outline text-center flex-column">
<p class="flex-row btn-row">
<a href="https://links.trustwalletapp.com/a/key_live_lfvIpVeI9TFWxPCqwU8rZnogFqhnzs4D?&event=openURL&url=${
window.location.href
}" target="_blank" style="margin: 0 10px;" class="bn-btn bn-btn-primary bn-btn-outline text-center flex-column">
<img
src="${trustLogo.src}"
alt="Chrome Logo"
alt="Trust Logo"
srcset="${trustLogo.srcset} 2x"
/>
<br>
Expand All @@ -258,13 +278,24 @@ function walletLogos() {
<a href="https://go.cb-w.com/" target="_blank" style="margin: 0 10px;" class="bn-btn bn-btn-primary bn-btn-outline text-center flex-column">
<img
src="${coinbaseLogo.src}"
alt="Firefox Logo"
alt="Coinbase Logo"
srcset="${coinbaseLogo.srcset} 2x"
/>
<br>
Coinbase
</a>
</p>
<p class="flex-row">
<a href="https://www.opera.com/mobile/touch" target="_blank" style="margin: 0 10px;" class="bn-btn bn-btn-primary bn-btn-outline text-center flex-column">
<img
src="${operaTouchLogo.src}"
alt="Opera Touch Logo"
srcset="${operaTouchLogo.srcset} 2x"
/>
<br>
Opera Touch
</a>
</p>
`
}

Expand Down

0 comments on commit aac9654

Please sign in to comment.