mirror of
https://github.com/elyby/emails-renderer.git
synced 2024-11-06 00:03:07 +05:30
Проба пера по вёрстке письма о регистрации
This commit is contained in:
parent
b746a4967b
commit
0b35d908e8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
dist/*
|
||||
!dist/app.js
|
||||
.idea
|
||||
|
31
src/components/Html.jsx
Normal file
31
src/components/Html.jsx
Normal file
@ -0,0 +1,31 @@
|
||||
import styles from './styles';
|
||||
|
||||
import { Table } from './';
|
||||
|
||||
export default function Html(props) {
|
||||
return (
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta httpEquiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body style={{
|
||||
margin: 0
|
||||
}}>
|
||||
<Table style={styles.body}>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td style={styles.container}>
|
||||
{props.children}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</Table>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
9
src/components/index.js
Normal file
9
src/components/index.js
Normal file
@ -0,0 +1,9 @@
|
||||
import Html from './Html';
|
||||
import Table from './table/Table';
|
||||
import Userbar from './userbar/Userbar';
|
||||
|
||||
export {
|
||||
Html,
|
||||
Table,
|
||||
Userbar
|
||||
};
|
9
src/components/styles.jsx
Normal file
9
src/components/styles.jsx
Normal file
@ -0,0 +1,9 @@
|
||||
export default {
|
||||
body: {
|
||||
backgroundColor: '#EBE8E1',
|
||||
width: '100%'
|
||||
},
|
||||
container: {
|
||||
width: '600px'
|
||||
}
|
||||
}
|
14
src/components/table/Table.jsx
Normal file
14
src/components/table/Table.jsx
Normal file
@ -0,0 +1,14 @@
|
||||
import styles from './styles';
|
||||
|
||||
export default function Table(props) {
|
||||
return (
|
||||
<table cellPadding="0" cellSpacing="0" style={{
|
||||
...styles.table,
|
||||
...props.style
|
||||
}}>
|
||||
<tbody>
|
||||
{props.children}
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
8
src/components/table/styles.js
Normal file
8
src/components/table/styles.js
Normal file
@ -0,0 +1,8 @@
|
||||
export default {
|
||||
table: {
|
||||
borderCollapse: 'collapse',
|
||||
msoTableLspace: '0pt', // TODO: эта штука не отображается
|
||||
msoTableRspace: '0pt', // TODO: эта штука не отображается
|
||||
width: '100%'
|
||||
}
|
||||
}
|
26
src/components/userbar/Userbar.jsx
Normal file
26
src/components/userbar/Userbar.jsx
Normal file
@ -0,0 +1,26 @@
|
||||
import { Table } from './../';
|
||||
|
||||
import styles from './styles';
|
||||
|
||||
import logoImage from './logo.png';
|
||||
|
||||
export default function Userbar() {
|
||||
return (
|
||||
<Table style={styles.userbar}>
|
||||
<tr>
|
||||
<td style={styles.marginColumn}>
|
||||
</td>
|
||||
<td style={styles.logoColumn}>
|
||||
<div style={styles.logo}>
|
||||
{/* TODO: здесь нужно динамически сформировать название, т.к. может быть Ёly.by */}
|
||||
<img src={logoImage} style={{
|
||||
width: '65px',
|
||||
verticalAlign: 'middle'
|
||||
}} />
|
||||
</div>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</Table>
|
||||
);
|
||||
}
|
BIN
src/components/userbar/logo.png
Normal file
BIN
src/components/userbar/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
15
src/components/userbar/styles.js
Normal file
15
src/components/userbar/styles.js
Normal file
@ -0,0 +1,15 @@
|
||||
export default {
|
||||
userbar: {
|
||||
background: '#207E5C',
|
||||
height: '50px'
|
||||
},
|
||||
marginColumn: {
|
||||
width: '20px'
|
||||
},
|
||||
logoColumn: {
|
||||
background: '#1A6449',
|
||||
width: '1%',
|
||||
verticalAlign: 'middle',
|
||||
padding: '0 13px'
|
||||
}
|
||||
}
|
@ -2,14 +2,17 @@ import { PropTypes } from 'react';
|
||||
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
|
||||
import { Html, Userbar } from './../../components';
|
||||
|
||||
import styles from './styles';
|
||||
import messages from './messages.intl.json';
|
||||
|
||||
export default function Register({username}) {
|
||||
return (
|
||||
<div style={styles.container}>
|
||||
<Html>
|
||||
<Userbar />
|
||||
<Message {...messages.you_registered_as} values={{username}} />
|
||||
</div>
|
||||
</Html>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,2 @@
|
||||
export default {
|
||||
container: {
|
||||
padding: '10px',
|
||||
margin: '10px',
|
||||
background: '#f7f7f7',
|
||||
border: '1px #ddd solid',
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user