diff --git a/src/routes/api/auth/index.js b/src/routes/api/auth/index.js index ccf6a79..9c5f47d 100644 --- a/src/routes/api/auth/index.js +++ b/src/routes/api/auth/index.js @@ -25,7 +25,7 @@ import change_mail from './change_mail'; // eslint-disable-next-line camelcase import restore_password from './restore_password'; -import getHtml from '../../../ssr-components/RedirectionPage'; +import getHtml from '../../../ssr/RedirectionPage'; import getMe from '../../../core/me'; diff --git a/src/routes/api/auth/verify.js b/src/routes/api/auth/verify.js index 32bf47e..0339b4b 100644 --- a/src/routes/api/auth/verify.js +++ b/src/routes/api/auth/verify.js @@ -3,7 +3,7 @@ */ import socketEvents from '../../../socket/SocketEvents'; -import getHtml from '../../../ssr-components/RedirectionPage'; +import getHtml from '../../../ssr/RedirectionPage'; import { getHostFromRequest } from '../../../utils/ip'; import mailProvider from '../../../core/mail'; diff --git a/src/routes/index.js b/src/routes/index.js index 3477380..67628eb 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -17,8 +17,8 @@ import api from './api'; import assets from './assets.json'; // eslint-disable-line import/no-unresolved import { expressTTag } from '../core/ttag'; -import generateGlobePage from '../ssr-components/Globe'; -import generateMainPage from '../ssr-components/Main'; +import generateGlobePage from '../ssr/Globe'; +import generateMainPage from '../ssr/Main'; import { MONTH } from '../core/constants'; import { GUILDED_INVITE } from '../core/config'; diff --git a/src/routes/reset_password.js b/src/routes/reset_password.js index a63e51d..6c61e17 100644 --- a/src/routes/reset_password.js +++ b/src/routes/reset_password.js @@ -9,7 +9,7 @@ import express from 'express'; import type { Request, Response } from 'express'; import logger from '../core/logger'; -import getPasswordResetHtml from '../ssr-components/PasswordReset'; +import getPasswordResetHtml from '../ssr/PasswordReset'; import mailProvider from '../core/mail'; import { RegUser } from '../data/sql'; diff --git a/src/ssr-components/Globe.jsx b/src/ssr-components/Globe.jsx deleted file mode 100644 index 53222b0..0000000 --- a/src/ssr-components/Globe.jsx +++ /dev/null @@ -1,62 +0,0 @@ -/* - * react html for 3D globe page - * - * @flow - */ - -import React from 'react'; -import ReactDOM from 'react-dom/server'; - -import { getTTag } from '../core/ttag'; - -import Html from './Html'; -/* this will be set by webpack */ -// eslint-disable-next-line import/no-unresolved -import assets from './assets.json'; -import { ASSET_SERVER } from '../core/config'; - -import globeCss from '../styles/globe.css'; - -const styles = [{ - id: 'globe', - cssText: globeCss, -}]; - -const defaultScripts = assets.globe.js.map( - (s) => ASSET_SERVER + s, -); - -/* - * generates string with html of globe page - * @param lang language code - * @return html of mainpage - */ -function generateGlobePage(lang: string): string { - const scripts = (assets[`globe-${lang}`]) - ? assets[`globe-${lang}`].js.map((s) => ASSET_SERVER + s) - : defaultScripts; - - const { t } = getTTag(lang); - const Globe = () => ( -
} - styles={styles} - />, - ); - - return `${html}`; -} - -export default generateGlobePage; diff --git a/src/ssr-components/Html.jsx b/src/ssr-components/Html.jsx deleted file mode 100644 index ca8a8b6..0000000 --- a/src/ssr-components/Html.jsx +++ /dev/null @@ -1,70 +0,0 @@ -/* @flow */ -/** - * React Starter Kit (https://www.reactstarterkit.com/) - * - * Copyright © 2014-present Kriasoft, LLC. All rights reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE.txt file in the root directory of this source tree. - */ - -/* eslint-disable max-len */ - -import React from 'react'; - -const Html = ({ - title, - description, - body, - // array of css stylesheet urls - css, - // array of script urls - scripts, - // style as string - styles, - // code as string - code, -}) => ( - -
- - - - -
- - - - - {styles && styles.map((style) => ( - - ))} - {code && ( - - )} - {css && css.map((stylesheet) => ( - - ))} - -