mirror of
https://github.com/wassname/talk.git
synced 2026-07-20 12:40:47 +08:00
Improve styling, accessebility, usability and use mutation
This commit is contained in:
+4
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user