Skip to content

Instantly share code, notes, and snippets.

@marcelmokos
Last active October 17, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelmokos/dd917778e11576915e7ffb32ab0e51e3 to your computer and use it in GitHub Desktop.
Save marcelmokos/dd917778e11576915e7ffb32ab0e51e3 to your computer and use it in GitHub Desktop.
Comment.js
import React from "react";
import styled from "react-emotion";
import { Flex, Box } from "grid-styled/emotion";
import Text from "./Text";
import Avatar from "./Avatar";
const Comment = ({ children, ...props }) => children(props);
Comment.defaultProps = {
Wrapper: props => <Flex flexDirection="row" mb={"1rem"} {...props} />,
Column: styled(Box)`
& + & {
margin-left: 0.25rem
}
`,
Header: styled("header")``,
Heading: styled("h3")`
display: inline;
`,
SubHeading: styled("h4")`
display: inline;
`,
Text,
Footer: styled("footer")``,
children: ({
Wrapper,
Column,
Main,
Header,
Heading,
SubHeading,
Text,
Footer,
}) => (
<Wrapper>
<Column>
<Avatar.Random />
</Column>
<Column>
<Header>
<Heading>Heading</Heading>
{` `}
<SubHeading>SubHeading</SubHeading>
</Header>
<Text>Text</Text>
<Footer>Footer</Footer>
</Column>
</Wrapper>
),
};
export default Comment;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment