Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Commit

Permalink
Added Import component
Browse files Browse the repository at this point in the history
  • Loading branch information
Akronix committed Feb 19, 2018
1 parent 0555521 commit 1ad7f02
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion demo/Demo.react.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {Card, Accordion, Tabs, LoadingDialog} from '../src';
import {Card, Accordion, Tabs, LoadingDialog, Import} from '../src';
import '!style!css!./demo.css'; // eslint-disable-line

class Demo extends Component {
Expand Down Expand Up @@ -50,6 +50,7 @@ class Demo extends Component {

return (
<div>
<Import />
<h1>grasia-dash-components Demo</h1>

<hr/>
Expand Down
21 changes: 21 additions & 0 deletions src/components/Import.react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import PropTypes from 'prop-types';

/**
* Import serves for the only purpose to force Dash to load grasia-dash-components.
* This is useful when you want to use grasia components that are going to be
* added dynamically to the Dash app layout.
*/
export default class Import extends React.Component {

render() {
return null;
}
}

Import.propTypes = {
/**
* The ID used to identify this component in Dash callbacks
*/
id: PropTypes.string
};
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import Card from './components/Card.react';
import Accordion from './components/Accordion.react';
import Tabs from './components/Tabs.react';
import LoadingDialog from './components/LoadingDialog.react';
import Import from './components/Import.react';

export {
Accordion,
ExampleComponent,
Card,
Tabs,
LoadingDialog
LoadingDialog,
Import
};
2 changes: 2 additions & 0 deletions usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def generate_card():

app.layout = html.Div([

grasia_dash_components.Import(),

html.H2('Loading dialog'),
html.Button('Show Loading Dialog', id='button'),
grasia_dash_components.LoadingDialog(id="dialog", text="test", show=False),
Expand Down

0 comments on commit 1ad7f02

Please sign in to comment.