Skip to content

Commit 75cf02e

Browse files
author
Rares Mardare
committed
Merge remote-tracking branch 'origin/master'
2 parents eb4e4b3 + 6bed6c4 commit 75cf02e

25 files changed

+654
-557
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 3.0.0
4+
5+
### Changes
6+
7+
* TS support
8+
* Added full-sized containers for top and bottom
9+
* Changed SASS style to match BEM - *breaking change*
10+
* Limit center containers to 350px
11+
* Allow dynamic expansion of containers based on each notification's width
12+
* Adedd new API call `removeAllNotifications`
13+
* Removed `prop-types` package, props are now defaulted internally
14+
15+
### Fixes
16+
17+
* #82, #69, #67, #65, #63, #61
18+
319
## 2.4.1
420

521
### Changes

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[![npm version](https://badgen.net/npm/v/react-notifications-component)](https://www.npmjs.com/package/react-notifications-component) [![npm](https://img.shields.io/npm/dm/react-notifications-component.svg)](https://www.npmjs.com/package/react-notifications-component) [![Minified & Gzipped size](https://badgen.net/bundlephobia/minzip/react-notifications-component)](https://bundlephobia.com/result?p=react-notifications-component)
22
# react-notifications-component
33

4-
![Logo](https://raw.githubusercontent.com/teodosii/react-notifications-component/master/new-logo.png "Logo")
5-
64
A delightful, easy to use and highly configurable component to help you notify your users out of the box. No messy setup, just beautiful notifications!
75

86
> :fire: :fire: :fire: Interested in an animation library for React? I just launched `react-tweenful`, check it out here https://github.com/teodosii/react-tweenful

new-logo.png

-18.6 KB
Binary file not shown.

package-lock.json

Lines changed: 31 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"babel-plugin-transform-class-properties": "^6.24.1",
5454
"bootstrap": "^4.3.1",
5555
"clean-webpack-plugin": "^3.0.0",
56-
"copy-webpack-plugin": "^6.0.3",
56+
"copy-webpack-plugin": "^6.1.1",
5757
"css-loader": "^4.2.1",
5858
"css-select-base-adapter": "^0.1.1",
5959
"eslint": "^7.7.0",
@@ -92,8 +92,5 @@
9292
},
9393
"peerDependencies": {
9494
"react": "^16.0.0"
95-
},
96-
"dependencies": {
97-
"prop-types": "^15.6.2"
9895
}
9996
}

samples/js/components/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function App() {
1010
<ReactNotification
1111
types={[
1212
{
13-
htmlClasses: ['notification-awesome'],
13+
htmlClasses: ['notification__item--awesome'],
1414
name: 'awesome'
1515
}
1616
]}

samples/js/components/Content.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import { store } from 'src';
23
import ContainerExample from 'components/examples/ContainerExample';
34
import TypeExample from 'components/examples/TypeExample';
45
import InsertExample from 'components/examples/InsertExample';
@@ -10,6 +11,9 @@ function ExampleHeading() {
1011
<div className="row">
1112
<div className="col-lg-6 offset-lg-3 column col-md-10 offset-md-1 col-sm-12 heading">
1213
<h2 className="text-center">Examples</h2>
14+
<button type="button" className="btn btn-outline-danger" onClick={() => store.removeAllNotifications()}>
15+
Remove All Notifications
16+
</button>
1317
<div className="alert alert-warning alert-small">
1418
<i className="fa fa-info-circle"></i>
1519
All notifications have been set to be automatically dismissed after{' '}

samples/js/components/examples/ContainerExample.tsx

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,52 +25,59 @@ export default function ContainerExample() {
2525
onClick={() => add('top-left')}
2626
>
2727
Top Left
28-
</button>
29-
{' '}
28+
</button>{' '}
3029
<button
3130
type="button"
3231
className="btn btn-outline-secondary"
3332
onClick={() => add('top-right')}
3433
>
3534
Top Right
36-
</button>
37-
{' '}
35+
</button>{' '}
3836
<button
3937
type="button"
4038
className="btn btn-outline-secondary"
4139
onClick={() => add('top-center')}
4240
>
4341
Top Center
44-
</button>
45-
{' '}
42+
</button>{' '}
4643
<button type="button" className="btn btn-outline-secondary" onClick={() => add('center')}>
4744
Center
48-
</button>
49-
{' '}
45+
</button>{' '}
5046
<button
5147
type="button"
5248
className="btn btn-outline-secondary"
5349
onClick={() => add('bottom-left')}
5450
>
5551
Bottom Left
56-
</button>
57-
{' '}
52+
</button>{' '}
5853
<button
5954
type="button"
6055
className="btn btn-outline-secondary"
6156
onClick={() => add('bottom-right')}
6257
>
6358
Bottom Right
64-
</button>
65-
{' '}
59+
</button>{' '}
6660
<button
6761
type="button"
6862
className="btn btn-outline-secondary"
6963
onClick={() => add('bottom-center')}
7064
>
7165
Bottom Center
66+
</button>{' '}
67+
<button
68+
type="button"
69+
className="btn btn-primary"
70+
onClick={() => add('top-full')}
71+
>
72+
Top Full
73+
</button>{' '}
74+
<button
75+
type="button"
76+
className="btn btn-primary"
77+
onClick={() => add('bottom-full')}
78+
>
79+
Bottom Full
7280
</button>
73-
{' '}
7481
</div>
7582
</div>
7683
</div>
@@ -81,10 +88,12 @@ function add(container: string): string {
8188
const type = getType();
8289
const object: iNotification = {};
8390

84-
return store.addNotification(Object.assign(object, notification, {
85-
title: getTitle(type),
86-
message: getMessage(type),
87-
container,
88-
type
89-
}));
91+
return store.addNotification(
92+
Object.assign(object, notification, {
93+
title: getTitle(type),
94+
message: getMessage(type),
95+
container,
96+
type
97+
})
98+
);
9099
}

samples/js/components/examples/CustomContentExample.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ function addCustomIcon(type: string, iconClassName: string): void {
8484
width: 275,
8585
container: getContainer(),
8686
content: (
87-
<div className={`notification-custom-${type}`}>
88-
<div className="notification-custom-icon">
87+
<div className={`notification__custom--${type}`}>
88+
<div className="notification__custom-icon">
8989
<i className={iconClassName} />
9090
</div>
91-
<div className="notification-custom-content">
92-
<p className="notification-message">{message}</p>
91+
<div className="notification__custom">
92+
<p className="notification__message">{message}</p>
9393
</div>
9494
</div>
9595
)

samples/js/components/examples/TypeExample.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function TypeExample() {
4343
<button type="button" className="btn btn-outline-secondary" onClick={() => add('danger')}>
4444
Danger
4545
</button>{' '}
46-
<button type="button" className="btn btn-primary" onClick={() => this.add('awesome')}>
46+
<button type="button" className="btn btn-primary" onClick={() => add('awesome')}>
4747
Custom
4848
</button>
4949
</div>

0 commit comments

Comments
 (0)