[CORL-260] Bring back sorting (#2186)

* feat: sort stream

* feat: add FieldSet component to ui

* feat: make accessible and add feature test

* test: fix snapshots
This commit is contained in:
Kiwi
2019-02-13 16:11:13 +00:00
committed by Wyatt Johnson
parent 68839c721c
commit f4037ce6fb
43 changed files with 1047 additions and 110 deletions
@@ -0,0 +1,31 @@
import { commitLocalUpdate, Environment } from "relay-runtime";
import { createMutationContainer, LOCAL_ID } from "talk-framework/lib/relay";
export interface SetStreamOrderByInput {
orderBy:
| "CREATED_AT_ASC"
| "CREATED_AT_DESC"
| "REPLIES_DESC"
| "RESPECT_DESC"
| "%future added value";
}
export type SetStreamOrderByMutation = (
input: SetStreamOrderByInput
) => Promise<void>;
export async function commit(
environment: Environment,
input: SetStreamOrderByInput
) {
return commitLocalUpdate(environment, store => {
const record = store.get(LOCAL_ID)!;
record.setValue(input.orderBy, "streamOrderBy");
});
}
export const withSetStreamOrderByMutation = createMutationContainer(
"setStreamOrderBy",
commit
);