Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CORL-1327] allow configuration of admin and moderator comment tags (#…
…3156) * allow configuration of admin and moderator comment tags * update schema based on feedback * add missing default value * update fixtures * change label to staffLabel * add resolver for staff config * update snap * remove redundant code Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
bcf6c9d
commit 1c3d631
Showing
18 changed files
with
413 additions
and
82 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
8 changes: 8 additions & 0 deletions
8
src/core/client/stream/tabs/Comments/Comment/StaffTagContainer.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,8 @@ | ||
.icon { | ||
margin-right: var(--spacing-1); | ||
} | ||
|
||
.tag { | ||
margin-right: var(--spacing-1); | ||
font-weight: var(--font-weight-primary-bold); | ||
} |
57 changes: 57 additions & 0 deletions
57
src/core/client/stream/tabs/Comments/Comment/StaffTagContainer.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,57 @@ | ||
import cn from "classnames"; | ||
import React, { FunctionComponent } from "react"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { withFragmentContainer } from "coral-framework/lib/relay"; | ||
import { GQLTAG_RL } from "coral-framework/schema"; | ||
import { Tag } from "coral-ui/components/v2"; | ||
|
||
import { StaffTagContainer_settings } from "coral-stream/__generated__/StaffTagContainer_settings.graphql"; | ||
|
||
import styles from "./StaffTagContainer.css"; | ||
|
||
interface Props { | ||
settings: StaffTagContainer_settings; | ||
tags: GQLTAG_RL[]; | ||
className?: string; | ||
} | ||
|
||
const StaffTagContainer: FunctionComponent<Props> = ({ | ||
settings, | ||
tags, | ||
className, | ||
}) => { | ||
return ( | ||
<> | ||
{tags.includes("ADMIN") && ( | ||
<Tag className={cn(className, styles.tag)}> | ||
{settings.staff.adminLabel} | ||
</Tag> | ||
)} | ||
{tags.includes("MODERATOR") && ( | ||
<Tag className={cn(className, styles.tag)}> | ||
{settings.staff.moderatorLabel} | ||
</Tag> | ||
)} | ||
{tags.includes("STAFF") && ( | ||
<Tag className={cn(className, styles.tag)}> | ||
{settings.staff.staffLabel} | ||
</Tag> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
const enhanced = withFragmentContainer<Props>({ | ||
settings: graphql` | ||
fragment StaffTagContainer_settings on Settings { | ||
staff { | ||
staffLabel | ||
adminLabel | ||
moderatorLabel | ||
} | ||
} | ||
`, | ||
})(StaffTagContainer); | ||
|
||
export default enhanced; |
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.