Example1.jsx 690 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
import React from 'react';
import translate from './translate-context.jsx';

function Example1(props) {
  return (
    <div className="container">
      <h1>{props.strings.administrate}</h1>
      <div className="users">
        <h2>{props.strings.users}</h2>
        <p>User1</p>
        <p>User2</p>
      </div>
      <div className="posts">
        <h2>{props.strings.posts}</h2>
        <p>Post1</p>
        <p>Post2</p>
      </div>
    </div>
  )
}

Example1.propTypes = {
  strings: PropTypes.object,
};

Example1.defaultProps = {
  strings: {
    administrate: 'Administrar',
    users: 'Usuarios',
    posts: 'Artículos',
  },
};

export default translate('Example1')(Example1);