From bdcc99b53b56e46e38bdbe66ea763e533f805ec4 Mon Sep 17 00:00:00 2001 From: arunvjn <32433245+arunvjn@users.noreply.github.com> Date: Thu, 21 Apr 2022 18:44:10 +0530 Subject: [PATCH] chore: Hides update button when there are no pending updates. (#13152) --- .../editorComponents/Debugger/index.tsx | 1 - .../pages/Editor/BottomBar/ManualUpgrades.tsx | 50 +++++-------------- .../src/pages/Editor/BottomBar/index.tsx | 3 +- .../Editor/gitSync/QuickGitActions/index.tsx | 1 - 4 files changed, 14 insertions(+), 41 deletions(-) diff --git a/app/client/src/components/editorComponents/Debugger/index.tsx b/app/client/src/components/editorComponents/Debugger/index.tsx index 57e5bbede0..2d2f5e8805 100644 --- a/app/client/src/components/editorComponents/Debugger/index.tsx +++ b/app/client/src/components/editorComponents/Debugger/index.tsx @@ -42,7 +42,6 @@ const TriggerContainer = styled.div<{ overflow: visible; display: flex; align-items: center; - margin-right: ${(props) => props.theme.spaces[10]}px; .debugger-count { color: ${Colors.WHITE}; diff --git a/app/client/src/pages/Editor/BottomBar/ManualUpgrades.tsx b/app/client/src/pages/Editor/BottomBar/ManualUpgrades.tsx index db53713a02..ca82f6604f 100644 --- a/app/client/src/pages/Editor/BottomBar/ManualUpgrades.tsx +++ b/app/client/src/pages/Editor/BottomBar/ManualUpgrades.tsx @@ -24,21 +24,11 @@ import { selectURLSlugs, } from "selectors/editorSelectors"; import styled from "styled-components"; -import { useLocalStorage } from "utils/hooks/localstorage"; import { createMessage, CLEAN_URL_UPDATE } from "@appsmith/constants/messages"; import { useLocation } from "react-router"; import DisclaimerIcon from "remixicon-react/ErrorWarningLineIcon"; import AnalyticsUtil from "utils/AnalyticsUtil"; -function RedDot() { - return ( -
- ); -} - const StyledList = styled.ul` list-style: disc; margin-left: 16px; @@ -198,10 +188,6 @@ function UpdatesModal({ } function ManualUpgrades() { - const [updateDismissed, setUpdateDismissed] = useLocalStorage( - "updateDismissed", - "", - ); const applicationVersion = useSelector(selectApplicationVersion); const applicationId = useSelector(getCurrentApplicationId); const pageId = useSelector(getCurrentPageId); @@ -239,37 +225,26 @@ function ManualUpgrades() { ); const [showModal, setShowModal] = React.useState(false); - const defaultProps = - !updateDismissed && applicationVersion < latestVersion - ? { - isOpen: true, - } - : {}; + const tooltipContent = ( +
+ {`${latestVersion - applicationVersion} pending update(s)`} + +
+ ); - const tooltipContent = - applicationVersion < latestVersion ? ( -
- {`${latestVersion - applicationVersion} pending update(s)`} - -
- ) : ( - "No new updates" - ); + if (applicationVersion === latestVersion) return null; return ( -
- {applicationVersion < latestVersion && } +
{ - setUpdateDismissed("true"); setShowModal(applicationVersion < latestVersion); }} size={IconSize.XXXL} diff --git a/app/client/src/pages/Editor/BottomBar/index.tsx b/app/client/src/pages/Editor/BottomBar/index.tsx index ce34e5271b..80f8595ca6 100644 --- a/app/client/src/pages/Editor/BottomBar/index.tsx +++ b/app/client/src/pages/Editor/BottomBar/index.tsx @@ -14,13 +14,14 @@ const Container = styled.div` background-color: ${(props) => props.theme.colors.editorBottomBar.background}; z-index: ${Layers.bottomBar}; border-top: solid 1px ${Colors.MERCURY}; + padding: 0 ${(props) => props.theme.spaces[11]}px; `; export default function BottomBar(props: { className?: string }) { return ( -
+
diff --git a/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx b/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx index 635006981f..8b66891d2a 100644 --- a/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx +++ b/app/client/src/pages/Editor/gitSync/QuickGitActions/index.tsx @@ -203,7 +203,6 @@ const Container = styled.div` height: 100%; display: flex; align-items: center; - margin-left: ${(props) => props.theme.spaces[10]}px; `; const StyledIcon = styled(GitCommitLine)`