-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial work to add rejection reasons
- Loading branch information
Showing
4 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
client/src/core/client/admin/components/ModerateCard/DecisionDetailsContainer.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,15 @@ | ||
.wrapper { | ||
background-color: var(--palette-grey-200); | ||
font-family: var(--font-family-primary); | ||
} | ||
|
||
.full { | ||
width: 100%; | ||
} | ||
|
||
.label { | ||
font-size: var(--font-size-1); | ||
font-weight: var(--font-weight-primary-semi-bold); | ||
text-transform: uppercase; | ||
color: var(--palette-grey-500); | ||
} |
64 changes: 64 additions & 0 deletions
64
client/src/core/client/admin/components/ModerateCard/DecisionDetailsContainer.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,64 @@ | ||
// import { Localized } from "@fluent/react/compat"; | ||
import React, { FunctionComponent } from "react"; | ||
import { graphql } from "react-relay"; | ||
|
||
import { withFragmentContainer } from "coral-framework/lib/relay"; | ||
import { Flex, HorizontalGutter } from "coral-ui/components/v2"; | ||
|
||
import { DecisionDetailsContainer_comment } from "coral-admin/__generated__/DecisionDetailsContainer_comment.graphql"; | ||
|
||
import styles from "./DecisionDetailsContainer.css"; | ||
|
||
interface Props { | ||
comment: DecisionDetailsContainer_comment; | ||
} | ||
|
||
const DecisionDetailsContainer: FunctionComponent<Props> = ({ comment }) => { | ||
const statusHistory = comment.statusHistory.edges[0].node; | ||
return ( | ||
<HorizontalGutter className={styles.wrapper} padding={2}> | ||
<Flex> | ||
<Flex direction="column" className={styles.full}> | ||
<div className={styles.label}>Decision</div> | ||
<div>Rejected</div> | ||
</Flex> | ||
<Flex direction="column" className={styles.full}> | ||
<div className={styles.label}>Reason</div> | ||
<div>{statusHistory.rejectionReason?.code}</div> | ||
</Flex> | ||
</Flex> | ||
{statusHistory.rejectionReason?.detailedExplanation && ( | ||
<Flex direction="column"> | ||
<div className={styles.label}>Detailed explanation</div> | ||
<div>{statusHistory.rejectionReason?.detailedExplanation}</div> | ||
</Flex> | ||
)} | ||
<Flex> | ||
<div className={styles.label}>{statusHistory.createdAt}</div> | ||
</Flex> | ||
</HorizontalGutter> | ||
); | ||
}; | ||
|
||
const enhanced = withFragmentContainer<Props>({ | ||
comment: graphql` | ||
fragment DecisionDetailsContainer_comment on Comment { | ||
id | ||
statusHistory(first: 1) { | ||
edges { | ||
node { | ||
createdAt | ||
status | ||
rejectionReason { | ||
code | ||
legalGrounds | ||
detailedExplanation | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`, | ||
})(DecisionDetailsContainer); | ||
|
||
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