Skip to content
Snippets Groups Projects
Unverified Commit 60d990ae authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

Hide redundant border in question details sidebar (#21999)

parent b891864f
Branches
Tags
No related merge requests found
......@@ -12,6 +12,7 @@ import {
if (hasPremiumFeature("content_management")) {
Object.assign(PLUGIN_MODERATION, {
isEnabled: () => true,
QuestionModerationSection,
ModerationStatusIcon,
getStatusIconForQuestion,
......
......@@ -103,6 +103,7 @@ export const PLUGIN_COLLECTION_COMPONENTS = {
};
export const PLUGIN_MODERATION = {
isEnabled: () => false,
QuestionModerationSection: PluginPlaceholder,
ModerationStatusIcon: PluginPlaceholder,
getStatusIconForQuestion: object,
......
......@@ -38,6 +38,9 @@ function QuestionDetailsSidebarPanel({
}
: undefined;
const hasSecondarySection =
(isDataset && canWrite) || (!isDataset && PLUGIN_MODERATION.isEnabled());
return (
<Container>
<SidebarPaddedContent>
......@@ -53,18 +56,20 @@ function QuestionDetailsSidebarPanel({
description={description}
onEdit={onDescriptionEdit}
/>
<BorderedSectionContainer>
{isDataset && canWrite && (
<DatasetManagementSection dataset={question} />
)}
{!isDataset && (
<ModerationSectionContainer>
<PLUGIN_MODERATION.QuestionModerationSection
question={question}
/>
</ModerationSectionContainer>
)}
</BorderedSectionContainer>
{hasSecondarySection && (
<BorderedSectionContainer>
{isDataset && canWrite && (
<DatasetManagementSection dataset={question} />
)}
{!isDataset && (
<ModerationSectionContainer>
<PLUGIN_MODERATION.QuestionModerationSection
question={question}
/>
</ModerationSectionContainer>
)}
</BorderedSectionContainer>
)}
</SidebarPaddedContent>
<QuestionActivityTimeline question={question} />
</Container>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment