import * as React from 'react'; import { Renderer, Tester } from './../interfaces'; import globalStyle from './../styles.css' import WithHeader from './wrappers/withHeader'; import WithSeeMore from './wrappers/withSeeMore'; export const renderer: Renderer = ({ story, action, isPaused, config }) => { const [loaded, setLoaded] = React.useState(false); const { width, height, loader, storyStyles } = config; let computedStyles = { ...styles.storyContent, ...(storyStyles || {}) } const imageLoaded = () => { setLoaded(true); action('play'); } return
{!loaded && (
{loader ||
}
)}
} const styles = { story: { display: "flex", position: "relative", overflow: "hidden" }, storyContent: { width: "auto", maxWidth: "100%", maxHeight: "100%", margin: "auto" } }; export const tester: Tester = (story) => { return { condition: !story.content && (!story.type || story.type === 'image'), priority: 2 } } export default { renderer, tester }