add resume react app

This commit is contained in:
b1ek 2023-03-10 00:19:09 +10:00
parent 65ba8028d8
commit 2ede37e3c3
Signed by: blek
GPG Key ID: 14546221E3595D0C
7 changed files with 60 additions and 1 deletions

2
react/resume/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.parcel-cache
dist

23
react/resume/package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "resume",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"source": "src/index.html",
"browserslist": "> 0.5%, last 2 versions, not dead",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "parcel",
"build": "parcel build"
},
"author": "blek",
"license": "MIT",
"devDependencies": {
"parcel": "^2.8.3",
"process": "^0.11.10"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}

3
react/resume/src/Base.js Normal file
View File

@ -0,0 +1,3 @@
export function Base() {
return <p></p>;
}

6
react/resume/src/app.js Normal file
View File

@ -0,0 +1,6 @@
import { createRoot } from "react-dom/client";
import { Base } from './Base';
const container = document.getElementById("resume_js_app");
const root = createRoot(container)
root.render(<Base />);

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<title>Resume debug mode</title>
<script type="module" src='app.js'></script>
<link rel="stylesheet" href='styles.css'/>
</head>
<body>
<div id='resume_js_app'></div>
</body>
</html>

1
react/resume/src/styles.css Symbolic link
View File

@ -0,0 +1 @@
../../../public/static/ui/resume.css

View File

@ -2,6 +2,12 @@ extends ../layout/main.pug
block root
- var title = 'Resume'
link(rel='stylesheet' href='/static/ui/resume.css')
if (process.env.APP_DEBUG != 'true')
script(src='/static/assets/resume.js')
else
script(src='https://unpkg.com/react@18/umd/react.development.js' crossorigin)
script(src='https://unpkg.com/react-dom@18/umd/react-dom.development.js' crossorigin)
script(src='/dev_asset/resume.js')
block content
h2 My online resume
@ -12,3 +18,9 @@ block content
| JS is loading. Please hold on...
br
img(src='/static/ui/load.gif' style='border-radius:4px;margin-top:6px')
br
noscript
span(style='font-size:9pt;color:darkred;font-weight:bold;text-align:center')
| It seems that you have JS disabled.
br
| Please, enable it in order to run the app.