sous-components-twig
Advanced tools
Comparing version 0.0.18 to 0.0.19
import React from 'react'; | ||
import { useEffect } from '@storybook/client-api'; | ||
// Global Data | ||
import globalData from '../../_global-data/images.yml'; | ||
@@ -6,2 +9,3 @@ import image from './image/responsive-image.twig'; | ||
import iconTwig from './icons/icons.twig'; | ||
import bgImageTwig from './background-image/background-image.twig'; | ||
@@ -11,3 +15,6 @@ import imageData from './image/image.yml'; | ||
import iconData from './icons/icons.yml'; | ||
import bgImageContent from './background-image/background-image--with-content.yml'; | ||
import './background-image/background-image'; | ||
/** | ||
@@ -18,4 +25,31 @@ * Storybook Definition. | ||
export const images = () => <div dangerouslySetInnerHTML={{ __html: image(imageData) }} />; | ||
export const figures = () => <div dangerouslySetInnerHTML={{ __html: figure(figureData) }} />; | ||
export const icons = () => <div dangerouslySetInnerHTML={{ __html: iconTwig(iconData) }} />; | ||
export const images = () => ( | ||
<div dangerouslySetInnerHTML={{ __html: image(imageData) }} /> | ||
); | ||
export const figures = () => ( | ||
<div dangerouslySetInnerHTML={{ __html: figure(figureData) }} /> | ||
); | ||
export const icons = () => ( | ||
<div dangerouslySetInnerHTML={{ __html: iconTwig(iconData) }} /> | ||
); | ||
export const backgroundImage = () => { | ||
useEffect(() => Drupal.attachBehaviors(), []); | ||
return ( | ||
<div | ||
className="cl-example" | ||
dangerouslySetInnerHTML={{ __html: bgImageTwig(globalData) }} | ||
/> | ||
); | ||
}; | ||
export const backgroundImageWithContent = () => { | ||
useEffect(() => Drupal.attachBehaviors(), []); | ||
return ( | ||
<div | ||
className="cl-example" | ||
dangerouslySetInnerHTML={{ | ||
__html: bgImageTwig({ ...globalData, ...bgImageContent }), | ||
}} | ||
/> | ||
); | ||
}; |
{ | ||
"name": "sous-components-twig", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Twig components for a fictitious Sous install", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
464527
159
612