aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/ui/Alert.tsx
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2021-09-07 15:44:58 +0200
committersonartech <sonartech@sonarsource.com>2021-09-13 20:03:33 +0000
commit52b02379a6f0485c9efd4bc59f05752a9cc0ed20 (patch)
treeef97e8231b6526c8edcaa71c46b51429b3a111eb /server/sonar-web/src/main/js/components/ui/Alert.tsx
parent86f2c502104fbc03eb5aac19598e9b5c2e7290b8 (diff)
downloadsonarqube-52b02379a6f0485c9efd4bc59f05752a9cc0ed20.tar.gz
sonarqube-52b02379a6f0485c9efd4bc59f05752a9cc0ed20.zip
Fix multiple Code Smells
Diffstat (limited to 'server/sonar-web/src/main/js/components/ui/Alert.tsx')
-rw-r--r--server/sonar-web/src/main/js/components/ui/Alert.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/components/ui/Alert.tsx b/server/sonar-web/src/main/js/components/ui/Alert.tsx
index 2a63bad32ad..0a86b415a9c 100644
--- a/server/sonar-web/src/main/js/components/ui/Alert.tsx
+++ b/server/sonar-web/src/main/js/components/ui/Alert.tsx
@@ -44,12 +44,15 @@ interface AlertVariantInformation {
backGroundColor: string;
}
+const DOUBLE = 2;
+const QUADRUPLE = 4;
+
const StyledAlertIcon = styled.div<{ isBanner: boolean; variantInfo: AlertVariantInformation }>`
flex: 0 0 auto;
display: flex;
justify-content: center;
align-items: center;
- width: calc(${({ isBanner }) => (isBanner ? 2 : 4)} * ${sizes.gridSize});
+ width: calc(${({ isBanner }) => (isBanner ? DOUBLE : QUADRUPLE)} * ${sizes.gridSize});
border-right: ${({ isBanner }) => (!isBanner ? '1px solid' : 'none')};
border-color: ${({ variantInfo }) => variantInfo.borderColor};
`;