joyent-portal/ui/src/components/avatar
Alex Windett 8c147e4127 Avatar Component
- Creating Avatar component and adding to showcase
- Creating a composer file and adding class to vertically align content centrally
2016-10-28 11:25:29 +01:00
..
index.js Avatar Component 2016-10-28 11:25:29 +01:00
readme.md Avatar Component 2016-10-28 11:25:29 +01:00
style.css Avatar Component 2016-10-28 11:25:29 +01:00

<Avatar>

demo

const React = require('react');
const ReactDOM = require('react-dom/server');
const Base = require('../base');
const Container = require('../container');
const Row = require('../row');
const Column = require('../column');
const Avatar = require('./index.js');
const styles = require('./style.css');

nmodule.exports = ReactDOM.renderToString(
  <Base>
    <Row>
      <Column>
        <Avatar name='Alex' />
      </Column>
      <Column>
        <Avatar name='Alex' image='https://openclipart.org/image/2400px/svg_to_png/177482/ProfilePlaceholderSuit.png' />
      </Column>
    </Row>
  </Base>
);

usage

const React = require('react');
const Avatar = require('ui/avatar');

module.exports = () => {
  return (
    <Avatar name='Alex' />
    <Avatar name='Alex' image='path/to/image.png' />
  );
}