Files
talk/src/core/client/stream/App/TabBarQuery.tsx
T
Wyatt JohnsonandGitHub 9d1f03115f [CORL-381] Featured Comments (#2335)
* feat: initial serverside featuring support

* Update schema.graphql

* feat: add feature comment to moderation dropdown

* feat: feature comments on the stream embed

* fix: tests

* fix: optimize loading and fix tests

* feat: hide featured tab when empty

* feat: introduced flattening

* fix: snapshots

* fix: spacing

* feat: added a dark variant to popover

* feat: add featured comments tooltip

* fix: better tests

* feat: added tag counts

* chore: changed string to enum

* fix: removed unused translation

* fix: changed schema for String -> TAG

* feat: split comments -> comments, featuredComments

* fix: adapt client to new endpoints

* feat: use featured comment counts

* test: featured count handling

* fix: snapshots and optimistically approve comment during feature

* fix: remove unnecessary assertion

* feat: approve featured comments

* fix: make optimistic update less reliant on existing data
2019-06-14 16:27:25 +00:00

55 lines
1.2 KiB
TypeScript

import {
graphql,
QueryRenderer,
withLocalStateContainer,
} from "coral-framework/lib/relay";
import React, { Component } from "react";
import { TabBarQuery as QueryTypes } from "coral-stream/__generated__/TabBarQuery.graphql";
import { TabBarQueryLocal as Local } from "coral-stream/__generated__/TabBarQueryLocal.graphql";
import TabBarContainer from "./TabBarContainer";
interface Props {
local: Local;
}
class TabBarQuery extends Component<Props> {
public render() {
const { storyID, storyURL } = this.props.local;
return (
<QueryRenderer<QueryTypes>
query={graphql`
query TabBarQuery {
viewer {
...TabBarContainer_viewer
}
}
`}
variables={{
storyID,
storyURL,
}}
render={({ error, props }) => {
if (error) {
return <div>{error.message}</div>;
}
return <TabBarContainer viewer={(props && props.viewer) || null} />;
}}
/>
);
}
}
const enhanced = withLocalStateContainer(
graphql`
fragment TabBarQueryLocal on Local {
storyID
storyURL
}
`
)(TabBarQuery);
export default enhanced;