From e7aac4c95f4422faf798cb5bfa245e9f73aeb5e1 Mon Sep 17 00:00:00 2001 From: kitce Date: Sat, 5 Nov 2022 23:14:16 +0800 Subject: [PATCH] fix(label-form): show screenshot toggle button only when the post is available --- src/components/LabelForm/LabelForm.tsx | 60 ++++++++++++++------------ 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/components/LabelForm/LabelForm.tsx b/src/components/LabelForm/LabelForm.tsx index 2d4217f..7787bdc 100644 --- a/src/components/LabelForm/LabelForm.tsx +++ b/src/components/LabelForm/LabelForm.tsx @@ -225,34 +225,38 @@ const LabelForm: React.FunctionComponent = (props) => { {/* screenshot */} -
- - {TEXTS.LABEL_FORM_FIELD_LABEL_SCREENSHOT} - - { - !screenshot.loading && !!screenshot.url && ( -
- { - - - - } -
- ) - } -
+ { + post && ( +
+ + {TEXTS.LABEL_FORM_FIELD_LABEL_SCREENSHOT} + + { + !screenshot.loading && !!screenshot.url && ( +
+ { + + + + } +
+ ) + } +
+ ) + } {/* image */} { label && !isScreenshotEnabled && (