Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

46 rindas
2.1 KiB

  1. import './miniteaser.scss';
  2. import {createElement} from "../../_global/scripts/helpers";
  3. import { createButton } from '../../atoms/button/ButtonComponent';
  4. export const createMiniTeaser = ({
  5. type = 'standard',
  6. category = 'IHK Mitgliedschaft',
  7. title = 'Werden Sie Teil unseres Netzwerks!',
  8. link = '#',
  9. icon = 'Roboter',
  10. buttonlabel = 'IHK-Newsletter sichern',
  11. backgroundImage = null,
  12. }) => {
  13. if (type === 'standard') {
  14. const tile = createElement('div', ['tile', 'mini-teaser', type], null);
  15. // tile.href = link;
  16. const textBox = createElement('div', ['text-box'], null, tile);
  17. createElement('div', ['category','like-h5'], category, textBox);
  18. createElement('div', ['title','like-h4'], title, textBox);
  19. const teaserLink = createElement('a', ['teaser--link'], '', tile);
  20. teaserLink.href = link;
  21. teaserLink.setAttribute('aria-label', 'Beschreibender Link-Text');
  22. return tile;
  23. } else {
  24. const tile = createElement('div', ['tile', 'mini-teaser', type], null);
  25. // tile.href = link;
  26. if (backgroundImage && backgroundImage.length > 0) {
  27. tile.style = 'background-image: url(' + backgroundImage + ');';
  28. tile.classList.add('background-image');
  29. }
  30. const textBox = createElement('div', ['text-box'], null, tile);
  31. if (icon && icon.length > 0) {
  32. createElement('div', ['icon-box', 'pictogram-' + icon.toLowerCase().split(' ').join('-')], null, textBox);
  33. createElement('div', ['title','like-h4'], title, textBox);
  34. textBox.appendChild(createButton({elementType: 'span',color: 'white', label: buttonlabel,iconPosition: 'icon-right', icon: null, preventClick: false}))
  35. } else {
  36. createElement('div', ['title', 'noicon', 'like-h4'], title, textBox);
  37. textBox.appendChild(createButton({elementType: 'span',color: 'white', label: buttonlabel, iconPosition: 'icon-right', icon: null, preventClick: false}))
  38. }
  39. const teaserLink = createElement('a', ['teaser--link'], '', tile);
  40. teaserLink.href = link;
  41. teaserLink.setAttribute('aria-label', 'Beschreibender Link-Text');
  42. return tile;
  43. }
  44. }