diff --git a/src/App.jsx b/src/App.jsx index a8f7711..fda9798 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -14,6 +14,8 @@ addLocaleData(ukLocaleData); import { SUPPORTED_LANGUAGES, DEFAULT_LANGUAGE } from './constants'; +import BaseLayout from 'components/BaseLayout'; + export default function App({type, payload = {}}) { let {locale} = payload; @@ -26,7 +28,9 @@ export default function App({type, payload = {}}) { return ( - + + + ); } diff --git a/src/components/BaseLayout.jsx b/src/components/BaseLayout.jsx new file mode 100644 index 0000000..2a011ac --- /dev/null +++ b/src/components/BaseLayout.jsx @@ -0,0 +1,21 @@ +import styles from './styles'; + +import { Table } from 'components/table'; + +export default function BaseLayout(props) { + return ( + + + + + + +
+   + + {props.children} + +   +
+ ); +} diff --git a/src/components/Html.jsx b/src/components/Html.jsx index 252973d..6f53102 100644 --- a/src/components/Html.jsx +++ b/src/components/Html.jsx @@ -1,7 +1,3 @@ -import styles from './styles'; - -import { Table } from './'; - export default function Html(props) { return ( @@ -12,19 +8,7 @@ export default function Html(props) { - - - - - - -
-   - - {props.children} - -   -
+ {props.children} ); diff --git a/src/components/index.js b/src/components/index.js index 678d169..bdcccc3 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,9 +1,7 @@ import Html from './Html'; -import Table from './table/Table'; import Userbar from './userbar/Userbar'; export { Html, - Table, Userbar }; diff --git a/src/components/styles.jsx b/src/components/styles.js similarity index 97% rename from src/components/styles.jsx rename to src/components/styles.js index 4de8f52..2e20c56 100644 --- a/src/components/styles.jsx +++ b/src/components/styles.js @@ -6,4 +6,4 @@ export default { container: { width: '600px' } -} +}; diff --git a/src/components/table/index.js b/src/components/table/index.js new file mode 100644 index 0000000..0e9b375 --- /dev/null +++ b/src/components/table/index.js @@ -0,0 +1 @@ +export Table from './Table'; diff --git a/src/components/table/styles.js b/src/components/table/styles.js index 04df514..0835a2c 100644 --- a/src/components/table/styles.js +++ b/src/components/table/styles.js @@ -1,8 +1,8 @@ export default { table: { borderCollapse: 'collapse', - msoTableLspace: '0pt', // TODO: эта штука не отображается - msoTableRspace: '0pt', // TODO: эта штука не отображается + msoTableLspace: '0pt', + msoTableRspace: '0pt', width: '100%' } -} +}; diff --git a/src/components/userbar/Userbar.jsx b/src/components/userbar/Userbar.jsx index 0dbf2e7..94a0557 100644 --- a/src/components/userbar/Userbar.jsx +++ b/src/components/userbar/Userbar.jsx @@ -1,4 +1,4 @@ -import { Table } from './../'; +import { Table } from 'components/table'; import styles from './styles'; @@ -8,8 +8,7 @@ export default function Userbar() { return ( - +
-
{/* TODO: здесь нужно динамически сформировать название, т.к. может быть Ёly.by */} diff --git a/src/components/userbar/styles.js b/src/components/userbar/styles.js index 5257ac5..b5c3c77 100644 --- a/src/components/userbar/styles.js +++ b/src/components/userbar/styles.js @@ -12,4 +12,4 @@ export default { verticalAlign: 'middle', padding: '0 13px' } -} +}; diff --git a/src/emails/register/Register.jsx b/src/emails/register/Register.jsx index 150c03d..6556ea7 100644 --- a/src/emails/register/Register.jsx +++ b/src/emails/register/Register.jsx @@ -2,17 +2,17 @@ import { PropTypes } from 'react'; import { FormattedMessage as Message } from 'react-intl'; -import { Html, Userbar } from './../../components'; +import { Userbar } from 'components'; import styles from './styles'; import messages from './messages.intl.json'; export default function Register({username}) { return ( - +
- +
); } diff --git a/src/index.ejs b/src/index.ejs index a7f3821..3aca580 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -3,14 +3,13 @@ Ely.by - Email Renderer - - - + + <% if (htmlWebpackPlugin.files.favicon) { %> <% } %> - +
diff --git a/src/index.js b/src/index.js index 27872e4..78493e1 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,7 @@ import 'babel-polyfill'; +import { Html } from 'components'; + // NOTE: we are requiring with require(), to enable dynamic dependencies // depending on ENV, where App is running in. // This allows us better support of hmr and reduces bundle size @@ -20,7 +22,11 @@ if (process.env.NODE_ENV !== 'production') { module.exports = { default(props) { - return ReactDOMServer.renderToStaticMarkup(); + return ReactDOMServer.renderToStaticMarkup( + + + + ); } }; }