-
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.
Merge pull request #4576 from coralproject/develop
v8.8.0
- Loading branch information
Showing
120 changed files
with
3,873 additions
and
541 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
client/src/core/client/admin/routes/Configure/sections/General/InPageNotificationsConfig.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,3 @@ | ||
.disabledLabel { | ||
color: var(--palette-grey-400); | ||
} |
82 changes: 82 additions & 0 deletions
82
client/src/core/client/admin/routes/Configure/sections/General/InPageNotificationsConfig.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,82 @@ | ||
import { Localized } from "@fluent/react/compat"; | ||
import React, { FunctionComponent } from "react"; | ||
import { FormSpy } from "react-final-form"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { | ||
FieldSet, | ||
FormField, | ||
FormFieldDescription, | ||
Label, | ||
} from "coral-ui/components/v2"; | ||
|
||
import ConfigBox from "../../ConfigBox"; | ||
import Header from "../../Header"; | ||
import OnOffField from "../../OnOffField"; | ||
|
||
import styles from "./InPageNotificationsConfig.css"; | ||
|
||
// eslint-disable-next-line no-unused-expressions | ||
graphql` | ||
fragment InPageNotificationsConfig_formValues on Settings { | ||
inPageNotifications { | ||
enabled | ||
floatingBellIndicator | ||
} | ||
} | ||
`; | ||
|
||
interface Props { | ||
disabled: boolean; | ||
} | ||
|
||
const InPageNotificationsConfig: FunctionComponent<Props> = ({ disabled }) => ( | ||
<ConfigBox | ||
title={ | ||
<Localized id="configure-general-inPageNotifications-title"> | ||
<Header container="h2">In-page notifications</Header> | ||
</Localized> | ||
} | ||
> | ||
<Localized id="configure-general-inPageNotifications-explanation"> | ||
<FormFieldDescription> | ||
Add notifications to Coral. When enabled, commenters can receive | ||
notifications when they receive all replies, replies only from members | ||
of your team, when a Pending comment is published. Commenters can | ||
disable visual notification indicators in their Profile preferences. | ||
This will remove e-mail notifications. | ||
</FormFieldDescription> | ||
</Localized> | ||
<FormField container={<FieldSet />}> | ||
<Localized id="configure-general-inPageNotifications-enabled"> | ||
<Label component="legend">In-page notifications enabled</Label> | ||
</Localized> | ||
<OnOffField name="inPageNotifications.enabled" disabled={disabled} /> | ||
</FormField> | ||
<FormSpy subscription={{ values: true }}> | ||
{(props) => { | ||
const inPageDisabled = !props.values.inPageNotifications?.enabled; | ||
return ( | ||
<FormField container={<FieldSet />}> | ||
<Localized id="configure-general-inPageNotifications-floatingBellIndicator"> | ||
<Label | ||
className={ | ||
disabled || inPageDisabled ? styles.disabledLabel : "" | ||
} | ||
component="legend" | ||
> | ||
Floating bell indicator | ||
</Label> | ||
</Localized> | ||
<OnOffField | ||
name="inPageNotifications.floatingBellIndicator" | ||
disabled={disabled || inPageDisabled} | ||
/> | ||
</FormField> | ||
); | ||
}} | ||
</FormSpy> | ||
</ConfigBox> | ||
); | ||
|
||
export default InPageNotificationsConfig; |
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
Oops, something went wrong.