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
@@ -1,9 +1,9 @@
import React, { StatelessComponent } from "react";
import { graphql } from "react-relay";
import { withLocalStateContainer } from "talk-framework/lib/relay";
import { AppQueryLocal as Local } from "talk-stream/__generated__/AppQueryLocal.graphql";
import { PermalinkButtonContainerLocal as Local } from "talk-stream/__generated__/PermalinkButtonContainerLocal.graphql";
import Permalink from "../components/Permalink/Permalink";
import PermalinkButton from "../components/PermalinkButton";
interface InnerProps {
local: Local;
@@ -15,13 +15,13 @@ export const PermalinkContainer: StatelessComponent<InnerProps> = ({
commentID,
}) => {
return local.assetURL ? (
<Permalink assetURL={local.assetURL} commentID={commentID} />
<PermalinkButton assetURL={local.assetURL} commentID={commentID} />
) : null;
};
const enhanced = withLocalStateContainer<Local>(
graphql`
fragment PermalinkContainerLocal on Local {
fragment PermalinkButtonContainerLocal on Local {
assetURL
}
`
@@ -10,7 +10,7 @@ import {
SetCommentIDMutation,
withSetCommentIDMutation,
} from "talk-stream/mutations";
import PermalinkView from "../components/Permalink/PermalinkView";
import PermalinkView from "../components/PermalinkView";
interface PermalinkViewContainerProps {
data: Data;
@@ -22,9 +22,7 @@ class PermalinkViewContainer extends React.Component<
PermalinkViewContainerProps
> {
private showAllComments = () => {
const { local } = this.props;
window.location.href = local.assetURL!;
// mutation
this.props.setCommentID({ id: null });
};
public render() {
const { data, local } = this.props;