Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const University = ({ Name }) => (
- renderUni(uniUrl, uniName) {
- const truncateName = changenName(uniName);
- return truncateName + '...';
- }
- changeName(Name) {
- const maxCharacterLength = 10;
- if (Name.length > 10) {
- return Name.substring(0, maxCharacterLength);
- }
- return Name;
- }
- <div className="uni">
- <ul className="uni-login">
- {Name &&
- Name.map(({ uniUrl, uniName }) =>
- (<li>
- {renderUni(uniUrl, uniName)}
- </li>)
- )}
- </ul>
- </div>
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement