Use anchor for better accessibility and restore history

This commit is contained in:
Chi Vinh Le
2018-08-07 17:37:02 +02:00
parent dff3e40005
commit 52b36e2db0
24 changed files with 264 additions and 115 deletions
@@ -27,29 +27,23 @@ export const render = ({
return <div>{error.message}</div>;
}
if (props) {
return (
<PermalinkViewContainer asset={props.asset} comment={props.comment} />
);
return <PermalinkViewContainer comment={props.comment} />;
}
return <div>Loading</div>;
};
const PermalinkViewQuery: StatelessComponent<InnerProps> = ({
local: { commentID, assetID },
local: { commentID },
}) => (
<QueryRenderer<PermalinkViewQueryVariables, PermalinkViewQueryResponse>
query={graphql`
query PermalinkViewQuery($assetID: ID!, $commentID: ID!) {
asset(id: $assetID) {
...PermalinkViewContainer_asset
}
query PermalinkViewQuery($commentID: ID!) {
comment(id: $commentID) {
...PermalinkViewContainer_comment
}
}
`}
variables={{
assetID,
commentID,
}}
render={render}
@@ -59,7 +53,6 @@ const PermalinkViewQuery: StatelessComponent<InnerProps> = ({
const enhanced = withLocalStateContainer<Local>(
graphql`
fragment PermalinkViewQueryLocal on Local {
assetID
commentID
}
`