Merge branch 'revert-622b90da' into 'develop'

Revert "Merge branch 'square' into 'develop'"

Closes #1284

See merge request soapbox-pub/soapbox!2070
environments/review-develop-3zknud/deployments/1940
Alex Gleason 2022-12-29 22:37:50 +00:00
commit f50379bdbd
5 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Compatibility: rudimentary support for Takahē.
### Changed
- Posts: letterbox images to 19:6 again.
### Fixed
- Layout: use accent color for "floating action button" (mobile compose button).

Wyświetl plik

@ -294,7 +294,7 @@ const MediaGallery: React.FC<IMediaGallery> = (props) => {
const aspectRatio = media.getIn([0, 'meta', 'original', 'aspect']) as number | undefined;
const getHeight = () => {
if (!aspectRatio) return w;
if (!aspectRatio) return w * 9 / 16;
if (isPanoramic(aspectRatio)) return Math.floor(w / maximumAspectRatio);
if (isPortrait(aspectRatio)) return Math.floor(w / minimumAspectRatio);
return Math.floor(w / aspectRatio);

Wyświetl plik

@ -29,7 +29,7 @@ const PlaceholderMediaGallery: React.FC<IPlaceholderMediaGallery> = ({ media, de
let itemsDimensions: Record<string, string>[] = [];
if (size === 1) {
style.height = width;
style.height = width! * 9 / 16;
itemsDimensions = [
{ w: '100%', h: '100%' },

Wyświetl plik

@ -111,7 +111,7 @@ const Card: React.FC<ICard> = ({
// Constrain to a sane limit
// https://en.wikipedia.org/wiki/Aspect_ratio_(image)
return Math.min(Math.max(1, ratio), 4);
return Math.min(Math.max(9 / 16, ratio), 4);
};
const interactive = card.type !== 'link';

Wyświetl plik

@ -1,4 +1,4 @@
export const minimumAspectRatio = 1; // Square
export const minimumAspectRatio = 9 / 16; // Portrait phone
export const maximumAspectRatio = 10; // Generous min-height
export const isPanoramic = (ar: number) => {