From fd954bf05b64a7db7922d344f588bfec0336464a Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 30 Mar 2022 15:49:07 +0200 Subject: [PATCH] Start integrating react views --- .gitignore | 1 + README.md | 10 ++++++++++ package-lock.json | 17 +++++++++++++++++ package.json | 3 ++- src/App.res | 4 +--- src/Menu.res | 13 +++++++++++++ src/ShareText.res | 0 static/popup/fanzine.css | 8 -------- static/popup/fanzine.html | 7 ++++--- webpack.config.js | 3 +++ 10 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 src/Menu.res create mode 100644 src/ShareText.res diff --git a/.gitignore b/.gitignore index 9ee9de0..8d49a59 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ src/*.bs.js src/**/*.bs.js static/**/*.js static/*.js +static/**/*.js.LICENSE.txt diff --git a/README.md b/README.md index ceba27b..2272d14 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package-lock.json b/package-lock.json index dce4464..f202345 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 64104cd..cc00112 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/App.res b/src/App.res index 46d756c..c1ff925 100644 --- a/src/App.res +++ b/src/App.res @@ -1,6 +1,4 @@ @react.component let make = () => { -
- {React.string("Hello ReScripters!")} -
+ } diff --git a/src/Menu.res b/src/Menu.res new file mode 100644 index 0000000..308f5f2 --- /dev/null +++ b/src/Menu.res @@ -0,0 +1,13 @@ +@react.component +let make = () => { +
+
{ React.string("Publier sur mon espace web")}
+ { React.string("Texte brut")} +
{ React.string("Galerie photo")}
+
{ React.string("Fichiers")}
+
+
{ React.string("Site statique")}
+
+
{ React.string(`Paramètres`)}
+
+} diff --git a/src/ShareText.res b/src/ShareText.res new file mode 100644 index 0000000..e69de29 diff --git a/static/popup/fanzine.css b/static/popup/fanzine.css index e850212..d6ef6c4 100644 --- a/static/popup/fanzine.css +++ b/static/popup/fanzine.css @@ -11,14 +11,6 @@ body { min-width: 300px; } -/* Navigation logic */ -section { - display: none; -} -section:target { - display: block; -} - /* Components definition */ a { text-decoration: none; diff --git a/static/popup/fanzine.html b/static/popup/fanzine.html index c22c4fa..044fa3f 100644 --- a/static/popup/fanzine.html +++ b/static/popup/fanzine.html @@ -6,10 +6,9 @@ -
+
@@ -31,8 +30,10 @@
-
+
--> + +
diff --git a/webpack.config.js b/webpack.config.js index 5ad3252..67dc0e3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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",