-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Container component to simplify app/lib entrypoint (#379)
1. Create new Container component, and move a lot of the logic for the app entrypoint to it, in order to keep src/index.js as simple as possible. 2. Move the 'what-input' import to the App component - it should have been there to begin with. 3. Move the global app styles from src/styles.index.scss to Container component, as they are most related to this component. 4. Change import order in App component - cosmetic change to ensure that absolute imports come first. 5. Add better explanation in App/Container JSDoc comments
- Loading branch information
1 parent
3ad3f50
commit 616413f
Showing
4 changed files
with
28 additions
and
15 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
File renamed without changes.
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,18 @@ | ||
import React from 'react'; | ||
import App from '../app'; | ||
import EasterEgg from '../easter-egg'; | ||
import getPipelineData from '../../utils/data-source'; | ||
import './container.css'; | ||
|
||
/** | ||
* Top-level component for the use-case where Kedro-Viz is run as a standalone | ||
* app rather than imported as a library/package into a larger application. | ||
*/ | ||
const Container = () => ( | ||
<> | ||
<App data={getPipelineData()} /> | ||
<EasterEgg /> | ||
</> | ||
); | ||
|
||
export default Container; |
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,16 +1,5 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import 'what-input'; | ||
import App from './components/app'; | ||
import EasterEgg from './components/easter-egg'; | ||
import getPipelineData from './utils/data-source'; | ||
import './styles/index.css'; | ||
|
||
const KedroViz = () => ( | ||
<> | ||
<App data={getPipelineData()} /> | ||
<EasterEgg /> | ||
</> | ||
); | ||
import KedroViz from './components/container'; | ||
|
||
ReactDOM.render(<KedroViz />, document.getElementById('root')); |