import * as React from "react"; import * as Constants from "~/common/constants"; import * as SVG from "~/common/svg"; import * as Strings from "~/common/strings"; import * as Window from "~/common/window"; import { css } from "@emotion/react"; import { Boundary } from "~/components/system/components/fragments/Boundary"; import { PopoverNavigation } from "~/components/system/components/PopoverNavigation"; import ProcessedText from "~/components/core/ProcessedText"; import SlateMediaObjectPreview from "~/components/core/SlateMediaObjectPreview"; const placeholder = "https://slate.textile.io/ipfs/bafkreidq27ycqubd4pxbo76n3rv5eefgxl3a2lh3wfvdgtil4u47so3nqe"; const STYLES_IMAGE_ROW = css` overflow: hidden; @media (max-width: ${Constants.sizes.mobile}px) { justify-content: center; margin: 0 -8px; } `; const STYLES_ITEM_BOX = css` height: calc(33.33% - 4px); overflow: hidden; margin: 0px 0px 4px 4px; box-shadow: 0px 0px 0px 1px ${Constants.system.lightBorder} inset; cursor: pointer; @media (max-width: ${Constants.sizes.mobile}px) { margin: 0 8px; } `; const STYLES_PLACEHOLDER = css` width: 100%; height: 320px; background-size: cover; background-position: 50% 50%; margin-bottom: 4px; @media (max-width: ${Constants.sizes.mobile}px) { height: 100%; } `; export class SlatePreviewRow extends React.Component { render() { let numItems = this.props.numItems || 4; let objects; if (this.props.slate.data.objects.length === 0) { objects = [
, ]; } else { let trimmed = this.props.slate.data.objects.length > numItems ? this.props.slate.data.objects.slice(1, numItems) : this.props.slate.data.objects.slice(1, this.props.slate.data.objects.length); objects = trimmed.map((each) => (