-
Notifications
You must be signed in to change notification settings - Fork 355
/
PreferencesContainer.tsx
44 lines (37 loc) · 1.51 KB
/
PreferencesContainer.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React, { FunctionComponent } from "react";
import { graphql } from "react-relay";
import { withFragmentContainer } from "coral-framework/lib/relay";
import { HorizontalGutter } from "coral-ui/components/v2";
import { PreferencesContainer_settings } from "coral-stream/__generated__/PreferencesContainer_settings.graphql";
import { PreferencesContainer_viewer } from "coral-stream/__generated__/PreferencesContainer_viewer.graphql";
import IgnoreUserSettingsContainer from "./IgnoreUserSettingsContainer";
import MediaSettingsContainer from "./MediaSettingsContainer";
import NotificationSettingsContainer from "./NotificationSettingsContainer";
interface Props {
viewer: PreferencesContainer_viewer;
settings: PreferencesContainer_settings;
}
const PreferencesContainer: FunctionComponent<Props> = (props) => {
return (
<HorizontalGutter spacing={4}>
<NotificationSettingsContainer viewer={props.viewer} />
<MediaSettingsContainer viewer={props.viewer} settings={props.settings} />
<IgnoreUserSettingsContainer viewer={props.viewer} />
</HorizontalGutter>
);
};
const enhanced = withFragmentContainer<Props>({
settings: graphql`
fragment PreferencesContainer_settings on Settings {
...MediaSettingsContainer_settings
}
`,
viewer: graphql`
fragment PreferencesContainer_viewer on User {
...NotificationSettingsContainer_viewer
...IgnoreUserSettingsContainer_viewer
...MediaSettingsContainer_viewer
}
`,
})(PreferencesContainer);
export default enhanced;