Skip to content

Commit

Permalink
update based on designs
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Nov 28, 2023
1 parent 64ac1dc commit d019c0d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.detailedExplanation {
margin-bottom: var(--spacing-3);
margin-bottom: var(--spacing-2);
}

.explanationLabel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ export interface Props {
explanationValue: string | null;
customReasonValue: string | null;
onBack: () => void;
linkClassName?: string;
}

const AddExplanationButton: FunctionComponent<{ onClick: () => void }> = ({
onClick,
}) => (
const AddExplanationButton: FunctionComponent<{
onClick: () => void;
linkClassName?: string;
}> = ({ onClick, linkClassName }) => (
<Localized id="common-moderationReason-addExplanation">
<Button
onClick={onClick}
className={commonStyles.optionAction}
variant="none"
color="success"
className={cn(linkClassName, commonStyles.optionAction)}
variant="flat"
color="primary"
underline
>
+ Add explanation
</Button>
Expand All @@ -43,15 +46,20 @@ const DetailedExplanation: FunctionComponent<Props> = ({
onBack,
customReasonValue,
onChangeCustomReason,
linkClassName,
}) => {
const [showAddExplanation, setShowAddExplanation] = useState(
!!(code === GQLREJECTION_REASON_CODE.OTHER)
);
const [showAddExplanation, setShowAddExplanation] = useState(false);

return (
<>
<Localized id="common-moderationReason-changeReason">
<Button className={styles.changeReason} variant="none" onClick={onBack}>
<Button
className={cn(linkClassName, styles.changeReason)}
variant="flat"
onClick={onBack}
color="primary"
underline
>
&lt; Change reason
</Button>
</Localized>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
.optionAction {
padding: 0;
margin: var(--spacing-1) 0;
color: $colors-teal-600;
font-weight: var(--font-weight-secondary-regular);
text-decoration: underline;
}

.rejectButton {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ export interface Props {
onCancel: () => void;
onReason: (reason: Reason) => void;
id: string;
linkClassName?: string;
}

const ModerationReason: FunctionComponent<Props> = ({
onCancel,
onReason,
id,
linkClassName,
}) => {
const [view, setView] = useState<"REASON" | "EXPLANATION">("REASON");
const [reasonCode, setReasonCode] = useState<ReasonCode | null>(null);
Expand Down Expand Up @@ -75,6 +77,7 @@ const ModerationReason: FunctionComponent<Props> = ({
onChangeExplanation={setDetailedExplanation}
customReasonValue={otherCustomReason}
onChangeCustomReason={setOtherCustomReason}
linkClassName={linkClassName}
/>
)}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.link {
color: var(--palette-primary-600);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import UserBanPopoverContainer from "../UserBanPopover/UserBanPopoverContainer";
import ModerationActionsContainer from "./ModerationActionsContainer";
import RejectCommentMutation from "./RejectCommentMutation";

import styles from "./ModerationDropdownContainer.css";

export type ModerationDropdownView =
| "MODERATE"
| "REJECT_REASON"
Expand Down Expand Up @@ -108,6 +110,7 @@ const ModerationDropdownContainer: FunctionComponent<Props> = ({
id={comment.id}
onReason={reject}
onCancel={onDismiss}
linkClassName={styles.link}
/>
) : (
<UserBanPopoverContainer
Expand Down

0 comments on commit d019c0d

Please sign in to comment.