Finalize non-fuji film icon treatment

This commit is contained in:
Sam Becker 2025-04-01 23:43:29 -05:00
parent df41838e6f
commit 51a614d97f
3 changed files with 7 additions and 5 deletions

View File

@ -6,6 +6,7 @@ import EntityLink, {
} from '@/components/primitives/EntityLink';
import clsx from 'clsx/lite';
import { labelForFilm } from '.';
import { isStringFujifilmSimulation } from '@/platforms/fujifilm/simulation';
export default function PhotoFilm({
film,
@ -41,7 +42,7 @@ export default function PhotoFilm({
badged={badged}
contrast={contrast}
hoverEntity={countOnHover}
iconWide
iconWide={isStringFujifilmSimulation(film)}
/>
);
}

View File

@ -1,5 +1,5 @@
/* eslint-disable max-len */
import { CSSProperties, useMemo } from 'react';
import { CSSProperties } from 'react';
import { labelForFilm } from '.';
const INTRINSIC_WIDTH = 28;
@ -21,7 +21,7 @@ export default function PhotoFilmIcon({
className?: string
style?: CSSProperties
}) {
const simulationIcon = useMemo(() => {
const simulationIcon = (() => {
// Self-calling switch function and non-fragment groups
// necessary for ImageResponse compatibility
switch (film) {
@ -139,7 +139,7 @@ export default function PhotoFilmIcon({
<path fillRule="evenodd" clipRule="evenodd" d="M5.25 3.49999L2 3.49999C1.86193 3.49999 1.75 3.61192 1.75 3.74999V5.24998C1.75 5.38806 1.86193 5.49998 2 5.49998H3.00001C3.13808 5.49998 3.25001 5.61191 3.25001 5.74999L3.25 12.25C3.25 12.3881 3.13807 12.5 3 12.5H2C1.86193 12.5 1.75 12.6119 1.75 12.75V14.25C1.75 14.3881 1.86193 14.5 2 14.5H14.25C14.3881 14.5 14.5 14.3881 14.5 14.25V12.75C14.5 12.6119 14.3881 12.5 14.25 12.5H13.25C13.1119 12.5 13 12.3881 13 12.25L13 5.75C13 5.61193 13.112 5.5 13.25 5.5H14.25C14.3881 5.5 14.5 5.38807 14.5 5.25V3.74999C14.5 3.61192 14.3881 3.49999 14.25 3.49999L11 3.49999C10.8619 3.49998 10.75 3.38806 10.75 3.24999V1.74998C10.75 1.61191 10.6381 1.49998 10.5 1.49998H5.75C5.61193 1.49998 5.5 1.61191 5.5 1.74998V3.24999C5.5 3.38806 5.38807 3.49998 5.25 3.49999ZM5.33818 13H7.01843V9.898H8.13469L9.40369 13H11.2249L9.79144 9.74525C10.2379 9.58075 10.5748 9.29092 10.8019 8.87575C11.0291 8.46058 11.1427 7.95142 11.1427 7.34825C11.1427 6.57275 10.9508 5.95392 10.5669 5.49175C10.1831 5.02958 9.62302 4.7985 8.88668 4.7985H5.33818V13ZM9.20393 8.33525C9.0786 8.44492 8.90235 8.49975 8.67518 8.49975H7.01843V6.26725H8.67518C8.90235 6.26725 9.0786 6.326 9.20393 6.4435C9.3371 6.55317 9.40369 6.749 9.40369 7.031V7.736C9.40369 8.018 9.3371 8.21775 9.20393 8.33525Z" fill="currentColor"/>
</g>;
}
}, [film]);
})();
const width = simulationIcon
? INTRINSIC_WIDTH

View File

@ -223,7 +223,8 @@ const ALL_POSSIBLE_FUJIFILM_SIMULATION_LABELS = Object
]);
export const isStringFujifilmSimulation = (film?: string) =>
film && Object.keys(FUJIFILM_SIMULATION_LABELS).includes(film);
film !== undefined &&
Object.keys(FUJIFILM_SIMULATION_LABELS).includes(film);
export const isStringFujifilmSimulationLabel = (film: string) =>
ALL_POSSIBLE_FUJIFILM_SIMULATION_LABELS.includes(film.toLocaleLowerCase());