forked from USStateDept/State-TalentMAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toast notifications for favoriting actions (#114)
- Loading branch information
Showing
8 changed files
with
96 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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 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,13 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { POSITION_DETAILS } from '../../Constants/PropTypes'; | ||
|
||
const Success = ({ pos }) => ( | ||
<span>{pos.title} ({pos.position_number}) has been successfully added to Favorites. <Link to="/profile/favorites/">Go to Favorites</Link>.</span> | ||
); | ||
|
||
Success.propTypes = { | ||
pos: POSITION_DETAILS.isRequired, | ||
}; | ||
|
||
export default Success; |
This file contains 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,11 @@ | ||
import { shallow } from 'enzyme'; | ||
import React from 'react'; | ||
import Success from './Success'; | ||
import detailsObject from '../../__mocks__/detailsObject'; | ||
|
||
describe('Success', () => { | ||
it('is defined', () => { | ||
const wrapper = shallow(<Success pos={detailsObject} />); | ||
expect(wrapper).toBeDefined(); | ||
}); | ||
}); |
This file contains 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 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 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,13 +1,15 @@ | ||
export function toastSuccess(toast) { | ||
export function toastSuccess(toast, title) { | ||
return { | ||
type: 'TOAST_NOTIFICATION_SUCCESS', | ||
toast, | ||
title, | ||
}; | ||
} | ||
|
||
export function toastError(toast) { | ||
export function toastError(toast, title) { | ||
return { | ||
type: 'TOAST_NOTIFICATION_ERROR', | ||
toast, | ||
title, | ||
}; | ||
} |
This file contains 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 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