This repository was archived by the owner on Jan 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Add banner notifications system #88
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3227c9f
Add systems/BannerNotification code
vforge 94a3202
Add build
vforge b9cb186
Unify styleguide menu & rebuild
vforge 2bb244b
Add readme
vforge 8e07d59
Test in app and fix-errors
vforge 919e75f
fix case
vforge e31cb41
fix case
vforge f52793c
Rename files and test
vforge d9d63e8
Revert testUrl change
vforge 040af36
Merge remote-tracking branch 'origin/master' into add-banner-notifica…
vforge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
docs/build/bundle.dbb37ab1.js → docs/build/bundle.99143a78.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>react-design-system</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Rubik:400,700"></head><body><div id="rsg-root"></div><div id="app"></div><script src="build/bundle.dbb37ab1.js"></script></body></html> | ||
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>react-design-system</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Rubik:400,700"></head><body><div id="rsg-root"></div><div id="app"></div><script src="build/bundle.99143a78.js"></script></body></html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-react", | ||
["@babel/preset-env", {"targets": {"node": "current"}, "modules": false}] | ||
], | ||
"plugins": [ | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-syntax-object-rest-spread" | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"@babel/plugin-proposal-class-properties" | ||
], | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
] | ||
"env": { | ||
"test": { | ||
"plugins": [ | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"@babel/plugin-proposal-class-properties" | ||
], | ||
"presets": [ | ||
"@babel/preset-react", | ||
["@babel/preset-env", {"targets": {"node": "current"}}] | ||
] | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import React from 'react'; | ||
import Adapter from 'enzyme-adapter-react-16'; // eslint-disable-line import/no-extraneous-dependencies | ||
import Enzyme from 'enzyme'; // eslint-disable-line import/no-extraneous-dependencies | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); | ||
|
||
global.mockComponent = name => props => <mocked-component name={name} {...props} />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
source/systems/BannerNotifications/BannerNotificationsComponent.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { connect } from 'react-redux'; | ||
|
||
import BannerNotifications from '../../components/BannerNotifications'; | ||
|
||
import { removeNotfication } from './actions'; | ||
|
||
const mapStateToProps = state => ({ | ||
messages: state.BannerNotificationsStore.getNotifications().toJS(), | ||
}); | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
onClose(id) { | ||
// ignore what component will call | ||
/* istanbul ignore next */ | ||
dispatch(removeNotfication(id)); | ||
}, | ||
}); | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(BannerNotifications); |
15 changes: 15 additions & 0 deletions
15
source/systems/BannerNotifications/BannerNotificationsComponent.spec.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { createMockStore } from 'redux-test-utils'; | ||
import { mountWithStore } from 'enzyme-redux'; | ||
|
||
import StoreModel from './StoreModel'; | ||
import BannerNotificationsComponent from './BannerNotificationsComponent'; | ||
|
||
jest.mock('../../components/BannerNotifications', () => mockComponent('BannerNotifications')); | ||
|
||
test('BannerNotifications renders component', () => { | ||
const component = mountWithStore(<BannerNotificationsComponent />, createMockStore({ | ||
BannerNotificationsStore: StoreModel.empty(), | ||
})); | ||
expect(component.render()).toMatchSnapshot(); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.