From 7b171a97ac7fa7263fac114b00dbceb1d340ae4c Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 22 Jun 2020 18:10:02 -0500 Subject: [PATCH] Move RegistrationPage to react-rails --- app/javascript/components/RegistrationPage.tsx | 11 +++++++++++ .../legacy_react/app/registration_page.tsx | 16 ---------------- app/javascript/packs/registration_page.js | 4 ---- app/views/onboard/index.html.erb | 5 ++--- 4 files changed, 13 insertions(+), 23 deletions(-) create mode 100644 app/javascript/components/RegistrationPage.tsx delete mode 100644 app/javascript/legacy_react/app/registration_page.tsx delete mode 100644 app/javascript/packs/registration_page.js diff --git a/app/javascript/components/RegistrationPage.tsx b/app/javascript/components/RegistrationPage.tsx new file mode 100644 index 00000000..34012061 --- /dev/null +++ b/app/javascript/components/RegistrationPage.tsx @@ -0,0 +1,11 @@ +import React from "react" +require('bootstrap-loader'); +import Root from "../legacy_react/src/components/common/Root" +import RegPage from "../legacy_react/src/components/registration_page/RegistrationPage" + + +function RegistrationPage(props:{}){ + return () +} + +export default RegistrationPage diff --git a/app/javascript/legacy_react/app/registration_page.tsx b/app/javascript/legacy_react/app/registration_page.tsx deleted file mode 100644 index 93f47b3c..00000000 --- a/app/javascript/legacy_react/app/registration_page.tsx +++ /dev/null @@ -1,16 +0,0 @@ -// License: LGPL-3.0-or-later - -// require a root component here. This will be treated as the root of a webpack package -import Root from "../src/components/common/Root" -import RegistrationPage from "../src/components/registration_page/RegistrationPage" - -import * as ReactDOM from 'react-dom' -import * as React from 'react' - -function LoadReactPage(element:HTMLElement) { - ReactDOM.render(, element) -} - - -(window as any).LoadReactPage = LoadReactPage - diff --git a/app/javascript/packs/registration_page.js b/app/javascript/packs/registration_page.js deleted file mode 100644 index 7c93fb67..00000000 --- a/app/javascript/packs/registration_page.js +++ /dev/null @@ -1,4 +0,0 @@ -// License: LGPL-3.0-or-later -require('bootstrap-loader'); -require('../legacy_react/app/registration_page') - diff --git a/app/views/onboard/index.html.erb b/app/views/onboard/index.html.erb index 5b81d798..6fe2e3b9 100644 --- a/app/views/onboard/index.html.erb +++ b/app/views/onboard/index.html.erb @@ -1,8 +1,7 @@ <% content_for :title, t("registration.get_started.header") %> <% content_for :javascripts do %> - <%= javascript_pack_tag 'loading_indicator', 'i18n', 'registration_page' %> + <%= javascript_pack_tag 'loading_indicator', 'i18n', 'application' %> <% end %> -
+<%= react_component('RegistrationPage', {}) %> - \ No newline at end of file