-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from na3d/common-styles-fix
Common styles fix
- Loading branch information
Showing
9 changed files
with
165 additions
and
51 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
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,17 @@ | ||
import React, { PropTypes } from 'react'; | ||
import { Link } from 'react-router'; | ||
|
||
export default function WarningButton(props) { | ||
return ( | ||
<Link | ||
to={props.to} | ||
className="btn btn-warning" | ||
target={props.target ? props.target : ''} | ||
><i className="fa fa-exclamation"></i></Link> | ||
); | ||
} | ||
|
||
WarningButton.propTypes = { | ||
to: PropTypes.string.isRequired, | ||
target: PropTypes.string, | ||
}; |
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
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,24 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { expect } from 'chai'; | ||
import WarningButton from '~/components/WarningButton'; | ||
|
||
describe('components/WarningButton', () => { | ||
it('renders warning button with target blank', () => { | ||
const button = shallow( | ||
<WarningButton to="http://example.org" /> | ||
); | ||
|
||
expect(button.find('Link').props().to).to.equal('http://example.org'); | ||
expect(button.find('Link').props().target).to.equal(''); | ||
}); | ||
|
||
it('renders warning button with target _parent', () => { | ||
const button = shallow( | ||
<WarningButton to="http://example.org" target="_parent" /> | ||
); | ||
|
||
expect(button.find('Link').props().to).to.equal('http://example.org'); | ||
expect(button.find('Link').props().target).to.equal('_parent'); | ||
}); | ||
}); |
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
Oops, something went wrong.