-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consumes component from demo folder (#712)
* Consumes component from demo folder * add demo-index as direct dependency
- Loading branch information
Showing
8 changed files
with
40 additions
and
4 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
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,3 @@ | ||
@import url("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/codemirror.min.css"); | ||
@import url("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/theme/monokai.min.css"); | ||
@import "../src/styles/demo-component.css"; |
28 changes: 28 additions & 0 deletions
28
samples/demo-component/packages/demo-component/demo/demo.jsx
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,28 @@ | ||
import React from "react"; | ||
import { addLocaleData, IntlProvider } from "react-intl"; | ||
import * as libraryScope from "../src/index"; | ||
|
||
import Demo from "electrode-demo-index"; | ||
|
||
const locale = "en"; | ||
const messages = require(`../src/lang/${locale}.json`); | ||
const localeData = require(`react-intl/locale-data/${locale}`); | ||
|
||
addLocaleData(localeData); | ||
|
||
const components = [ | ||
{ | ||
examples: [ | ||
{ | ||
type: "playground", | ||
code: require("raw-loader!./examples/demo-component.example"), | ||
noRender: true | ||
} // any additional examples here | ||
] | ||
} // any additional components here | ||
]; | ||
|
||
const localScope = { IntlProvider, messages, locale }; | ||
const demo = () => <Demo scope={localScope} libraryScope={libraryScope} components={components} />; | ||
|
||
export default demo; |
1 change: 1 addition & 0 deletions
1
samples/demo-component/packages/demo-component/demo/examples/demo-component.example
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 @@ | ||
<DemoComponent /> |
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