forked from carbon-design-system/carbon
-
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.
Split component example (carbon-design-system#341)
* chore(ComponentExample): extract out vanilla instantiation code This change extracts out instantiation/release code of vanilla JavaScript library from `<ComponentExample>` and plain-HTML-specific code from `<CodeExample>`. Doing so paves the cowpath toward better integration of React live demo to those component. Refs carbon-design-system#1936. * fix(ComponentExample): remove unintentional change * fix(ComponentExample): fix typo * chore(ComponentExample): remove stale component name list
- Loading branch information
1 parent
21ae620
commit 0b7f38f
Showing
6 changed files
with
321 additions
and
246 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,32 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import CodeExample from './CodeExample'; | ||
import getHTMLFile from '../../utils/getHTMLFile'; | ||
|
||
const CodeExampleHTML = ({ component, variation, useLightVersion }) => { | ||
const html = getHTMLFile({ | ||
component, | ||
variation, | ||
useLightVersion, | ||
}); | ||
return <CodeExample htmlFile={html} codeClassName="language-html" />; | ||
}; | ||
|
||
CodeExampleHTML.propTypes = { | ||
/** | ||
* The component name. | ||
*/ | ||
component: PropTypes.string, | ||
|
||
/** | ||
* The component variation name. | ||
*/ | ||
variation: PropTypes.string, | ||
|
||
/** | ||
* `true` to use the light version. | ||
*/ | ||
useLightVersion: PropTypes.bool, | ||
}; | ||
|
||
export default CodeExampleHTML; |
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.