This commit is contained in:
okbel
2018-07-09 18:57:41 -03:00
parent 7ee9f23542
commit 37fb9ece66
9 changed files with 27 additions and 53 deletions
@@ -9,11 +9,3 @@
.author {
font-weight: $font-weight-medium;
}
.shareButton {
padding: 10px 0;
}
.input {
margin-right: 5px;
}
@@ -28,7 +28,7 @@ const Comment: StatelessComponent<CommentProps> = props => {
</Typography>
<Typography>{props.body}</Typography>
<div className={cn("talk-comment-footer")}>
<PermalinkPopover />
<PermalinkPopover commentId={props.id} />
</div>
</div>
);
@@ -0,0 +1,13 @@
.shareButton {
composes: button from "talk-ui/shared/typography.css";
composes: buttonReset from "talk-ui/shared/buttonReset.css";
padding: 10px 0;
}
.textField {
margin-right: 5px;
}
.root {
background-color: #fff;
}
@@ -1,22 +1,27 @@
import React from "react";
import CopyToClipboard from "react-copy-to-clipboard";
import { Button, Input, Popover } from "talk-ui/components";
import { Button, Popover, TextField } from "talk-ui/components";
import * as styles from "./PermalinkPopover.css";
class PermalinkPopover extends React.Component {
interface InnerProps {
commentId: string;
}
class PermalinkPopover extends React.Component<InnerProps> {
public render() {
const props = this.props;
const { commentId } = this.props;
return (
<Popover
body={
<div>
<Input defaultValue={props.id} className={styles.input} />
<CopyToClipboard text={props.id}>
<div className={styles.root}>
<TextField defaultValue={commentId} className={styles.textField} />
<CopyToClipboard text={commentId}>
<Button primary>Copy</Button>
</CopyToClipboard>
</div>
}
>
<button>Reference element</button>
<button className={styles.shareButton}>Share</button>
</Popover>
);
}