diff --git a/src/core/client/stream/components/App.tsx b/src/core/client/stream/components/App.tsx index 8e9dcc437..b45756b46 100644 --- a/src/core/client/stream/components/App.tsx +++ b/src/core/client/stream/components/App.tsx @@ -9,17 +9,23 @@ import { TabPane, } from "talk-ui/components"; +import { SetActiveTabMutation } from "talk-stream/mutations"; + import CommentsPaneContainer from "../tabs/comments/containers/CommentsPaneContainer"; import * as styles from "./App.css"; export interface AppProps { - activeTab: "COMMENTS" | "%future added value"; + activeTab: "COMMENTS" | "PROFILE" | "%future added value"; + setActiveTab: SetActiveTabMutation; } const App: StatelessComponent = props => { return ( - + props.setActiveTab({ tab })} + > Comments My Profile diff --git a/src/core/client/stream/containers/AppContainer.tsx b/src/core/client/stream/containers/AppContainer.tsx index 011a0bee8..f9c7d8e53 100644 --- a/src/core/client/stream/containers/AppContainer.tsx +++ b/src/core/client/stream/containers/AppContainer.tsx @@ -3,17 +3,23 @@ import { StatelessComponent } from "react"; import { graphql, withLocalStateContainer } from "talk-framework/lib/relay"; import { AppContainerLocal as Local } from "talk-stream/__generated__/AppContainerLocal.graphql"; +import { + SetActiveTabMutation, + withSetActiveTabMutation, +} from "talk-stream/mutations"; import App from "../components/App"; interface InnerProps { local: Local; + setActiveTab: SetActiveTabMutation; } const AppContainer: StatelessComponent = ({ local: { activeTab }, + setActiveTab, }) => { - return ; + return ; }; const enhanced = withLocalStateContainer( @@ -22,6 +28,6 @@ const enhanced = withLocalStateContainer( activeTab } ` -)(AppContainer); +)(withSetActiveTabMutation(AppContainer)); export default enhanced; diff --git a/src/core/client/stream/mutations/SetActiveTabMutation.ts b/src/core/client/stream/mutations/SetActiveTabMutation.ts index 8c930dd0c..8cffe9828 100644 --- a/src/core/client/stream/mutations/SetActiveTabMutation.ts +++ b/src/core/client/stream/mutations/SetActiveTabMutation.ts @@ -3,7 +3,7 @@ import { commitLocalUpdate, Environment } from "relay-runtime"; import { createMutationContainer, LOCAL_ID } from "talk-framework/lib/relay"; export interface SetActiveTabInput { - tab: "COMMENTS"; + tab: "COMMENTS" | "PROFILE" | string; } export type SetActiveTabMutation = (input: SetActiveTabInput) => Promise; diff --git a/src/core/client/stream/test/comments/__snapshots__/editComment.spec.tsx.snap b/src/core/client/stream/test/comments/__snapshots__/editComment.spec.tsx.snap index 6a91b49e0..89fa7f723 100644 --- a/src/core/client/stream/test/comments/__snapshots__/editComment.spec.tsx.snap +++ b/src/core/client/stream/test/comments/__snapshots__/editComment.spec.tsx.snap @@ -335,6 +335,407 @@ exports[`cancel edit: edit canceled 1`] = ` `; +exports[`cancel edit: server response 1`] = ` +
+
    + + +
+
+
+
+
+
+
+ Signed in as + + Markus + + . +
+
+ + Not you?  + + +
+
+
+
+
+
+ +
+
+
+ + + +
+ +
+
+
+
+
+
+ + Powered by + + ⁨The Coral Project⁩ + + +
+ +
+
+ +
+
+
+
+
+
+
+ + Markus + +
+ +
+ ( + + Edited + + ) +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + Lukas + +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+`; + exports[`edit a comment: edit form 1`] = `