-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Added Site.topStories edge * feat: Added User.ongoingDiscussions edge * connect discussions tab to relay * style discussions tab * add message if no ongoing discussions * style site name in story row * fix: make line-heights relative * add custom class hooks * feat: condition display based on feature flag * add target attribute to story links * fix: expose some featureFlags * fix: fixed sorting * fix: copy fixes Co-authored-by: tessalt <tessathornton@gmail.com> Co-authored-by: Chi Vinh Le <vinh@vinh.tech>
- Loading branch information
1 parent
9a9c92d
commit dfdea2b
Showing
25 changed files
with
886 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
src/core/client/stream/tabs/Discussions/DiscussionsContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { Localized } from "@fluent/react/compat"; | ||
import React, { FunctionComponent, useCallback } from "react"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { | ||
createMutation, | ||
useMutation, | ||
withFragmentContainer, | ||
} from "coral-framework/lib/relay"; | ||
import CLASSES from "coral-stream/classes"; | ||
import UserBoxContainer from "coral-stream/common/UserBox"; | ||
import { Button, HorizontalGutter } from "coral-ui/components/v2"; | ||
|
||
import { DiscussionsContainer_settings } from "coral-stream/__generated__/DiscussionsContainer_settings.graphql"; | ||
import { DiscussionsContainer_story } from "coral-stream/__generated__/DiscussionsContainer_story.graphql"; | ||
import { DiscussionsContainer_viewer } from "coral-stream/__generated__/DiscussionsContainer_viewer.graphql"; | ||
|
||
import { commit } from "../../App/SetActiveTabMutation"; | ||
import MostActiveDiscussionsContainer from "./MostActiveDiscussionsContainer"; | ||
import MyOngoingDiscussionsContainer from "./MyOngoingDiscussionsContainer"; | ||
|
||
interface Props { | ||
viewer: DiscussionsContainer_viewer; | ||
settings: DiscussionsContainer_settings; | ||
story: DiscussionsContainer_story; | ||
} | ||
|
||
const SetActiveTabMutation = createMutation("setActiveTab", commit); | ||
|
||
const DiscussionsContainer: FunctionComponent<Props> = (props) => { | ||
const setActiveTab = useMutation(SetActiveTabMutation); | ||
const onFullHistoryClick = useCallback( | ||
async () => await setActiveTab({ tab: "PROFILE" }), | ||
[] | ||
); | ||
return ( | ||
<HorizontalGutter spacing={3} className={CLASSES.discussions.$root}> | ||
<UserBoxContainer settings={props.settings} viewer={props.viewer} /> | ||
<MostActiveDiscussionsContainer site={props.story.site} /> | ||
<MyOngoingDiscussionsContainer | ||
viewer={props.viewer} | ||
currentSiteID={props.story.site.id} | ||
settings={props.settings} | ||
/> | ||
<Localized id="discussions-viewFullHistory"> | ||
<Button | ||
variant="outline" | ||
color="stream" | ||
onClick={onFullHistoryClick} | ||
className={CLASSES.discussions.viewHistoryButton} | ||
> | ||
View full comment history | ||
</Button> | ||
</Localized> | ||
</HorizontalGutter> | ||
); | ||
}; | ||
|
||
const enhanced = withFragmentContainer<Props>({ | ||
story: graphql` | ||
fragment DiscussionsContainer_story on Story { | ||
site { | ||
id | ||
...MostActiveDiscussionsContainer_site | ||
} | ||
} | ||
`, | ||
viewer: graphql` | ||
fragment DiscussionsContainer_viewer on User { | ||
...MyOngoingDiscussionsContainer_viewer | ||
...UserBoxContainer_viewer | ||
} | ||
`, | ||
settings: graphql` | ||
fragment DiscussionsContainer_settings on Settings { | ||
...MyOngoingDiscussionsContainer_settings | ||
...UserBoxContainer_settings | ||
organization { | ||
name | ||
} | ||
} | ||
`, | ||
})(DiscussionsContainer); | ||
|
||
export default enhanced; |
19 changes: 19 additions & 0 deletions
19
src/core/client/stream/tabs/Discussions/DiscussionsHeader.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.root { | ||
border-bottom: 2px solid var(--palette-grey-200); | ||
padding-bottom: var(--spacing-2); | ||
font-family: var(--font-family-primary); | ||
} | ||
|
||
.header { | ||
font-weight: var(--font-weight-primary-bold); | ||
font-size: var(--font-size-4); | ||
line-height: 1; | ||
color: var(--palette-text-900); | ||
margin: 0; | ||
} | ||
|
||
.subHeader { | ||
color: var(--palette-text-100); | ||
font-size: var(--font-size-2); | ||
line-height: 1.285; | ||
} |
Oops, something went wrong.