-
Notifications
You must be signed in to change notification settings - Fork 356
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 #4571 from coralproject/feat/CORL-3012-new-comment…
…er-badge [CORL-3012]: New commenter badge
- Loading branch information
Showing
20 changed files
with
267 additions
and
0 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
58 changes: 58 additions & 0 deletions
58
client/src/core/client/admin/routes/Configure/sections/General/NewCommenterConfig.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,58 @@ | ||
import { Localized } from "@fluent/react/compat"; | ||
import React, { FunctionComponent } from "react"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { PlantIcon, SvgIcon } from "coral-ui/components/icons"; | ||
import { | ||
FieldSet, | ||
FormField, | ||
FormFieldDescription, | ||
Label, | ||
} from "coral-ui/components/v2"; | ||
|
||
import ConfigBox from "../../ConfigBox"; | ||
import Header from "../../Header"; | ||
import OnOffField from "../../OnOffField"; | ||
|
||
// eslint-disable-next-line no-unused-expressions | ||
graphql` | ||
fragment NewCommenterConfig_formValues on Settings { | ||
newCommenter { | ||
enabled | ||
} | ||
} | ||
`; | ||
|
||
interface Props { | ||
disabled: boolean; | ||
} | ||
|
||
const NewCommenterConfig: FunctionComponent<Props> = ({ disabled }) => ( | ||
<ConfigBox | ||
title={ | ||
<Localized id="configure-general-newCommenter-title"> | ||
<Header container="h2">New commenter</Header> | ||
</Localized> | ||
} | ||
> | ||
<FormFieldDescription> | ||
<Localized | ||
id="configure-general-newCommenter-explanation" | ||
elems={{ icon: <SvgIcon Icon={PlantIcon} /> }} | ||
> | ||
<span> | ||
Add <SvgIcon Icon={PlantIcon} /> badge to commenters who created their | ||
accounts in the past seven days. | ||
</span> | ||
</Localized> | ||
</FormFieldDescription> | ||
<FormField container={<FieldSet />}> | ||
<Localized id="configure-general-newCommenter-enabled"> | ||
<Label component="legend">New commenter</Label> | ||
</Localized> | ||
<OnOffField name="newCommenter.enabled" disabled={disabled} /> | ||
</FormField> | ||
</ConfigBox> | ||
); | ||
|
||
export default NewCommenterConfig; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { FunctionComponent } from "react"; | ||
|
||
const PlantIcon: FunctionComponent = () => { | ||
// https://www.streamlinehq.com/icons/streamline-bold/nature-farming/plants/plant | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> | ||
<g id="Plant--Streamline-Ultimate"> | ||
<path | ||
d="M10.87 7.85v0.6a0.51 0.51 0 0 0 0.2 0.41 6.81 6.81 0 0 1 2.74 4.61 0.48 0.48 0 0 0 0.26 0.38 0.47 0.47 0 0 0 0.46 0 5.84 5.84 0 0 0 3.17 -5.18 0.5 0.5 0 0 0 -0.5 -0.5 5.82 5.82 0 0 0 -3.92 1.51 0.23 0.23 0 0 1 -0.26 0 0.24 0.24 0 0 1 -0.15 -0.23V7.86a1 1 0 0 1 0.13 -0.54 5.79 5.79 0 0 0 -0.8 -7.17 0.5 0.5 0 0 0 -0.71 0 5.79 5.79 0 0 0 -0.8 7.17 1 1 0 0 1 0.18 0.53Z" | ||
fill="currentcolor" | ||
></path> | ||
<path | ||
d="M12.87 16.78v-2.41A5.85 5.85 0 0 0 7 8.53a0.51 0.51 0 0 0 -0.5 0.5 5.84 5.84 0 0 0 3.7 5.43 1 1 0 0 1 0.64 0.93v2.33a0.26 0.26 0 0 1 -0.16 0.23 0.25 0.25 0 0 1 -0.27 -0.05 7.66 7.66 0 0 0 -5.51 -2.33 0.75 0.75 0 0 0 -0.75 0.75 7.69 7.69 0 0 0 5.59 7.39 0.48 0.48 0 0 0 0.42 -0.08 0.47 0.47 0 0 0 0.19 -0.38 8.67 8.67 0 0 1 2.23 -5.8 1 1 0 0 0 0.29 -0.67Z" | ||
fill="currentcolor" | ||
></path> | ||
<path | ||
d="M19.07 15.57a7.69 7.69 0 0 0 -7.69 7.68 0.75 0.75 0 0 0 0.75 0.75 7.7 7.7 0 0 0 7.69 -7.68 0.75 0.75 0 0 0 -0.75 -0.75Z" | ||
fill="currentcolor" | ||
></path> | ||
</g> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default PlantIcon; |
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.