fall back to larger images if requested size is not available

Summary: This diff follows up on the previous one, by trying a larger icon size if the original requested icon size was missing.

Reviewed By: lblasa

Differential Revision: D46556076

fbshipit-source-id: 4a078088aa27390f247e39afeda4b1df261d8b30
This commit is contained in:
Michel Weststrate
2023-06-08 07:31:34 -07:00
committed by Facebook GitHub Bot
parent a6dac1d8d9
commit 50f50fa46c
3 changed files with 42 additions and 19 deletions

View File

@@ -11,7 +11,7 @@ import React from 'react';
import styled from '@emotion/styled';
import {getIconURL} from '../../utils/icons';
export type IconSize = 8 | 10 | 12 | 16 | 18 | 20 | 24 | 32;
export type IconSize = 8 | 10 | 12 | 16 | 18 | 20 | 24 | 28 | 32;
const ColoredIconBlack = styled.img<{size: number}>(({size}) => ({
height: size,

View File

@@ -10,7 +10,7 @@
import {getRenderHostInstance} from 'flipper-frontend-core';
import {IconSize} from '../ui/components/Glyph';
const AVAILABLE_SIZES: IconSize[] = [8, 10, 12, 16, 18, 20, 24, 32];
const AVAILABLE_SIZES: IconSize[] = [8, 10, 12, 16, 18, 20, 24, 28, 32];
const DENSITIES = [1, 1.5, 2, 3, 4];
export type Icon = {