From 3b4176574c9cff5c0c3c6e4e806fbc5fc1afd5b1 Mon Sep 17 00:00:00 2001 From: 7PH Date: Wed, 24 May 2023 11:46:00 +0200 Subject: [PATCH] [NO-JIRA] Fix layout project nav height value & Remove magic numbers --- server/sonar-web/design-system/src/helpers/constants.ts | 2 +- .../js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx | 4 ++-- .../js/apps/security-hotspots/components/HotspotHeader.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/design-system/src/helpers/constants.ts b/server/sonar-web/design-system/src/helpers/constants.ts index 4dd84f2c2cf..9b40d9577f9 100644 --- a/server/sonar-web/design-system/src/helpers/constants.ts +++ b/server/sonar-web/design-system/src/helpers/constants.ts @@ -60,7 +60,7 @@ export const LAYOUT_BANNER_HEIGHT = 44; export const LAYOUT_BRANDING_ICON_WIDTH = 198; export const LAYOUT_FILTERBAR_HEADER = 56; export const LAYOUT_GLOBAL_NAV_HEIGHT = 52; -export const LAYOUT_PROJECT_NAV_HEIGHT = 110; +export const LAYOUT_PROJECT_NAV_HEIGHT = 108; export const LAYOUT_LOGO_MARGIN_RIGHT = 45; export const LAYOUT_LOGO_MAX_HEIGHT = 40; export const LAYOUT_LOGO_MAX_WIDTH = 150; diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx index 7dbc385acad..2950a28090e 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsAppRenderer.tsx @@ -141,7 +141,7 @@ export default function SecurityHotspotsAppRenderer(props: SecurityHotspotsAppRe className="sw-p-4 it__hotspot-list" style={{ top: `${ - LAYOUT_GLOBAL_NAV_HEIGHT + LAYOUT_PROJECT_NAV_HEIGHT + STICKY_HEADER_HEIGHT - 2 + LAYOUT_GLOBAL_NAV_HEIGHT + LAYOUT_PROJECT_NAV_HEIGHT + STICKY_HEADER_HEIGHT }px`, height: `calc( 100vh - ${ @@ -249,7 +249,7 @@ const StyledSidebarHeader = withTheme(styled.div` border-bottom: ${themeBorder('default')}; z-index: 1; height: ${STICKY_HEADER_HEIGHT}px; - top: ${LAYOUT_GLOBAL_NAV_HEIGHT + LAYOUT_PROJECT_NAV_HEIGHT - 2}px; + top: ${LAYOUT_GLOBAL_NAV_HEIGHT + LAYOUT_PROJECT_NAV_HEIGHT}px; `); const StyledMain = styled.main` diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx index 7b8094d136d..b8d331c8263 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeader.tsx @@ -140,5 +140,5 @@ export function HotspotHeader(props: HotspotHeaderProps) { const Header = withTheme(styled.div` background-color: ${themeColor('pageBlock')}; box-shadow: ${({ isScrolled }: StyledHeaderProps) => (isScrolled ? themeShadow('sm') : 'none')}; - top: ${LAYOUT_GLOBAL_NAV_HEIGHT + LAYOUT_PROJECT_NAV_HEIGHT - 2}px; + top: ${LAYOUT_GLOBAL_NAV_HEIGHT + LAYOUT_PROJECT_NAV_HEIGHT}px; `); -- 2.39.5