Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

40 wiersze
1.7 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('a', ['tile', 'mini-teaser', type], null);
  15. tile.href = link;
  16. const textBox = createElement('div', ['text-box'], null, tile);
  17. createElement('h5', ['category'], category, textBox);
  18. createElement('h4', ['title'], title, textBox);
  19. return tile;
  20. }else{
  21. const tile = createElement('a', ['tile', 'mini-teaser', type], null);
  22. tile.href = link;
  23. if (backgroundImage && backgroundImage.length > 0) {
  24. tile.style = 'background-image: url(' + backgroundImage + ');';
  25. tile.classList.add('background-image');
  26. }
  27. const textBox = createElement('div', ['text-box'], null, tile);
  28. if (icon && icon.length > 0) {
  29. createElement('div', ['icon-box', 'pictogram-' + icon.toLowerCase().split(' ').join('-')], null, textBox);
  30. createElement('h4', ['title'], title, textBox);
  31. textBox.appendChild(createButton({elementType: 'span',color: 'white', label: buttonlabel,iconPosition: 'icon-right', icon: null, preventClick: false}))
  32. }else{
  33. createElement('h4', ['title', 'noicon'], title, textBox);
  34. textBox.appendChild(createButton({elementType: 'span',color: 'white', label: buttonlabel, iconPosition: 'icon-right', icon: null, preventClick: false}))
  35. }
  36. return tile;
  37. }
  38. }