From 73734c10c1c84ae2bca73513385ae260897462ea Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Fri, 30 Sep 2016 19:58:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=B4=D0=B5=D0=BB=D1=8F=D0=B5?= =?UTF-8?q?=D0=BC=20=D1=88=D0=B0=D0=BF=D0=BA=D1=83=20=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D1=8C=D0=BC=D0=B0=20=D0=B2=20=D0=BE=D1=82=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/header/Header.jsx | 28 ++++++++++++++++++ .../header/background.jpg} | Bin src/components/header/index.js | 1 + src/components/header/messages.intl.json | 3 ++ src/components/header/styles.js | 16 ++++++++++ src/emails/register/Register.jsx | 18 ++++------- src/emails/register/messages.intl.json | 1 - src/emails/register/styles.js | 15 ---------- 8 files changed, 54 insertions(+), 28 deletions(-) create mode 100644 src/components/header/Header.jsx rename src/{emails/register/images/headerBackground.jpg => components/header/background.jpg} (100%) create mode 100644 src/components/header/index.js create mode 100644 src/components/header/messages.intl.json create mode 100644 src/components/header/styles.js diff --git a/src/components/header/Header.jsx b/src/components/header/Header.jsx new file mode 100644 index 0000000..d4fcb59 --- /dev/null +++ b/src/components/header/Header.jsx @@ -0,0 +1,28 @@ +import { Table } from 'components/table'; +import { FormattedMessage as Message } from 'react-intl'; +import { PropTypes } from 'react'; + +import styles from './styles'; + +import messages from './messages.intl.json'; + +export default function Userbar({username, title}) { + return ( + + + + +
+
+ +
+ + {title} +
+ ); +} + +Userbar.propTypes = { + username: PropTypes.string, + title: PropTypes.node +}; diff --git a/src/emails/register/images/headerBackground.jpg b/src/components/header/background.jpg similarity index 100% rename from src/emails/register/images/headerBackground.jpg rename to src/components/header/background.jpg diff --git a/src/components/header/index.js b/src/components/header/index.js new file mode 100644 index 0000000..d8cde81 --- /dev/null +++ b/src/components/header/index.js @@ -0,0 +1 @@ +export Header from './Header'; diff --git a/src/components/header/messages.intl.json b/src/components/header/messages.intl.json new file mode 100644 index 0000000..16cb4ee --- /dev/null +++ b/src/components/header/messages.intl.json @@ -0,0 +1,3 @@ +{ + "hello_username": "Hello, {username}" +} diff --git a/src/components/header/styles.js b/src/components/header/styles.js new file mode 100644 index 0000000..05eb370 --- /dev/null +++ b/src/components/header/styles.js @@ -0,0 +1,16 @@ +import background from './background.jpg'; + +export default { + headerImage: { + height: '200px', + backgroundImage: `url(${background})` + }, + headerTextContainer: { + color: '#fff', + textAlign: 'center', + verticalAlign: 'middle' + }, + welcomeUsername: { + fontSize: '20px' + }, +}; diff --git a/src/emails/register/Register.jsx b/src/emails/register/Register.jsx index 2415b0e..a3c5c39 100644 --- a/src/emails/register/Register.jsx +++ b/src/emails/register/Register.jsx @@ -4,6 +4,7 @@ import { FormattedMessage as Message } from 'react-intl'; import { Userbar } from 'components/userbar'; import { Table } from 'components/table'; +import { Header } from 'components/header'; import { Button } from 'components/button'; import { Input } from 'components/input'; import { BitmapText } from 'components/text'; @@ -19,19 +20,12 @@ export default function Register({username, link, code}) { return (
- - - - -
-
- -
- -
+
+ } />
diff --git a/src/emails/register/messages.intl.json b/src/emails/register/messages.intl.json index 8105f3f..362c689 100644 --- a/src/emails/register/messages.intl.json +++ b/src/emails/register/messages.intl.json @@ -1,5 +1,4 @@ { - "hello_username": "Hello, {username}", "welcome_image": "Welcome to Ely.by", "we_glad_to_see_you": "We glad to see you among the users of Ely.by. You almost reached the final point, it remains only to confirm your E-mail address.For doing it, please push a button under the text.", "confirm_email_image": "Confirm E‑mail", diff --git a/src/emails/register/styles.js b/src/emails/register/styles.js index 5dd3ab7..b0da64b 100644 --- a/src/emails/register/styles.js +++ b/src/emails/register/styles.js @@ -1,19 +1,4 @@ -import background from './images/headerBackground.jpg'; - export default { - headerImage: { - height: '200px', - backgroundImage: `url(${background})` - }, - headerTextContainer: { - color: '#fff', - textAlign: 'center', - verticalAlign: 'middle' - }, - welcomeUsername: { - fontSize: '20px' - }, - content: { background: '#fff', padding: '50px',