Skip to content

Commit

Permalink
✨v1 release notes and docs 😄
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeceM committed Mar 13, 2020
1 parent 5912136 commit b63fdf4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to `h-bar` will be documented in this file.

# 1.0.0 - 2020-03-13

First initial major version of h-bar :)

This has kinda the base features for the first version.

See previous versions for the features to this point.

# 0.3.0 - 2020-03-13

***FEATURE***
Expand Down
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ The initialization object currently has this structure and defaults:
}
],
parser: (data) => {/** Parser function */}
dismissible: false, // dismissible banner flag
dismissFor: new Date('2020-03-30'), // would dismiss it till end of march 30th
options: {
theme: "gray",
secondaryLinks: [],
Expand Down Expand Up @@ -162,6 +164,42 @@ hBar.init({
})
```

### Dismissing Notifications

> Available from `v0.3.0`/`v1.0.0`
**Temporary Dismissing**
To be able to dismiss a notification, please note it currently removes secondary links. It is therefore useful that you use this feature when just making announcements of a event or brief notification.

The way to activate session based dismissal is:

```javascript
{
//... rest of config
dismissible: true,
//... rest of config
}
```

This will just disable the banner for the current page visit, if the user reloads, its back.

**Time based dismissing**

To dismiss the banner until another time, you can set the `dismissFor` variable, this requires a `Date()` object.

When you set this and the banner is dismissed, the UTC milliseconds are stored in the localStorage, this is then read back when loading h-Bar.

```javascript
{
//... rest of config
dismissible: true,
dismissFor: new Date('2020-03-30'), // would dismiss it till end of march 30th
}
```

If you fail to set the value properly, it won't dismiss and the banner will show by default.


### Testing

_to come_ please make a PR if you know how to do it on JS.
Expand Down

0 comments on commit b63fdf4

Please sign in to comment.