Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ curl -o- https://github.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Install and use Node.js version 12.x.

```
nvm install 12
nvm use 12
nvm install 18
nvm use 18
```

To check Node.js version
Expand Down
39 changes: 39 additions & 0 deletions demo/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Main app page for mp-react-component
* Serves as a playground for testing and viewing components
*
* Experimental implementations of components are imported from the views directory
* and rendered here.
*/
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import './styles.less';
import { BrowserRouter as Router, Link, Route, Switch } from 'react-router-dom';
//import './assets/fonts.css';
//import '../node_modules/bulma/css/bulma.min.css';
//import '../node_modules/bulma-tooltip/dist/css/bulma-tooltip.min.css';
import { CrystalStructureAnimationViewer } from '../src/pages/CrystalStructureAnimationViewer';
import { CrystalStructureViewer } from '../src/pages/CrystalStructureViewer';

const mountNodeSelector = 'app';
const mountNode = document.getElementById(mountNodeSelector);

ReactDOM.render(
<>
<Router>
<div className="basic-navbar">
<Link to="/crystal_animation">Crystal Animation</Link>
</div>
<section>
<Switch>
<Route path="/">
<CrystalStructureViewer />
</Route>
</Switch>
</section>
</Router>
</>,

mountNode
);
console.log('RUNNING in', process.env.NODE_ENV, 'DEBUGGING IS', process.env.DEBUG);
21 changes: 21 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>App</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://kit.fontawesome.com/eb70cee2b0.js" crossorigin="anonymous"></script>
</head>
<style>
body {
margin: 0;
}
.mp-element-wrapper {
margin: 10px;
}
</style>
<body>
<div id="app"></div>
<script src="app.tsx"></script>
</body>
</html>
Loading