From e6dbd5fbdc12539ccb8129b5bd3122ee35ce12af Mon Sep 17 00:00:00 2001 From: Ashish Dhama Date: Wed, 25 Aug 2021 00:11:49 +0530 Subject: [PATCH] [MM-37423] Custom Status: Don't show 'Custom Date and Time' for recent statuses (#5641) * Custom Status: Don't show 'Custom Date and Time' for recent statuses * move status boolean out of jsx --- app/screens/custom_status/custom_status_suggestion.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/screens/custom_status/custom_status_suggestion.tsx b/app/screens/custom_status/custom_status_suggestion.tsx index a10d213f8..1fcafb8fe 100644 --- a/app/screens/custom_status/custom_status_suggestion.tsx +++ b/app/screens/custom_status/custom_status_suggestion.tsx @@ -40,6 +40,10 @@ const CustomStatusSuggestion = ({handleSuggestionClick, emoji, text, theme, sepa } }, []); + const showCustomStatus = Boolean(duration && + duration !== CustomStatusDuration.DATE_AND_TIME && + isExpirySupported); + const clearButton = handleClear && expires_at ? ( @@ -74,7 +78,7 @@ const CustomStatusSuggestion = ({handleSuggestionClick, emoji, text, theme, sepa textStyle={style.customStatusText} /> - {Boolean(duration && isExpirySupported) && ( + {showCustomStatus && (