diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-08-24 11:53:47 +0200 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2017-09-12 11:34:49 +0200 |
commit | 404d315b077c84da3c31b0c0f4dde852d918c8d1 (patch) | |
tree | 176840ffdfb472a469848539dfbb803372c94b93 /server/sonar-web/src/main/js/components/icons-components/BranchIcon.tsx | |
parent | 9f5272cac177f024354dd72da2cda2160c5440af (diff) | |
download | sonarqube-404d315b077c84da3c31b0c0f4dde852d918c8d1.tar.gz sonarqube-404d315b077c84da3c31b0c0f4dde852d918c8d1.zip |
SONAR-9736 Build UI for long-living branches (#2390)
Diffstat (limited to 'server/sonar-web/src/main/js/components/icons-components/BranchIcon.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/components/icons-components/BranchIcon.tsx | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/js/components/icons-components/BranchIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/BranchIcon.tsx index 420d94ebd6a..a1b1a363b3d 100644 --- a/server/sonar-web/src/main/js/components/icons-components/BranchIcon.tsx +++ b/server/sonar-web/src/main/js/components/icons-components/BranchIcon.tsx @@ -18,28 +18,21 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import ShortLivingBranchIcon from './ShortLivingBranchIcon'; +import LongLivingBranchIcon from './LongLivingBranchIcon'; +// import PullRequestIcon from './PullRequestIcon'; +import { Branch } from '../../app/types'; +import { isShortLivingBranch } from '../../helpers/branches'; interface Props { + branch: Branch; className?: string; color?: string; size?: number; } -export default function BranchIcon({ className, color = '#4b9fd5', size = 14 }: Props) { - /* eslint-disable max-len */ - return ( - <svg - xmlns="http://www.w3.org/2000/svg" - className={className} - height={size} - width={size} - viewBox="0 0 16 16"> - <g transform="matrix(0.0416667,0,0,0.0416667,2.98284,-1.32102)"> - <path - d="M72,368C72,361.333 69.667,355.667 65,351C60.333,346.333 54.667,344 48,344C41.333,344 35.667,346.333 31,351C26.333,355.667 24,361.333 24,368C24,374.667 26.333,380.333 31,385C35.667,389.667 41.333,392 48,392C54.667,392 60.333,389.667 65,385C69.667,380.333 72,374.667 72,368ZM72,80C72,73.333 69.667,67.667 65,63C60.333,58.333 54.667,56 48,56C41.333,56 35.667,58.333 31,63C26.333,67.667 24,73.333 24,80C24,86.667 26.333,92.333 31,97C35.667,101.667 41.333,104 48,104C54.667,104 60.333,101.667 65,97C69.667,92.333 72,86.667 72,80ZM232,112C232,105.333 229.667,99.667 225,95C220.333,90.333 214.667,88 208,88C201.333,88 195.667,90.333 191,95C186.333,99.667 184,105.333 184,112C184,118.667 186.333,124.333 191,129C195.667,133.667 201.333,136 208,136C214.667,136 220.333,133.667 225,129C229.667,124.333 232,118.667 232,112ZM256,112C256,120.667 253.833,128.708 249.5,136.125C245.167,143.542 239.333,149.333 232,153.5C231.667,201.333 212.833,235.833 175.5,257C164.167,263.333 147.25,270.083 124.75,277.25C103.417,283.917 89.292,289.833 82.375,295C75.458,300.167 72,308.5 72,320L72,326.5C79.333,330.667 85.167,336.458 89.5,343.875C93.833,351.292 96,359.333 96,368C96,381.333 91.333,392.667 82,402C72.667,411.333 61.333,416 48,416C34.667,416 23.333,411.333 14,402C4.667,392.667 0,381.333 0,368C0,359.333 2.167,351.292 6.5,343.875C10.833,336.458 16.667,330.667 24,326.5L24,121.5C16.667,117.333 10.833,111.542 6.5,104.125C2.167,96.708 0,88.667 0,80C0,66.667 4.667,55.333 14,46C23.333,36.667 34.667,32 48,32C61.333,32 72.667,36.667 82,46C91.333,55.333 96,66.667 96,80C96,88.667 93.833,96.708 89.5,104.125C85.167,111.542 79.333,117.333 72,121.5L72,245.75C81,241.417 93.833,236.667 110.5,231.5C119.667,228.667 126.958,226.208 132.375,224.125C137.792,222.042 143.667,219.458 150,216.375C156.333,213.292 161.25,210 164.75,206.5C168.25,203 171.625,198.75 174.875,193.75C178.125,188.75 180.458,182.958 181.875,176.375C183.292,169.792 184,162.167 184,153.5C176.667,149.333 170.833,143.542 166.5,136.125C162.167,128.708 160,120.667 160,112C160,98.667 164.667,87.333 174,78C183.333,68.667 194.667,64 208,64C221.333,64 232.667,68.667 242,78C251.333,87.333 256,98.667 256,112Z" - style={{ fill: color, fillRule: 'nonzero' }} - /> - </g> - </svg> - ); +export default function BranchIcon({ branch, ...props }: Props) { + return isShortLivingBranch(branch) + ? <ShortLivingBranchIcon {...props} /> + : <LongLivingBranchIcon {...props} />; } |