mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-24 01:23:08 +03:00
feat(ObjectPreview): fix typo premitive-> primitive
This commit is contained in:
parent
7fb84a2655
commit
dadaca6eab
@ -6,7 +6,7 @@ import * as Styles from "~/common/styles";
|
||||
import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import ObjectPlaceholder from "./placeholders/3D";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -26,13 +26,13 @@ const STYLES_TAG = (theme) => css`
|
||||
|
||||
export default function Object3DPreview(props) {
|
||||
return (
|
||||
<ObjectPreviewPremitive {...props}>
|
||||
<ObjectPreviewPrimitive {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<ObjectPlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>3D</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import { P3 } from "~/components/system";
|
||||
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import AudioPlaceholder from "./placeholders/Audio";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -29,13 +29,13 @@ const STYLES_TAG = (theme) => css`
|
||||
export default function AudioObjectPreview({ file, ...props }) {
|
||||
const tag = Utilities.getFileExtension(file.filename) || "audio";
|
||||
return (
|
||||
<ObjectPreviewPremitive file={file} {...props}>
|
||||
<ObjectPreviewPrimitive file={file} {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<AudioPlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>{tag}</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import * as Utilities from "~/common/utilities";
|
||||
import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import CodePlaceholder from "./placeholders/Code";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -28,13 +28,13 @@ const STYLES_TAG = (theme) => css`
|
||||
export default function CodeObjectPreview({ file, ...props }) {
|
||||
const tag = Utilities.getFileExtension(file.filename) || "code";
|
||||
return (
|
||||
<ObjectPreviewPremitive file={file} {...props}>
|
||||
<ObjectPreviewPrimitive file={file} {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<CodePlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>{tag}</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import * as Styles from "~/common/styles";
|
||||
import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import FilePlaceholder from "./placeholders/File";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -24,13 +24,13 @@ const STYLES_TAG = (theme) => css`
|
||||
|
||||
export default function DefaultObjectPreview(props) {
|
||||
return (
|
||||
<ObjectPreviewPremitive {...props}>
|
||||
<ObjectPreviewPrimitive {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<FilePlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>FILE</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import * as Styles from "~/common/styles";
|
||||
import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import EpubPlaceholder from "./placeholders/EPUB";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -26,13 +26,13 @@ const STYLES_TAG = (theme) => css`
|
||||
|
||||
export default function EpubObjectPreview(props) {
|
||||
return (
|
||||
<ObjectPreviewPremitive {...props}>
|
||||
<ObjectPreviewPrimitive {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<EpubPlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>EPUB</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import * as Utilities from "~/common/utilities";
|
||||
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import { useFont } from "~/components/core/FontFrame/hooks";
|
||||
|
||||
const STYLES_TEXT_PREVIEW = (theme) => css`
|
||||
@ -29,12 +29,12 @@ export default function FontObjectPreview({ file, ...props }) {
|
||||
|
||||
const tag = Utilities.getFileExtension(file.filename) || "font";
|
||||
return (
|
||||
<ObjectPreviewPremitive tag={tag} file={file} {...props}>
|
||||
<ObjectPreviewPrimitive tag={tag} file={file} {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_TEXT_PREVIEW]}>
|
||||
<div style={{ fontFamily: fontName }}>
|
||||
<div css={STYLES_LETTER}>Aa</div>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import { Blurhash } from "react-blurhash";
|
||||
import { isBlurhashValid } from "blurhash";
|
||||
|
||||
import { css } from "@emotion/react";
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
|
||||
const STYLES_PLACEHOLDER_ABSOLUTE = css`
|
||||
position: absolute;
|
||||
@ -71,7 +71,7 @@ export default function ImageObjectPreview({ url, file, ...props }) {
|
||||
const imageUrl = coverImage ? Strings.getURLfromCID(coverImage?.cid) : url;
|
||||
|
||||
return (
|
||||
<ObjectPreviewPremitive file={file} tag={tag} isImage {...props}>
|
||||
<ObjectPreviewPrimitive file={file} tag={tag} isImage {...props}>
|
||||
<div ref={previewerRef} css={[Styles.CONTAINER_CENTERED, STYLES_FLUID_CONTAINER]}>
|
||||
{isInView && (
|
||||
<AspectRatio ratio={186 / 302}>
|
||||
@ -86,6 +86,6 @@ export default function ImageObjectPreview({ url, file, ...props }) {
|
||||
)}
|
||||
{shouldShowPlaceholder && <ImagePlaceholder blurhash={blurhash} />}
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import * as Styles from "~/common/styles";
|
||||
import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import KeynotePlaceholder from "./placeholders/Keynote";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -26,13 +26,13 @@ const STYLES_TAG = (theme) => css`
|
||||
|
||||
export default function KeynoteObjectPreview(props) {
|
||||
return (
|
||||
<ObjectPreviewPremitive {...props}>
|
||||
<ObjectPreviewPrimitive {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<KeynotePlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>KEYNOTE</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import PdfPlaceholder from "./placeholders/PDF";
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
position: relative;
|
||||
@ -27,13 +27,13 @@ const STYLES_TAG = (theme) => css`
|
||||
|
||||
export default function PDFObjectPreview(props) {
|
||||
return (
|
||||
<ObjectPreviewPremitive {...props}>
|
||||
<ObjectPreviewPrimitive {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<PdfPlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>PDF</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import * as Utilities from "~/common/utilities";
|
||||
import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import TextPlaceholder from "./placeholders/Text";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -56,7 +56,7 @@ export default function TextObjectPreview({ url, file, ...props }) {
|
||||
const tag = Utilities.getFileExtension(file.filename) || "text";
|
||||
|
||||
return (
|
||||
<ObjectPreviewPremitive tag={!error && tag} file={file} {...props}>
|
||||
<ObjectPreviewPrimitive tag={!error && tag} file={file} {...props}>
|
||||
<div css={[STYLES_CONTAINER, error && Styles.CONTAINER_CENTERED]}>
|
||||
{error ? (
|
||||
<>
|
||||
@ -71,6 +71,6 @@ export default function TextObjectPreview({ url, file, ...props }) {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import * as Styles from "~/common/styles";
|
||||
import { P3 } from "~/components/system";
|
||||
import { css } from "@emotion/react";
|
||||
|
||||
import ObjectPreviewPremitive from "./ObjectPreviewPremitive";
|
||||
import ObjectPreviewPrimitive from "./ObjectPreviewPrimitive";
|
||||
import VideoPlaceholder from "./placeholders/Video";
|
||||
|
||||
const STYLES_CONTAINER = css`
|
||||
@ -28,13 +28,13 @@ export default function VideoObjectPreview({ file, ...props }) {
|
||||
const { type } = file.data;
|
||||
const tag = type.split("/")[1];
|
||||
return (
|
||||
<ObjectPreviewPremitive file={file} {...props}>
|
||||
<ObjectPreviewPrimitive file={file} {...props}>
|
||||
<div css={[Styles.CONTAINER_CENTERED, STYLES_CONTAINER]}>
|
||||
<VideoPlaceholder />
|
||||
<div css={STYLES_TAG}>
|
||||
<P3>{tag}</P3>
|
||||
</div>
|
||||
</div>
|
||||
</ObjectPreviewPremitive>
|
||||
</ObjectPreviewPrimitive>
|
||||
);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ const STYLES_TAG = (theme) => css`
|
||||
border-radius: 4px;
|
||||
`;
|
||||
|
||||
const PlaceholderPremitive = ({ file, ratio }) => {
|
||||
const PlaceholderPrimitive = ({ file, ratio }) => {
|
||||
const { type } = file.data;
|
||||
|
||||
if (type.startsWith("video/")) {
|
||||
@ -104,7 +104,7 @@ export default function Placeholder({ file, containerCss, ratio, showTag }) {
|
||||
<Typography.P3>{tag}</Typography.P3>
|
||||
</div>
|
||||
)}
|
||||
<PlaceholderPremitive ratio={ratio} file={file} />
|
||||
<PlaceholderPrimitive ratio={ratio} file={file} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user