Start integrating react views

This commit is contained in:
Quentin 2022-03-30 15:49:07 +02:00
parent ee31bc039b
commit fd954bf05b
10 changed files with 51 additions and 15 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ src/*.bs.js
src/**/*.bs.js
static/**/*.js
static/*.js
static/**/*.js.LICENSE.txt

View file

@ -15,3 +15,13 @@ npx webpack-cli
3. Click on "Load a temporary module"
4. Select Fanzine's `manifest.json` file on your file system
5. Click "Refresh" if your modification does not appear automatically
## Vim plugin
For vim > 8.x
```bash
git clone https://github.com/rescript-lang/vim-rescript ~/.vim/pack/all/start/vim-rescript
```
https://github.com/rescript-lang/vim-rescript

17
package-lock.json generated
View file

@ -1750,6 +1750,15 @@
"object-assign": "^4.1.1"
}
},
"react-dom": {
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.0.0.tgz",
"integrity": "sha512-XqX7uzmFo0pUceWFCt7Gff6IyIMzFUn7QMZrbrQfGxtaxXZIcGQzoNpRLE3fQLnS4XzLLPMZX2T9TRcSrasicw==",
"requires": {
"loose-envify": "^1.1.0",
"scheduler": "^0.21.0"
}
},
"rechoir": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
@ -1797,6 +1806,14 @@
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true
},
"scheduler": {
"version": "0.21.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz",
"integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==",
"requires": {
"loose-envify": "^1.1.0"
}
},
"schema-utils": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz",

View file

@ -7,7 +7,8 @@
"dependencies": {
"@aws-sdk/client-s3": "^3.58.0",
"@rescript/react": "^0.10.3",
"react": "^17.0.2"
"react": "^17.0.2",
"react-dom": "^18.0.0"
},
"devDependencies": {
"rescript": "^9.1.4",

View file

@ -1,6 +1,4 @@
@react.component
let make = () => {
<div>
{React.string("Hello ReScripters!")}
</div>
<Menu/>
}

13
src/Menu.res Normal file
View file

@ -0,0 +1,13 @@
@react.component
let make = () => {
<section className="menu">
<div className="menu-title">{ React.string("Publier sur mon espace web")}</div>
<a className="menu-elem" href="#plain-text">{ React.string("Texte brut")}</a>
<div className="menu-elem">{ React.string("Galerie photo")}</div>
<div className="menu-elem">{ React.string("Fichiers")}</div>
<hr/>
<div className="menu-elem">{ React.string("Site statique")}</div>
<hr/>
<div className="menu-elem">{ React.string(`Paramètres`)}</div>
</section>
}

0
src/ShareText.res Normal file
View file

View file

@ -11,14 +11,6 @@ body {
min-width: 300px;
}
/* Navigation logic */
section {
display: none;
}
section:target {
display: block;
}
/* Components definition */
a {
text-decoration: none;

View file

@ -6,10 +6,9 @@
</head>
<body>
<section id="home">
<!-- <section id="home">
<div class="menu-title">Publier sur mon espace web</div>
<a class="menu-elem" href="#plain-text">Texte brut</a>
<!--<div class="menu-elem">Brève</div>-->
<div class="menu-elem">Galerie photo</div>
<div class="menu-elem">Fichiers</div>
<hr>
@ -31,8 +30,10 @@
<section id="configure">
<div class="menu-title">Paramètres</div>
</section>
</section>-->
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="fanzine.js"></script>
</body>
</html>

View file

@ -7,6 +7,9 @@ export default {
entry: {
main: "./lib/es6/src/main.bs.js",
},
resolve: {
modules: [path.resolve(__dirname, 'node_modules'), 'node_modules']
},
mode: 'production',
output: {
filename: "fanzine.js",