pl-fe: do not use csstype
This commit is contained in:
parent
fb4d14bd8b
commit
086f409ec8
1 changed files with 11 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import React, { useState, useRef, useLayoutEffect } from 'react';
|
import React, { useState, useRef, useLayoutEffect, CSSProperties } from 'react';
|
||||||
|
|
||||||
import Blurhash from 'pl-fe/components/blurhash';
|
import Blurhash from 'pl-fe/components/blurhash';
|
||||||
import Icon from 'pl-fe/components/icon';
|
import Icon from 'pl-fe/components/icon';
|
||||||
|
@ -12,25 +12,24 @@ import { truncateFilename } from 'pl-fe/utils/media';
|
||||||
import { isIOS } from '../is-mobile';
|
import { isIOS } from '../is-mobile';
|
||||||
import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media-aspect-ratio';
|
import { isPanoramic, isPortrait, isNonConformingRatio, minimumAspectRatio, maximumAspectRatio } from '../utils/media-aspect-ratio';
|
||||||
|
|
||||||
import type { Property } from 'csstype';
|
|
||||||
import type { MediaAttachment } from 'pl-api';
|
import type { MediaAttachment } from 'pl-api';
|
||||||
|
|
||||||
const ATTACHMENT_LIMIT = 4;
|
const ATTACHMENT_LIMIT = 4;
|
||||||
const MAX_FILENAME_LENGTH = 45;
|
const MAX_FILENAME_LENGTH = 45;
|
||||||
|
|
||||||
interface Dimensions {
|
interface Dimensions {
|
||||||
w: Property.Width | number;
|
w: CSSProperties['width'];
|
||||||
h: Property.Height | number;
|
h: CSSProperties['height'];
|
||||||
t?: Property.Top;
|
t?: CSSProperties['top'];
|
||||||
r?: Property.Right;
|
r?: CSSProperties['right'];
|
||||||
b?: Property.Bottom;
|
b?: CSSProperties['bottom'];
|
||||||
l?: Property.Left;
|
l?: CSSProperties['left'];
|
||||||
float?: Property.Float;
|
float?: CSSProperties['float'];
|
||||||
pos?: Property.Position;
|
pos?: CSSProperties['position'];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SizeData {
|
interface SizeData {
|
||||||
style: React.CSSProperties;
|
style: CSSProperties;
|
||||||
itemsDimensions: Dimensions[];
|
itemsDimensions: Dimensions[];
|
||||||
size: number;
|
size: number;
|
||||||
width: number;
|
width: number;
|
||||||
|
@ -322,7 +321,7 @@ const MediaGallery: React.FC<IMediaGallery> = (props) => {
|
||||||
const panoSize = Math.floor(w / maximumAspectRatio);
|
const panoSize = Math.floor(w / maximumAspectRatio);
|
||||||
const panoSize_px = `${Math.floor(w / maximumAspectRatio)}px`;
|
const panoSize_px = `${Math.floor(w / maximumAspectRatio)}px`;
|
||||||
|
|
||||||
const style: React.CSSProperties = {};
|
const style: CSSProperties = {};
|
||||||
let itemsDimensions: Dimensions[] = [];
|
let itemsDimensions: Dimensions[] = [];
|
||||||
|
|
||||||
const ratios = Array(size).fill(null).map((_, i) => getAspectRatio(media[i]));
|
const ratios = Array(size).fill(null).map((_, i) => getAspectRatio(media[i]));
|
||||||
|
|
Loading…
Reference in a new issue