SHARE
TWEET

Untitled

a guest Jan 11th, 2017 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const University = ({ Name }) => (
  2.  
  3.  renderUni(uniUrl, uniName) {
  4.   const truncateName = changenName(uniName);
  5.   return truncateName + '...';
  6. }
  7.  
  8.  changeName(Name) {
  9.   const maxCharacterLength = 10;
  10.   if (Name.length > 10) {
  11.     return Name.substring(0, maxCharacterLength);
  12.   }
  13.   return Name;
  14. }
  15.   <div className="uni">
  16.     <ul className="uni-login">
  17.           {Name &&
  18.            Name.map(({ uniUrl, uniName }) =>
  19.               (<li>
  20.                 {renderUni(uniUrl, uniName)}
  21.               </li>)
  22.           )}
  23.     </ul>
  24.   </div>
  25. );
RAW Paste Data
Top