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 { Logo } from "~/common/logo"; 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; */} background-color: #d2d7db; font-family: ${Constants.font.text}; font-size: 14px; color: ${Constants.system.white}; display: flex; align-items: center; justify-content: center; @media (max-width: ${Constants.sizes.mobile}px) { height: 100%; } `; export class SlatePreviewRow extends React.Component { render() { let numItems = this.props.numItems || 4; let objects = this.props.slate.objects; let components; if (objects.length === 0) { components = [
, ]; } else { let trimmed = objects.length > numItems ? objects.slice(1, numItems) : objects.slice(1, objects.length); components = trimmed.map((each) => (