Improve styling, accessebility, usability and use mutation

This commit is contained in:
Chi Vinh Le
2018-08-03 15:57:14 +02:00
parent d05508d574
commit 1376ed255b
21 changed files with 202 additions and 147 deletions
@@ -0,0 +1,62 @@
import React, { StatelessComponent } from "react";
import Logo from "talk-stream/components/Logo";
import { Button, Flex, Typography } from "talk-ui/components";
import CommentContainer from "../containers/CommentContainer";
import * as styles from "./PermalinkView.css";
export interface PermalinkViewProps {
comment: {} | null;
assetURL: string | null;
onShowAllComments: () => void;
}
const PermalinkView: StatelessComponent<PermalinkViewProps> = ({
assetURL,
comment,
onShowAllComments,
}) => {
if (comment) {
return (
<div className={styles.root}>
<Logo />
{assetURL && (
<Button
variant="outlined"
color="primary"
onClick={onShowAllComments}
fullWidth
>
Show all Comments
</Button>
)}
<Flex direction="column" className={styles.comment}>
<CommentContainer data={comment} />
</Flex>
</div>
);
}
return (
<div className={styles.root}>
<Logo />
<Typography className={styles.commentNotFound}>
Comment not found
</Typography>
{assetURL && (
<Button
variant="filled"
color="primary"
onClick={() => {
window.location.href = assetURL;
}}
>
Show all Comments
</Button>
)}
</div>
);
};
export default PermalinkView;