Skip to content

Commit 5ac095a

Browse files
Chiu PeterChiu Peter
authored andcommitted
update readme to use Node18 and add demo/
1 parent b530630 commit 5ac095a

File tree

4 files changed

+406
-2
lines changed

4 files changed

+406
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
3030
Install and use Node.js version 12.x.
3131

3232
```
33-
nvm install 12
34-
nvm use 12
33+
nvm install 18
34+
nvm use 18
3535
```
3636

3737
To check Node.js version

demo/app.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Main app page for mp-react-component
3+
* Serves as a playground for testing and viewing components
4+
*
5+
* Experimental implementations of components are imported from the views directory
6+
* and rendered here.
7+
*/
8+
import * as React from 'react';
9+
import * as ReactDOM from 'react-dom';
10+
import './styles.less';
11+
import { BrowserRouter as Router, Link, Route, Switch } from 'react-router-dom';
12+
//import './assets/fonts.css';
13+
//import '../node_modules/bulma/css/bulma.min.css';
14+
//import '../node_modules/bulma-tooltip/dist/css/bulma-tooltip.min.css';
15+
import { CrystalStructureAnimationViewer } from '../src/pages/CrystalStructureAnimationViewer';
16+
import { CrystalStructureViewer } from '../src/pages/CrystalStructureViewer';
17+
18+
const mountNodeSelector = 'app';
19+
const mountNode = document.getElementById(mountNodeSelector);
20+
21+
ReactDOM.render(
22+
<>
23+
<Router>
24+
<div className="basic-navbar">
25+
<Link to="/crystal_animation">Crystal Animation</Link>
26+
</div>
27+
<section>
28+
<Switch>
29+
<Route path="/">
30+
<CrystalStructureViewer />
31+
</Route>
32+
</Switch>
33+
</section>
34+
</Router>
35+
</>,
36+
37+
mountNode
38+
);
39+
console.log('RUNNING in', process.env.NODE_ENV, 'DEBUGGING IS', process.env.DEBUG);

demo/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>App</title>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<script src="https://kit.fontawesome.com/eb70cee2b0.js" crossorigin="anonymous"></script>
8+
</head>
9+
<style>
10+
body {
11+
margin: 0;
12+
}
13+
.mp-element-wrapper {
14+
margin: 10px;
15+
}
16+
</style>
17+
<body>
18+
<div id="app"></div>
19+
<script src="app.tsx"></script>
20+
</body>
21+
</html>

0 commit comments

Comments
 (0)