|
| 1 | +import * as React from 'react' |
| 2 | +import PropTypes from 'prop-types' |
| 3 | +import styles from './Icons.module.css' |
| 4 | +import { COLORS_ICON, SIZES, SMALL, MEDIUM, LARGE, MAIN_DARK_BLUE } from '../constants' |
| 5 | + |
| 6 | +const RouteHistoryIcon = ({ |
| 7 | + color = MAIN_DARK_BLUE, |
| 8 | + size = MEDIUM, |
| 9 | + disabled = false, |
| 10 | + inactive = false |
| 11 | +}) => { |
| 12 | + let className = `${styles.svgClassName} ` + styles[`${color}`] |
| 13 | + if (disabled) { |
| 14 | + className += ` ${styles.iconDisabled}` |
| 15 | + } |
| 16 | + if (inactive) { |
| 17 | + className += ` ${styles.iconInactive}` |
| 18 | + } |
| 19 | + let icon = <></> |
| 20 | + |
| 21 | + switch (size) { |
| 22 | + case SMALL: |
| 23 | + icon = ( |
| 24 | + <svg |
| 25 | + width={16} |
| 26 | + height={16} |
| 27 | + viewBox='0 0 16 16' |
| 28 | + fill='none' |
| 29 | + xmlns='http://www.w3.org/2000/svg' |
| 30 | + className={className} |
| 31 | + > |
| 32 | + <rect x='6' y='7.33334' width='8' height='6.66667' rx='1' stroke='none' /> |
| 33 | + <path d='M6 9.33334H14' stroke='none' strokeLinecap='round' strokeLinejoin='round' /> |
| 34 | + <line x1='7.5' y1='8.16666' x2='7.5' y2='6.49999' stroke='none' strokeLinecap='round' /> |
| 35 | + <line x1='12.1665' y1='8.16666' x2='12.1665' y2='6.49999' stroke='none' strokeLinecap='round' /> |
| 36 | + <rect x='7.3335' y='10' width='1.33333' height='1.33333' rx='0.5' fill='none' /> |
| 37 | + <rect x='7.3335' y='12' width='1.33333' height='1.33333' rx='0.5' fill='none' /> |
| 38 | + <rect x='9.3335' y='10' width='1.33333' height='1.33333' rx='0.5' fill='none' /> |
| 39 | + <rect x='11.3335' y='10' width='1.33333' height='1.33333' rx='0.5' fill='none' /> |
| 40 | + <rect x='9.3335' y='12' width='1.33333' height='1.33333' rx='0.5' fill='none' /> |
| 41 | + <rect x='11.3335' y='12' width='1.33333' height='1.33333' rx='0.5' fill='none' /> |
| 42 | + <circle cx='3' cy='5' r='1' transform='rotate(90 3 5)' stroke='none' /> |
| 43 | + <circle cx='13' cy='3' r='1' transform='rotate(90 13 3)' stroke='none' /> |
| 44 | + <path d='M12 3L10 3L7.5 3C6.94772 3 6.5 3.44772 6.5 4V4C6.5 4.55228 6.05228 5 5.5 5L4 5' stroke='none' strokeLinecap='round' strokeLinejoin='round' /> |
| 45 | + <path d='M10 6.5V6.5C10 5.67157 9.32843 5 8.5 5L4.5 5M5 8L5 6C5 5.44771 4.55229 5 4 5V5' stroke='none' strokeLinecap='round' strokeLinejoin='round' /> |
| 46 | + </svg> |
| 47 | + ) |
| 48 | + break |
| 49 | + case MEDIUM: |
| 50 | + icon = ( |
| 51 | + <svg |
| 52 | + width={24} |
| 53 | + height={24} |
| 54 | + viewBox='0 0 24 24' |
| 55 | + fill='none' |
| 56 | + xmlns='http://www.w3.org/2000/svg' |
| 57 | + className={className} |
| 58 | + > |
| 59 | + <rect x='9' y='11' width='12' height='10' rx='1' stroke='none' strokeWidth={1.5} /> |
| 60 | + <path d='M9 14H21' stroke='none' strokeWidth={1.5} strokeLinecap='round' strokeLinejoin='round' /> |
| 61 | + <line x1='11.25' y1='12.25' x2='11.25' y2='9.75' stroke='none' strokeWidth={1.5} strokeLinecap='round' /> |
| 62 | + <line x1='18.25' y1='12.25' x2='18.25' y2='9.75' stroke='none' strokeWidth={1.5} strokeLinecap='round' /> |
| 63 | + <rect x='11' y='15' width='2' height='2' rx='0.5' fill='none' /> |
| 64 | + <rect x='11' y='18' width='2' height='2' rx='0.5' fill='none' /> |
| 65 | + <rect x='14' y='15' width='2' height='2' rx='0.5' fill='none' /> |
| 66 | + <rect x='17' y='15' width='2' height='2' rx='0.5' fill='none' /> |
| 67 | + <rect x='14' y='18' width='2' height='2' rx='0.5' fill='none' /> |
| 68 | + <rect x='17' y='18' width='2' height='2' rx='0.5' fill='none' /> |
| 69 | + <circle cx='4.5' cy='7.5' r='1.5' transform='rotate(90 4.5 7.5)' stroke='none' strokeWidth={1.5} /> |
| 70 | + <circle cx='19.5' cy='4.5' r='1.5' transform='rotate(90 19.5 4.5)' stroke='none' strokeWidth={1.5} /> |
| 71 | + <path d='M18 4.5L15 4.5L10.75 4.5C10.1977 4.5 9.75 4.94772 9.75 5.5L9.75 6.5C9.75 7.05228 9.30228 7.5 8.75 7.5L6 7.5' stroke='none' strokeWidth={1.5} strokeLinecap='round' strokeLinejoin='round' /> |
| 72 | + <path d='M15 9.75L15 9.5C15 8.39543 14.1046 7.5 13 7.5L6.75 7.5M7.5 12L7.5 9C7.5 8.17157 6.82843 7.49999 6 7.49999V7.49999' stroke='none' strokeWidth={1.5} strokeLinecap='round' strokeLinejoin='round' /> |
| 73 | + </svg> |
| 74 | + ) |
| 75 | + break |
| 76 | + case LARGE: |
| 77 | + icon = ( |
| 78 | + <svg |
| 79 | + width={40} |
| 80 | + height={40} |
| 81 | + viewBox='0 0 40 40' |
| 82 | + fill='none' |
| 83 | + xmlns='http://www.w3.org/2000/svg' |
| 84 | + className={className} |
| 85 | + > |
| 86 | + <rect x='15' y='18.3333' width='20' height='16.6667' rx='1' stroke='none' strokeWidth={2} /> |
| 87 | + <path d='M15 23.3333H35' stroke='none' strokeWidth={2} strokeLinecap='round' strokeLinejoin='round' /> |
| 88 | + <line x1='19' y1='20.6667' x2='19' y2='16' stroke='none' strokeWidth={2} strokeLinecap='round' /> |
| 89 | + <line x1='30.6665' y1='20.6667' x2='30.6665' y2='16' stroke='none' strokeWidth={2} strokeLinecap='round' /> |
| 90 | + <rect x='18.3335' y='25' width='3.33333' height='3.33333' rx='0.5' fill='none' /> |
| 91 | + <rect x='18.3335' y='30' width='3.33333' height='3.33333' rx='0.5' fill='none' /> |
| 92 | + <rect x='23.3335' y='25' width='3.33333' height='3.33333' rx='0.5' fill='none' /> |
| 93 | + <rect x='28.3335' y='25' width='3.33333' height='3.33333' rx='0.5' fill='none' /> |
| 94 | + <rect x='23.3335' y='30' width='3.33333' height='3.33333' rx='0.5' fill='none' /> |
| 95 | + <rect x='28.3335' y='30' width='3.33333' height='3.33333' rx='0.5' fill='none' /> |
| 96 | + <circle cx='7.5' cy='12.5' r='2.5' transform='rotate(90 7.5 12.5)' stroke='none' strokeWidth={2} /> |
| 97 | + <circle cx='32.5' cy='7.5' r='2.5' transform='rotate(90 32.5 7.5)' stroke='none' strokeWidth={2} /> |
| 98 | + <path d='M30 7.5L25 7.5L17.25 7.5C16.6977 7.5 16.25 7.94772 16.25 8.5L16.25 11.5C16.25 12.0523 15.8023 12.5 15.25 12.5L10 12.5' stroke='none' strokeWidth={2} strokeLinecap='round' strokeLinejoin='round' /> |
| 99 | + <path d='M25 16.25L25 14.5C25 13.3954 24.1046 12.5 23 12.5L11.25 12.5M12.5 20L12.5 14.5C12.5 13.3954 11.6046 12.5 10.5 12.5L10 12.5' stroke='none' strokeWidth={2} strokeLinecap='round' strokeLinejoin='round' /> |
| 100 | + </svg> |
| 101 | + ) |
| 102 | + break |
| 103 | + default: |
| 104 | + break |
| 105 | + } |
| 106 | + return icon |
| 107 | +} |
| 108 | + |
| 109 | +RouteHistoryIcon.propTypes = { |
| 110 | + /** |
| 111 | + * color of text, icon and borders |
| 112 | + */ |
| 113 | + color: PropTypes.oneOf(COLORS_ICON), |
| 114 | + /** |
| 115 | + * Size |
| 116 | + */ |
| 117 | + size: PropTypes.oneOf(SIZES), |
| 118 | + /** |
| 119 | + * disabled |
| 120 | + */ |
| 121 | + disabled: PropTypes.bool, |
| 122 | + /** |
| 123 | + * inactive |
| 124 | + */ |
| 125 | + inactive: PropTypes.bool |
| 126 | +} |
| 127 | + |
| 128 | +export default RouteHistoryIcon |
0 commit comments