You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Contract decoration improvements (#209)
* Fix truffle contract decoration with web3 0.20
* Improve contract tests
* - Improve robustness of contract tests
- Fix contract method properties not being properly assigned on web3v1
- Fix overloaded contract methods not being properly assigned
* Use Object.keys to pull properties off function
* Truffle fixes (#219)
* Fix legacyCall with truffle contracts
* Fix truffle calls hanging forever
* Configure mobile position (#216)
* Setup an initial config parameters
* - Improve notifications position API
- Set default notification position on mobile to 'top'
* Add additional notificationsPosition tests
* Readme wording
* Document both APIs for notificationsPosition
* Update readme (#221)
* update to version 0.8.2
notificationsPosition:String, // Defines which corner transaction notifications will be positioned. Options: 'topLeft', 'topRight', 'bottomRight', 'bottomLeft'. ['bottomRight']
206
+
notificationsPosition:Object||String, // Defines where in the viewport notifications will be positioned. See below: 'Notification Positioning'
207
207
css:String// Custom css string to overide Assist default styles
208
208
},
209
209
truffleContract:Boolean, // Set to true if contract object has been instantiated with truffle-contract [false]
210
210
}
211
211
```
212
212
213
+
### Notification Positioning
214
+
215
+
The position that notifications appear in the viewport can be configured by defining `style.notificationsPosition` in your config when initializing assist.
216
+
217
+
`notificationsPosition` can be either a `String` which will set only the desktop position, or an `Object` containing params `desktop` and/or `mobile` which set the notification position on desktop and mobile respectively.
218
+
219
+
Options for setting `desktop` positions: `['topLeft', 'topRight', 'bottomLeft', 'bottomRight']`
220
+
221
+
Options for setting `mobile` positions: `['top', 'bottom']`
222
+
223
+
By default, `Assist` positions notifications at the `top` of the viewport on mobile, and the `bottomRight` of the viewport on desktop.
224
+
225
+
#### Examples
226
+
227
+
```javascript
228
+
// Set notifications to bottom on mobile and top right on desktop
229
+
constconfig= {
230
+
style: {
231
+
notificationsPosition: {
232
+
desktop:'topLeft',
233
+
mobile:'bottom'
234
+
}
235
+
}
236
+
}
237
+
```
238
+
239
+
```javascript
240
+
// Sets only the desktop position
241
+
constconfig= {
242
+
style: {
243
+
notificationsPosition:'bottomRight'
244
+
}
245
+
}
246
+
```
247
+
248
+
213
249
### Custom Transaction Messages
214
250
215
251
Custom transaction messages can be set to override the default messages `Assist` provides. To do this you provide callback functions for each `eventCode` that you want to override. The callback functions must return a `String` and will be called with the following object to provide context information about the transaction:
@@ -465,23 +501,24 @@ assistInstance.getState()
465
501
conststyle= {
466
502
darkMode:Boolean, // Set Assist UI to dark mode
467
503
css:String, // Custom css string to overide Assist default styles
468
-
notificationsPosition:String, // Defines which corner transaction notifications will be positioned. Options: 'topLeft', 'topRight', 'bottomRight', 'bottomLeft'. ['bottomRight']
504
+
notificationsPosition:String||Object, // Defines which corner transaction notifications will be positioned. See 'Notification Positioning'
469
505
}
470
506
```
471
507
472
508
#### Examples
473
509
474
510
```javascript
475
-
// Enable dark mode
511
+
// Enable dark mode and position notifications at the bottom left on desktop
476
512
conststyle= {
477
-
darkMode:true
513
+
darkMode:true,
514
+
notificationsPosition:'bottomLeft'
478
515
}
479
516
assistInstance.updateStyle(style)
480
517
481
-
//Disable dark mode and set notification background to black
518
+
//Position notifications at the bottom of the viewport on mobile and set their background to black
0 commit comments