Last active
March 31, 2017 06:58
-
-
Save tmeasday/746c1944a6056593262b13d9bdb89cc1 to your computer and use it in GitHub Desktop.
Embedded Styles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component, PropTypes } from 'react'; | |
| import styled from 'styled-components'; | |
| const AvatarDiv = styled.div` | |
| border-radius: 0.2px; | |
| border: 1px solid #eee; | |
| `; | |
| const BumpSpan = styled.span` | |
| position: relative; | |
| top: -10px; | |
| `; | |
| const Avatar = ({ name, avatar_url, onBump }) => ( | |
| <AvatarDiv> | |
| <img src={avatar_url} title={name} /> | |
| <BumpSpan class="image-action" onClick={onBump}>Bump</BumpSpan> | |
| </AvatarDiv> | |
| ); | |
| Avatar.propTypes = { | |
| name: PropTypes.string.isRequired, | |
| avatar_url: PropTypes.string.isRequired, | |
| onBump: PropTypes.func.isRequired, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment