-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #25600 - Migrate Icon to patternfly-react
Remove Icon from foreman Switch DocumentLinkContent to use patternfly-react Icon
- Loading branch information
Showing
9 changed files
with
29 additions
and
148 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
38 changes: 8 additions & 30 deletions
38
...ts/javascripts/react_app/components/common/DocumentationLink/DocumentationLink.stories.js
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,35 +1,13 @@ | ||
import React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import DocumentationLink, { DocumentLinkContent } from './index'; | ||
import Story from '../../../../../../stories/components/Story'; | ||
import DocumentationLink from './index'; | ||
|
||
storiesOf('Components/DocumentationLink', module) | ||
.add('Default', () => ( | ||
<Story> | ||
<ul> | ||
<DocumentationLink handleClick={action('Link was clicked')} href="#" /> | ||
</ul> | ||
</Story> | ||
)) | ||
.add('DocumentLinkContent wrapped in a button', () => ( | ||
<Story> | ||
<button className="btn btn-default"> | ||
<DocumentLinkContent /> | ||
</button> | ||
<button className="btn btn-primary"> | ||
<DocumentLinkContent /> | ||
</button> | ||
<button className="btn btn-warning"> | ||
<DocumentLinkContent /> | ||
</button> | ||
<button className="btn btn-danger"> | ||
<DocumentLinkContent /> | ||
</button> | ||
</Story> | ||
)) | ||
.add('DocumentLinkContent', () => ( | ||
<Story> | ||
<DocumentLinkContent /> | ||
</Story> | ||
)); | ||
storiesOf('Components/DocumentationLink', module).add('Default', () => ( | ||
<Story> | ||
<ul> | ||
<DocumentationLink handleClick={action('Link was clicked')} href="#" /> | ||
</ul> | ||
</Story> | ||
)); |
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
26 changes: 8 additions & 18 deletions
26
webpack/assets/javascripts/react_app/components/common/DocumentationLink/index.js
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,33 +1,23 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { MenuItem } from 'patternfly-react'; | ||
import Icon from '../Icon'; | ||
import { MenuItem, Icon } from 'patternfly-react'; | ||
import { newWindowOnClick } from '../../../common/helpers'; | ||
import { translate as __ } from '../../../../react_app/common/I18n'; | ||
|
||
export const DocumentLinkContent = ({ children }) => ( | ||
<React.Fragment> | ||
<Icon type="question-sign" className="icon-black" /> | ||
const DocumentationLink = ({ href, children }) => ( | ||
<MenuItem key="documentationUrl" href={href} onClick={newWindowOnClick(href)}> | ||
<Icon type="fa" name="question-circle" /> | ||
{` ${children}`} | ||
</React.Fragment> | ||
</MenuItem> | ||
); | ||
|
||
DocumentLinkContent.propTypes = { | ||
DocumentationLink.propTypes = { | ||
href: PropTypes.string.isRequired, | ||
children: PropTypes.node, | ||
}; | ||
|
||
DocumentLinkContent.defaultProps = { | ||
DocumentationLink.defaultProps = { | ||
children: __('Documentation'), | ||
}; | ||
|
||
const DocumentationLink = ({ href }) => ( | ||
<MenuItem key="documentationUrl" href={href} onClick={newWindowOnClick(href)}> | ||
<DocumentLinkContent /> | ||
</MenuItem> | ||
); | ||
|
||
DocumentationLink.propTypes = { | ||
href: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default DocumentationLink; |
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
30 changes: 0 additions & 30 deletions
30
webpack/assets/javascripts/react_app/components/common/Icon/Icon.consts.js
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
webpack/assets/javascripts/react_app/components/common/Icon/Icon.test.js
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
webpack/assets/javascripts/react_app/components/common/Icon/index.js
This file was deleted.
Oops, something went wrong.