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
* Initial Notify setup steps
* Styling notification
* Styling getting closer
* Layout looking a lot better
* Animations working properly for pending
* Updated cleanliness
* Demo stuff
* Props passed in properly
* Rename and refactors
* Notify into AC
* Cleanup and merge in develop
* More cleanup and positioning
* Add css variables
* Fix and style timer
* More cleanup
* Updated structure and componentized further
* cleanup
* Add flags to denote v1 ref code
* Playing around with organization
* In progress
* Progress
* Progress
* Working notifications
* Latest SDK branch
* Add timeout to unsub calls
* Add timeout to disconnect
* Use NotifyEventStyles type
* Update comments
* Tidy up import statements
* Update docs
* Update versions
* Componentise notification
* Add margin to modal
* Remove network from customize notification
* Add hint and error types back
* Throw if invalid custom notification
* Upgrade sdk and handle unsupported network error
* Auto dismiss notification
* More README updates
* Update spacing and layout to display properly
* cleanup and more positioning
* Animations working
* Fix animation speed, linking in transaction hash
* Fix padding on AC
* Add text color to non-linking transaction hash
* More variablization and updating docs
* Add demo with updates for testing in the future
* Return the 4 second default dismiss to notifications, Fix margin causing view overflow in AC when switching chains
* Remove margin
* Update on hover to display close button, chain icon size, add close icon from mock, update margin
* Add new hint notification
* Update README for more info around notifications
* Revert dismiss timeout used for testing
* styling touchups
* Add DAPP notifications
* reset sizing for network select
* Working but needs cleanup
* Update action to return update and dismiss methods
* Update docs and remove unneeded type
* Cleanup of unneeded imports
* Updated styling of notifications for second round of style updates, removed status icon if not defined
* More styling of new info icon layout
* Update padding for info icon
* Handle replacement transactions
* Working on scrolling
* Update notification working
* Revert scroll on container breaking animations
* Updates SDK to version with multichain
* Always display close button on mobile notifications
* Fix scrolling
* Fix styling on notification container
* Handle newest notifications entering closest to AC despite location
* Updated styling of container to allow more space on mobile
* Update layout for single line notifications
* Updates to styling of hash/time container
* Update styling for new layout
* Working but animation updates coming
* Update layout for all animations to match mobile animations
* Removes unused de
* Update yarn and remove uuid from dep in core
* Remove 1rem buffer for animations
* Revert to 4 second dismiss
* Update types in action
* Add nanoId, update types for notification update method
* Update animations of removal
* Fix comment to reflect functionality
* Fix pending on safari
* Update packages/core/rollup.config.js
Co-authored-by: Aaron Barnard <abarnard@protonmail.com>
* Update packages/demo/src/App.svelte
Co-authored-by: Aaron Barnard <abarnard@protonmail.com>
* remove unused import
* merge in dev
* Update types and remove unneeded import
* Fix animation cutoff on end of list when removing an element
* Update readme
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/demo/src/App.svelte
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/core/README.md
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
* Update packages/core/README.md
* Fix styling and scroll direction when notifications are placed on bottom of screen
* Add latest packages to Core README
* Handle scroll container withaccount center expanded
* Update touch-events for scroll on mobile
Co-authored-by: Aaron Barnard <abarnard@protonmail.com>
Co-authored-by: Taylor Dawson <taylorjdwson@gmail.com?
Notify provides by default transaction notifications for all connected wallets on the current blockchain. When switching chains the previous chain listeners remain active for 60 seconds to allow capture and report of an remaining transactions that may be in flight.
123
+
By default transaction notifications are captured if a DAppID is provided in the Onboard config along with the Account Center being enabled.
124
+
An object that defines whether transaction notifications will display (defaults to true if an API key is provided). This object contains an `enabled` flag prop and an optional `transactionHandler` which is a callback that can disable or allow customizations of notifications.
125
+
Currently notifications are positioned in the same location as the account center (either below, if the Account Center is positioned along the top, or above if positioned on the bottom of the view).
126
+
The `transactionHandler` can react off any property of the Ethereum TransactionData returned to the callback from the event (see console.log in example init). In turn, it can return a Custom `Notification` object to define the verbiage, styling, or add functionality:
127
+
- `Notification.message` - to completely customize the message shown
128
+
- `Notification.eventCode` - handle codes in your own way - see codes here under the notify prop [default en file here](src/i18n/en.json)
129
+
- `Notification.type` - icon type displayed (see `NotificationType` below for options)
130
+
- `Notification.autoDismiss` - time (in ms) after which the notification will be dismissed. If set to `0` the notification will remain on screen until the user dismisses the notification, refreshes the page or navigates away from the site with the notifications
131
+
- `Notification.link` - add link to the transaction hash. For instance, a link to the transaction on etherscan
132
+
- `Notification.onClick()` - onClick handler for when user clicks the notification element
133
+
134
+
Notify can also be styled by using the CSS variables found below. These are setup to allow maximum customization with base styling variables setting the global theme (i.e. `--onboard-grey-600`) along with more precise component level styling variables available (`--notify-onboard-grey-600`) with the latter taking precedent if defined
135
+
136
+
If notifications are enabled the notifications can be handled through onboard app state as seen below.
Notify can be used to deliver custom DApp notifications by passing a `CustomNotification` object to the `customNotification` action. This will return an `UpdateNotification` type.
191
+
This `UpdateNotification` will return an `update` function that can be passed a new `CustomNotification` to update the existing notification.
192
+
The `customNotification` method also returns a `dismiss` method that is called without any parameters to dismiss the notification.
193
+
194
+
```typescript
195
+
const { update, dismiss } =
196
+
onboard.state.actions.customNotification({
197
+
type: 'pending',
198
+
message:
199
+
'This is a custom DApp pending notification to use however you want',
200
+
autoDismiss: 0
201
+
})
202
+
setTimeout(
203
+
() =>
204
+
update({
205
+
eventCode: 'dbUpdateSuccess',
206
+
message: 'Updated status for custom notification',
207
+
type: 'success',
208
+
autoDismiss: 8000
209
+
}),
210
+
4000
211
+
)
212
+
```
213
+
119
214
### Initialization Example
120
215
121
216
Putting it all together, here is an example initialization with the injected wallet modules:
0 commit comments