From d1e4a21204c298d000a0c5346349e0e6d3c5b620 Mon Sep 17 00:00:00 2001
From: Aigamo <51428094+ycanardeau@users.noreply.github.com>
Date: Thu, 6 May 2021 23:05:06 +1000
Subject: [PATCH] Create ReactController
---
VocaDbWeb/Controllers/ReactController.cs | 12 +++++++
VocaDbWeb/Scripts/App.tsx | 9 +++++
VocaDbWeb/Scripts/i18n.ts | 21 ++++++++++++
VocaDbWeb/Scripts/index.tsx | 13 +++++++
VocaDbWeb/Startup.cs | 2 ++
VocaDbWeb/Views/React/Index.cshtml | 43 ++++++++++++++++++++++++
VocaDbWeb/tsconfig.json | 1 +
VocaDbWeb/webpack.mix.js | 6 +++-
8 files changed, 106 insertions(+), 1 deletion(-)
create mode 100644 VocaDbWeb/Controllers/ReactController.cs
create mode 100644 VocaDbWeb/Scripts/App.tsx
create mode 100644 VocaDbWeb/Scripts/i18n.ts
create mode 100644 VocaDbWeb/Scripts/index.tsx
create mode 100644 VocaDbWeb/Views/React/Index.cshtml
diff --git a/VocaDbWeb/Controllers/ReactController.cs b/VocaDbWeb/Controllers/ReactController.cs
new file mode 100644
index 0000000000..8ae74c7ec9
--- /dev/null
+++ b/VocaDbWeb/Controllers/ReactController.cs
@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Mvc;
+
+namespace VocaDb.Web.Controllers
+{
+ public class ReactController : Controller
+ {
+ public IActionResult Index()
+ {
+ return View();
+ }
+ }
+}
diff --git a/VocaDbWeb/Scripts/App.tsx b/VocaDbWeb/Scripts/App.tsx
new file mode 100644
index 0000000000..cb716661e7
--- /dev/null
+++ b/VocaDbWeb/Scripts/App.tsx
@@ -0,0 +1,9 @@
+import React from 'react';
+
+import './i18n';
+
+const App = (): React.ReactElement => {
+ return <>>;
+};
+
+export default App;
diff --git a/VocaDbWeb/Scripts/i18n.ts b/VocaDbWeb/Scripts/i18n.ts
new file mode 100644
index 0000000000..6e9987eee9
--- /dev/null
+++ b/VocaDbWeb/Scripts/i18n.ts
@@ -0,0 +1,21 @@
+import i18n from 'i18next';
+import LanguageDetector from 'i18next-browser-languagedetector';
+import Backend from 'i18next-http-backend';
+import { initReactI18next } from 'react-i18next';
+
+i18n
+ .use(Backend)
+ .use(LanguageDetector)
+ .use(initReactI18next)
+ .init({
+ load: 'languageOnly',
+ fallbackLng: 'en',
+
+ interpolation: {
+ escapeValue: false,
+ },
+
+ react: {
+ useSuspense: false,
+ },
+ });
diff --git a/VocaDbWeb/Scripts/index.tsx b/VocaDbWeb/Scripts/index.tsx
new file mode 100644
index 0000000000..30b5d776ad
--- /dev/null
+++ b/VocaDbWeb/Scripts/index.tsx
@@ -0,0 +1,13 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+
+import App from './App';
+
+const app = document.getElementById('app');
+
+ReactDOM.render(
+