|
| 1 | +import React from 'react'; |
| 2 | +import PT from 'prop-types'; |
| 3 | +import { Modal } from 'topcoder-react-ui-kit'; |
| 4 | +import { keys } from 'lodash'; |
| 5 | + |
| 6 | +import IconClose from 'assets/images/icon-close-green.svg'; |
| 7 | +import style from './styles.scss'; |
| 8 | + |
| 9 | +const skillCountStatement = (count) => { |
| 10 | + let statement = ''; |
| 11 | + switch (count) { |
| 12 | + case 0: |
| 13 | + statement = 'don’t have any skills'; |
| 14 | + break; |
| 15 | + case 1: |
| 16 | + statement = 'only have 1 skill'; |
| 17 | + break; |
| 18 | + default: |
| 19 | + statement = `only have ${count} skills`; |
| 20 | + } |
| 21 | + return statement; |
| 22 | +}; |
| 23 | + |
| 24 | +const SkillsNagModal = ({ |
| 25 | + handle, |
| 26 | + skills, |
| 27 | + onCancel, |
| 28 | + onCTA, |
| 29 | + MIN_SKILLS_TO_REMIND, |
| 30 | +}) => ( |
| 31 | + <Modal onCancel={onCancel} theme={style}> |
| 32 | + <div styleName="nagModal"> |
| 33 | + |
| 34 | + <div styleName="header"> |
| 35 | + <div styleName="title"> |
| 36 | + <span>UPDATE PROFILE SKILLS</span> |
| 37 | + </div> |
| 38 | + <div styleName="icon" role="presentation" onClick={onCancel}> |
| 39 | + <IconClose /> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | + |
| 43 | + <div styleName="description"> |
| 44 | + <div styleName="badgeWrap"> |
| 45 | + <svg |
| 46 | + xmlns="http://www.w3.org/2000/svg" |
| 47 | + width="70" |
| 48 | + height="75" |
| 49 | + fill="none" |
| 50 | + viewBox="0 0 70 75" |
| 51 | + > |
| 52 | + <path |
| 53 | + fill="url(#paint0_linear_439_23448)" |
| 54 | + d="M33.3 71.06l-28-15.468a3.477 3.477 0 01-1.8-3.042V21.845c0-1.264.69-2.429 1.8-3.043l28-15.467a3.518 3.518 0 013.4 0l28 15.467a3.477 3.477 0 011.8 3.043V52.55c0 1.264-.69 2.429-1.8 3.042l-28 15.468a3.518 3.518 0 01-3.4 0z" |
| 55 | + /> |
| 56 | + <mask |
| 57 | + id="mask0_439_23448" |
| 58 | + style={{ maskType: 'alpha' }} |
| 59 | + width="64" |
| 60 | + height="70" |
| 61 | + x="3" |
| 62 | + y="2" |
| 63 | + maskUnits="userSpaceOnUse" |
| 64 | + > |
| 65 | + <path |
| 66 | + fill="url(#paint1_linear_439_23448)" |
| 67 | + d="M33.3 71.06l-28-15.468a3.477 3.477 0 01-1.8-3.042V21.845c0-1.264.69-2.429 1.8-3.043l28-15.467a3.518 3.518 0 013.4 0l28 15.467a3.477 3.477 0 011.8 3.043V52.55c0 1.264-.69 2.429-1.8 3.042l-28 15.468a3.518 3.518 0 01-3.4 0z" |
| 68 | + /> |
| 69 | + </mask> |
| 70 | + <g mask="url(#mask0_439_23448)"> |
| 71 | + <path |
| 72 | + fill="#171717" |
| 73 | + d="M37.383 82.496l25.678-25.393-4.887.62 6.71-2.461 4.91-4.924-12.784 3.747 20.549-11.416 3.701-3.672c.406-.403 1.043-1.045 1.34-1.329L55.307 50.664l24.987-19.717-1.296-1.286-25.91 17.899 21.066-22.703-1.307-1.296L50.42 44.847 67.916 18.66l-1.285-1.275-19.264 25.208 14.08-30.35-1.274-1.263-16.189 29.86L54.176 5.03l-1.065-1.057-12.73 35.677 5.294-43.052-.812-.806-8.205 43.259-1.68-52.246a2.528 2.528 0 00-.406 0L32.88 39.052 24.654-4.24l-.813.817 5.316 43.074-12.74-35.71-1.098 1.09 10.247 35.807-16.2-29.903L8.092 12.2 22.194 42.58 2.809 17.44l-1.186 1.176L19.13 44.836l-22.45-21.33-1.295 1.275 21.032 22.79-25.865-17.997-1.252 1.242 24.898 19.848L-12.6 38.213l.857.85 3.8 3.769 20.428 11.253-12.806-3.682 4.92 4.87 6.71 2.461-4.887-.62 25.02 24.794c2.108 2.102 3.338 3.366 5.941.599v-.011z" |
| 74 | + opacity="0.4" |
| 75 | + /> |
| 76 | + <path |
| 77 | + fill="url(#paint2_linear_439_23448)" |
| 78 | + d="M34.614 53.975h-1.911c-.212-.023-.423-.053-.642-.076-2.939-.34-5.597-1.382-7.924-3.232-3.044-2.417-4.948-5.537-5.673-9.366-.113-.597-.173-1.208-.264-1.813v-1.91c.098-.688.143-1.383.302-2.047 1.534-6.435 5.514-10.491 11.942-12.077 1.096-.272 2.251-.287 3.384-.348.952-.053 1.911-.007 2.855-.007.446-2.644 1.927-4.102 4.14-4.102 2.213 0 3.694 1.458 4.14 4.11h4.146v4.146c2.462.105 3.988 1.979 4.087 3.935.09 1.82-1.201 4.116-4.102 4.313V38.498c0 2.349-.468 4.6-1.518 6.7-2.327 4.622-6.028 7.492-11.12 8.526-.61.121-1.23.182-1.85.272l.008-.022zm12.433-21.209c.536.19 1.012.37 1.496.529a1.967 1.967 0 002.167-.68c.567-.725.597-1.7.068-2.447-.52-.74-1.412-1.035-2.296-.748-.468.159-.937.333-1.443.514v-4.819h-4.781c.181-.498.347-.959.506-1.42a2.012 2.012 0 00-1.292-2.568 2.046 2.046 0 00-2.575 1.307c-.159.476-.114.936.06 1.405.159.415.31.838.476 1.306h-4.728v2.07c2.817.189 4.048 2.349 4.078 3.995.023 1.02-.28 1.934-.929 2.72-.808.989-1.88 1.472-3.15 1.525v2.055h4.676c-.181.498-.355.951-.498 1.42a2.048 2.048 0 002.032 2.666c1.352-.046 2.273-1.375 1.858-2.69-.144-.46-.318-.92-.499-1.42h4.766V32.76l.008.007zM34.674 51.852c6.61-.377 11.995-6.042 12.297-12.28h-2.024c-.106 2.439-1.956 3.972-3.935 4.078-1.836.09-4.124-1.216-4.306-4.078h-2.024v4.682c-.491-.173-.937-.34-1.39-.483-.861-.28-1.737-.015-2.266.672a2.04 2.04 0 00-.076 2.425 2.035 2.035 0 002.32.785c.46-.143.92-.317 1.42-.49v4.697l-.016-.008zm-2.04-14.365v-4.683c.545.181 1.05.385 1.572.521 1.042.272 2.107-.347 2.432-1.367a2.052 2.052 0 00-1.239-2.53c-.513-.196-1.027-.159-1.533.03-.4.151-.8.287-1.246.453v-4.743c-3.498.332-6.436 1.737-8.808 4.29-2.092 2.259-3.248 4.94-3.52 8.029h2.055c.159-2.644 2.122-3.965 3.867-4.071a4.002 4.002 0 012.75.838c1.057.816 1.563 1.919 1.631 3.24h2.04v-.007zm-.022 12.349c-2.817-.197-4.049-2.35-4.086-4.003-.023-1.02.28-1.934.929-2.72.808-.989 1.88-1.472 3.15-1.525v-2.054h-4.676c.181-.499.355-.96.498-1.42a2.052 2.052 0 00-2.001-2.666c-1.367.022-2.312 1.36-1.896 2.688.143.461.317.914.498 1.428h-4.713c.453 6.994 6.48 12.054 12.29 12.266v-2.002l.007.008z" |
| 79 | + /> |
| 80 | + </g> |
| 81 | + <path |
| 82 | + stroke="#E9E9E9" |
| 83 | + strokeWidth="7" |
| 84 | + d="M31.818 69.968h0a6.515 6.515 0 006.364 0h0l24.266-13.573s0 0 0 0A6.557 6.557 0 0065.8 50.67V23.724A6.557 6.557 0 0062.448 18s0 0 0 0L38.182 4.427h0a6.516 6.516 0 00-6.364 0h0L7.552 18s0 0 0 0A6.557 6.557 0 004.2 23.724V50.67a6.557 6.557 0 003.352 5.724s0 0 0 0l24.266 13.574z" |
| 85 | + /> |
| 86 | + <path |
| 87 | + stroke="url(#paint3_linear_439_23448)" |
| 88 | + strokeWidth="2" |
| 89 | + d="M11.07 51.717h0a1.918 1.918 0 01-.97-1.673V24.35c0-.7.375-1.34.97-1.674h0L34.092 9.736s0 0 0 0a1.848 1.848 0 011.816 0s0 0 0 0L58.93 22.677h0c.595.335.97.974.97 1.674v25.693c0 .7-.375 1.339-.97 1.673h0L35.908 64.66a1.848 1.848 0 01-1.816 0L11.07 51.717z" |
| 90 | + /> |
| 91 | + <defs> |
| 92 | + <linearGradient |
| 93 | + id="paint0_linear_439_23448" |
| 94 | + x1="4.168" |
| 95 | + x2="71.076" |
| 96 | + y1="70.762" |
| 97 | + y2="9.316" |
| 98 | + gradientUnits="userSpaceOnUse" |
| 99 | + > |
| 100 | + <stop stopColor="#574F47" /> |
| 101 | + <stop offset="1" stopColor="#292929" /> |
| 102 | + </linearGradient> |
| 103 | + <linearGradient |
| 104 | + id="paint1_linear_439_23448" |
| 105 | + x1="4.168" |
| 106 | + x2="71.076" |
| 107 | + y1="70.762" |
| 108 | + y2="9.316" |
| 109 | + gradientUnits="userSpaceOnUse" |
| 110 | + > |
| 111 | + <stop stopColor="#B9B6B4" /> |
| 112 | + <stop offset="1" stopColor="#ACACAB" /> |
| 113 | + </linearGradient> |
| 114 | + <linearGradient |
| 115 | + id="paint2_linear_439_23448" |
| 116 | + x1="53.2" |
| 117 | + x2="17.047" |
| 118 | + y1="28.318" |
| 119 | + y2="31.236" |
| 120 | + gradientUnits="userSpaceOnUse" |
| 121 | + > |
| 122 | + <stop stopColor="#FAFDFD" /> |
| 123 | + <stop offset="1" stopColor="#CBCBCB" /> |
| 124 | + </linearGradient> |
| 125 | + <linearGradient |
| 126 | + id="paint3_linear_439_23448" |
| 127 | + x1="63.889" |
| 128 | + x2="-0.98" |
| 129 | + y1="60.157" |
| 130 | + y2="30.683" |
| 131 | + gradientUnits="userSpaceOnUse" |
| 132 | + > |
| 133 | + <stop stopColor="#FEB914" /> |
| 134 | + <stop offset="1" stopColor="#FFE501" /> |
| 135 | + </linearGradient> |
| 136 | + </defs> |
| 137 | + </svg> |
| 138 | + </div> |
| 139 | + <span> |
| 140 | + {/* eslint-disable-next-line max-len */} |
| 141 | + Hey <strong>{handle}</strong>, we have noticed that you {skillCountStatement(keys(skills).length)} added to your profile. To be able to match you with the best opportunities at Topcoder, please add skills so that you have at least <span>{MIN_SKILLS_TO_REMIND} skills</span> listed in your profile. |
| 142 | + </span> |
| 143 | + </div> |
| 144 | + |
| 145 | + <div styleName="actionButtons"> |
| 146 | + <button type="button" styleName="primaryBtn" onClick={onCTA}> |
| 147 | + Update Your Skills |
| 148 | + </button> |
| 149 | + </div> |
| 150 | + |
| 151 | + </div> |
| 152 | + </Modal> |
| 153 | +); |
| 154 | + |
| 155 | +SkillsNagModal.propTypes = { |
| 156 | + MIN_SKILLS_TO_REMIND: PT.number.isRequired, |
| 157 | + handle: PT.string.isRequired, |
| 158 | + skills: PT.shape().isRequired, |
| 159 | + onCancel: PT.func.isRequired, |
| 160 | + onCTA: PT.func.isRequired, |
| 161 | +}; |
| 162 | + |
| 163 | +export default SkillsNagModal; |
0 commit comments