Rename core film types
This commit is contained in:
parent
535f2180c2
commit
763cc4de14
@ -24,7 +24,7 @@ const getPhotosNearIdCachedCached = cache((
|
|||||||
) =>
|
) =>
|
||||||
getPhotosNearIdCached(
|
getPhotosNearIdCached(
|
||||||
photoId,
|
photoId,
|
||||||
{ simulation, limit: RELATED_GRID_PHOTOS_TO_SHOW + 2 },
|
{ film: simulation, limit: RELATED_GRID_PHOTOS_TO_SHOW + 2 },
|
||||||
));
|
));
|
||||||
|
|
||||||
interface PhotoFilmSimulationProps {
|
interface PhotoFilmSimulationProps {
|
||||||
@ -43,7 +43,7 @@ export async function generateMetadata({
|
|||||||
const title = titleForPhoto(photo);
|
const title = titleForPhoto(photo);
|
||||||
const description = descriptionForPhoto(photo);
|
const description = descriptionForPhoto(photo);
|
||||||
const images = absolutePathForPhotoImage(photo);
|
const images = absolutePathForPhotoImage(photo);
|
||||||
const url = absolutePathForPhoto({ photo, simulation: film });
|
const url = absolutePathForPhoto({ photo, film: film });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title,
|
title,
|
||||||
@ -73,14 +73,14 @@ export default async function PhotoFilmPage({
|
|||||||
|
|
||||||
if (!photo) { redirect(PATH_ROOT); }
|
if (!photo) { redirect(PATH_ROOT); }
|
||||||
|
|
||||||
const { count, dateRange } = await getPhotosMetaCached({ simulation: film });
|
const { count, dateRange } = await getPhotosMetaCached({ film: film });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PhotoDetailPage {...{
|
<PhotoDetailPage {...{
|
||||||
photo,
|
photo,
|
||||||
photos,
|
photos,
|
||||||
photosGrid,
|
photosGrid,
|
||||||
simulation: film,
|
film: film,
|
||||||
indexNumber,
|
indexNumber,
|
||||||
count,
|
count,
|
||||||
dateRange,
|
dateRange,
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const generateStaticParams = staticallyGenerateCategoryIfConfigured(
|
|||||||
'films',
|
'films',
|
||||||
'image',
|
'image',
|
||||||
getUniqueFilmSimulations,
|
getUniqueFilmSimulations,
|
||||||
simulations => simulations.map(({ simulation }) => ({ simulation })),
|
simulations => simulations.map(({ film: simulation }) => ({ simulation })),
|
||||||
);
|
);
|
||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
@ -32,7 +32,7 @@ export async function GET(
|
|||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
getPhotosCached({
|
getPhotosCached({
|
||||||
limit: MAX_PHOTOS_TO_SHOW_PER_CATEGORY,
|
limit: MAX_PHOTOS_TO_SHOW_PER_CATEGORY,
|
||||||
simulation: film,
|
film: film,
|
||||||
}),
|
}),
|
||||||
getIBMPlexMono(),
|
getIBMPlexMono(),
|
||||||
getImageResponseCacheControlHeaders(),
|
getImageResponseCacheControlHeaders(),
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const generateStaticParams = staticallyGenerateCategoryIfConfigured(
|
|||||||
'films',
|
'films',
|
||||||
'page',
|
'page',
|
||||||
getUniqueFilmSimulations,
|
getUniqueFilmSimulations,
|
||||||
simulations => simulations.map(({ simulation }) => ({ simulation })),
|
films => films.map(({ film }) => ({ film })),
|
||||||
);
|
);
|
||||||
|
|
||||||
interface FilmSimulationProps {
|
interface FilmSimulationProps {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ export default async function GridPage() {
|
|||||||
cameras,
|
cameras,
|
||||||
lenses,
|
lenses,
|
||||||
tags,
|
tags,
|
||||||
simulations,
|
films: simulations,
|
||||||
recipes,
|
recipes,
|
||||||
focalLengths,
|
focalLengths,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { Metadata } from 'next/types';
|
|||||||
import { ThemeProvider } from 'next-themes';
|
import { ThemeProvider } from 'next-themes';
|
||||||
import Nav from '@/app/Nav';
|
import Nav from '@/app/Nav';
|
||||||
import Footer from '@/app/Footer';
|
import Footer from '@/app/Footer';
|
||||||
import CommandK from '@/app/CommandK';
|
import CommandK from '@/cmdk/CommandK';
|
||||||
import SwrConfigClient from '@/state/SwrConfigClient';
|
import SwrConfigClient from '@/state/SwrConfigClient';
|
||||||
import AdminBatchEditPanel from '@/admin/AdminBatchEditPanel';
|
import AdminBatchEditPanel from '@/admin/AdminBatchEditPanel';
|
||||||
import ShareModals from '@/share/ShareModals';
|
import ShareModals from '@/share/ShareModals';
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export default async function OGOverviewPage() {
|
|||||||
.catch(() => []),
|
.catch(() => []),
|
||||||
getPhotosCached({ limit: 1, camera })
|
getPhotosCached({ limit: 1, camera })
|
||||||
.catch(() => []),
|
.catch(() => []),
|
||||||
getPhotosCached({ limit: 1, simulation })
|
getPhotosCached({ limit: 1, film: simulation })
|
||||||
.catch(() => []),
|
.catch(() => []),
|
||||||
getPhotosCached({ limit: 1, focal })
|
getPhotosCached({ limit: 1, focal })
|
||||||
.catch(() => []),
|
.catch(() => []),
|
||||||
|
|||||||
@ -59,7 +59,7 @@ export default async function HomePage() {
|
|||||||
lenses,
|
lenses,
|
||||||
tags,
|
tags,
|
||||||
recipes,
|
recipes,
|
||||||
simulations,
|
films: simulations,
|
||||||
focalLengths,
|
focalLengths,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -121,7 +121,7 @@ export const pathForPhoto = ({
|
|||||||
camera,
|
camera,
|
||||||
lens,
|
lens,
|
||||||
tag,
|
tag,
|
||||||
simulation,
|
film: simulation,
|
||||||
focal,
|
focal,
|
||||||
recipe,
|
recipe,
|
||||||
}: PhotoPathParams) => {
|
}: PhotoPathParams) => {
|
||||||
@ -330,7 +330,7 @@ export const getPathComponents = (pathname = ''): {
|
|||||||
),
|
),
|
||||||
tag,
|
tag,
|
||||||
camera,
|
camera,
|
||||||
simulation,
|
film: simulation,
|
||||||
focal,
|
focal,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -340,7 +340,7 @@ export const getEscapePath = (pathname?: string) => {
|
|||||||
photoId,
|
photoId,
|
||||||
tag,
|
tag,
|
||||||
camera,
|
camera,
|
||||||
simulation,
|
film: simulation,
|
||||||
focal,
|
focal,
|
||||||
} = getPathComponents(pathname);
|
} = getPathComponents(pathname);
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ export const getCountsForCategories = async () => {
|
|||||||
return acc;
|
return acc;
|
||||||
}, {} as Record<string, number>),
|
}, {} as Record<string, number>),
|
||||||
filmSimulations: filmSimulations.reduce((acc, filmSimulation) => {
|
filmSimulations: filmSimulations.reduce((acc, filmSimulation) => {
|
||||||
acc[filmSimulation.simulation] = filmSimulation.count;
|
acc[filmSimulation.film] = filmSimulation.count;
|
||||||
return acc;
|
return acc;
|
||||||
}, {} as Record<string, number>),
|
}, {} as Record<string, number>),
|
||||||
focalLengths: focalLengths.reduce((acc, focalLength) => {
|
focalLengths: focalLengths.reduce((acc, focalLength) => {
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export interface PhotoSetCategory {
|
|||||||
lens?: Lens
|
lens?: Lens
|
||||||
tag?: string
|
tag?: string
|
||||||
recipe?: string
|
recipe?: string
|
||||||
simulation?: FilmSimulation
|
film?: FilmSimulation
|
||||||
focal?: number
|
focal?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ export interface PhotoSetCategories {
|
|||||||
lenses: Lenses
|
lenses: Lenses
|
||||||
tags: Tags
|
tags: Tags
|
||||||
recipes: Recipes
|
recipes: Recipes
|
||||||
simulations: FilmSimulations
|
films: FilmSimulations
|
||||||
focalLengths: FocalLengths
|
focalLengths: FocalLengths
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,11 +80,9 @@ export const sortCategoriesByCount = <T extends { count: number }>(
|
|||||||
const convertCategoryKeysToCategoryNames =
|
const convertCategoryKeysToCategoryNames =
|
||||||
(categoryKeys: CategoryKeys): (keyof PhotoSetCategories)[] => {
|
(categoryKeys: CategoryKeys): (keyof PhotoSetCategories)[] => {
|
||||||
return categoryKeys.map(key => {
|
return categoryKeys.map(key => {
|
||||||
return key === 'films'
|
return key === 'focal-lengths'
|
||||||
? 'simulations'
|
? 'focalLengths'
|
||||||
: key === 'focal-lengths'
|
: key;
|
||||||
? 'focalLengths'
|
|
||||||
: key;
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import CommandKClient from '@/components/cmdk/CommandKClient';
|
import CommandKClient from './CommandKClient';
|
||||||
import { getPhotosMetaCached } from '@/photo/cache';
|
import { getPhotosMetaCached } from '@/photo/cache';
|
||||||
import { photoQuantityText } from '@/photo';
|
import { photoQuantityText } from '@/photo';
|
||||||
import { ADMIN_DEBUG_TOOLS_ENABLED } from './config';
|
import { ADMIN_DEBUG_TOOLS_ENABLED } from '../app/config';
|
||||||
import { getDataForCategories } from '@/category/data';
|
import { getDataForCategories } from '@/category/data';
|
||||||
|
|
||||||
export default async function CommandK() {
|
export default async function CommandK() {
|
||||||
@ -11,7 +11,7 @@ export default async function CommandK() {
|
|||||||
lenses,
|
lenses,
|
||||||
tags,
|
tags,
|
||||||
recipes,
|
recipes,
|
||||||
filmSimulations,
|
films,
|
||||||
focalLengths,
|
focalLengths,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
getPhotosMetaCached()
|
getPhotosMetaCached()
|
||||||
@ -24,7 +24,7 @@ export default async function CommandK() {
|
|||||||
cameras={cameras}
|
cameras={cameras}
|
||||||
lenses={lenses}
|
lenses={lenses}
|
||||||
tags={tags}
|
tags={tags}
|
||||||
simulations={filmSimulations}
|
films={films}
|
||||||
recipes={recipes}
|
recipes={recipes}
|
||||||
focalLengths={focalLengths}
|
focalLengths={focalLengths}
|
||||||
showDebugTools={ADMIN_DEBUG_TOOLS_ENABLED}
|
showDebugTools={ADMIN_DEBUG_TOOLS_ENABLED}
|
||||||
@ -31,11 +31,11 @@ import {
|
|||||||
pathForPhoto,
|
pathForPhoto,
|
||||||
pathForRecipe,
|
pathForRecipe,
|
||||||
pathForTag,
|
pathForTag,
|
||||||
} from '../../app/paths';
|
} from '../app/paths';
|
||||||
import Modal from '../Modal';
|
import Modal from '../components/Modal';
|
||||||
import { clsx } from 'clsx/lite';
|
import { clsx } from 'clsx/lite';
|
||||||
import { useDebounce } from 'use-debounce';
|
import { useDebounce } from 'use-debounce';
|
||||||
import Spinner from '../Spinner';
|
import Spinner from '../components/Spinner';
|
||||||
import { usePathname, useRouter } from 'next/navigation';
|
import { usePathname, useRouter } from 'next/navigation';
|
||||||
import { useTheme } from 'next-themes';
|
import { useTheme } from 'next-themes';
|
||||||
import { BiDesktop, BiLockAlt, BiMoon, BiSun } from 'react-icons/bi';
|
import { BiDesktop, BiLockAlt, BiMoon, BiSun } from 'react-icons/bi';
|
||||||
@ -59,20 +59,20 @@ import * as VisuallyHidden from '@radix-ui/react-visually-hidden';
|
|||||||
import InsightsIndicatorDot from '@/admin/insights/InsightsIndicatorDot';
|
import InsightsIndicatorDot from '@/admin/insights/InsightsIndicatorDot';
|
||||||
import { PhotoSetCategories } from '@/category';
|
import { PhotoSetCategories } from '@/category';
|
||||||
import { formatCameraText } from '@/camera';
|
import { formatCameraText } from '@/camera';
|
||||||
import { labelForFilmSimulation } from '@/platforms/fujifilm/simulation';
|
import { labelForFilm } from '@/platforms/fujifilm/simulation';
|
||||||
import { formatFocalLength } from '@/focal';
|
import { formatFocalLength } from '@/focal';
|
||||||
import { formatRecipe } from '@/recipe';
|
import { formatRecipe } from '@/recipe';
|
||||||
import IconLens from '../icons/IconLens';
|
import IconLens from '../components/icons/IconLens';
|
||||||
import { formatLensText } from '@/lens';
|
import { formatLensText } from '@/lens';
|
||||||
import IconTag from '../icons/IconTag';
|
import IconTag from '../components/icons/IconTag';
|
||||||
import IconCamera from '../icons/IconCamera';
|
import IconCamera from '../components/icons/IconCamera';
|
||||||
import IconPhoto from '../icons/IconPhoto';
|
import IconPhoto from '../components/icons/IconPhoto';
|
||||||
import IconRecipe from '../icons/IconRecipe';
|
import IconRecipe from '../components/icons/IconRecipe';
|
||||||
import IconFocalLength from '../icons/IconFocalLength';
|
import IconFocalLength from '../components/icons/IconFocalLength';
|
||||||
import IconFilm from '../icons/IconFilm';
|
import IconFilm from '../components/icons/IconFilm';
|
||||||
import IconLock from '../icons/IconLock';
|
import IconLock from '../components/icons/IconLock';
|
||||||
import useVisualViewportHeight from '@/utility/useVisualViewport';
|
import useVisualViewportHeight from '@/utility/useVisualViewport';
|
||||||
import useMaskedScroll from '../useMaskedScroll';
|
import useMaskedScroll from '../components/useMaskedScroll';
|
||||||
|
|
||||||
const DIALOG_TITLE = 'Global Command-K Menu';
|
const DIALOG_TITLE = 'Global Command-K Menu';
|
||||||
const DIALOG_DESCRIPTION = 'For searching photos, views, and settings';
|
const DIALOG_DESCRIPTION = 'For searching photos, views, and settings';
|
||||||
@ -112,7 +112,7 @@ export default function CommandKClient({
|
|||||||
lenses,
|
lenses,
|
||||||
tags,
|
tags,
|
||||||
recipes,
|
recipes,
|
||||||
simulations,
|
films,
|
||||||
focalLengths,
|
focalLengths,
|
||||||
showDebugTools,
|
showDebugTools,
|
||||||
footer,
|
footer,
|
||||||
@ -335,11 +335,11 @@ export default function CommandKClient({
|
|||||||
case 'films': return {
|
case 'films': return {
|
||||||
heading: 'Film Simulations',
|
heading: 'Film Simulations',
|
||||||
accessory: <IconFilm size={14} />,
|
accessory: <IconFilm size={14} />,
|
||||||
items: simulations.map(({ simulation, count }) => ({
|
items: films.map(({ film, count }) => ({
|
||||||
label: labelForFilmSimulation(simulation).medium,
|
label: labelForFilm(film).medium,
|
||||||
annotation: formatCount(count),
|
annotation: formatCount(count),
|
||||||
annotationAria: formatCountDescriptive(count),
|
annotationAria: formatCountDescriptive(count),
|
||||||
path: pathForFilmSimulation(simulation),
|
path: pathForFilmSimulation(film),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
case 'focal-lengths': return {
|
case 'focal-lengths': return {
|
||||||
@ -355,7 +355,7 @@ export default function CommandKClient({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(Boolean) as CommandKSection[]
|
.filter(Boolean) as CommandKSection[]
|
||||||
, [tagsIncludingHidden, cameras, lenses, recipes, simulations, focalLengths]);
|
, [tagsIncludingHidden, cameras, lenses, recipes, films, focalLengths]);
|
||||||
|
|
||||||
const clientSections: CommandKSection[] = [{
|
const clientSections: CommandKSection[] = [{
|
||||||
heading: 'Theme',
|
heading: 'Theme',
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { clsx } from 'clsx/lite';
|
import { clsx } from 'clsx/lite';
|
||||||
import { Command } from 'cmdk';
|
import { Command } from 'cmdk';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import Spinner from '../Spinner';
|
import Spinner from '../components/Spinner';
|
||||||
|
|
||||||
export default function CommandKItem({
|
export default function CommandKItem({
|
||||||
label,
|
label,
|
||||||
@ -20,7 +20,7 @@ export default function FilmHeader({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<PhotoHeader
|
<PhotoHeader
|
||||||
simulation={simulation}
|
film={simulation}
|
||||||
entity={<PhotoFilm {...{ simulation }} />}
|
entity={<PhotoFilm {...{ simulation }} />}
|
||||||
entityDescription={descriptionForFilmSimulationPhotos(
|
entityDescription={descriptionForFilmSimulationPhotos(
|
||||||
photos, undefined, count, dateRange)}
|
photos, undefined, count, dateRange)}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export default function FilmOverview({
|
|||||||
cacheKey: `simulation-${simulation}`,
|
cacheKey: `simulation-${simulation}`,
|
||||||
photos,
|
photos,
|
||||||
count,
|
count,
|
||||||
simulation,
|
film: simulation,
|
||||||
header: <FilmHeader {...{
|
header: <FilmHeader {...{
|
||||||
simulation,
|
simulation,
|
||||||
photos,
|
photos,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { labelForFilmSimulation } from '@/platforms/fujifilm/simulation';
|
import { labelForFilm } from '@/platforms/fujifilm/simulation';
|
||||||
import PhotoFilmIcon from './PhotoFilmIcon';
|
import PhotoFilmIcon from './PhotoFilmIcon';
|
||||||
import { pathForFilmSimulation } from '@/app/paths';
|
import { pathForFilmSimulation } from '@/app/paths';
|
||||||
import { FilmSimulation } from '.';
|
import { FilmSimulation } from '.';
|
||||||
@ -20,7 +20,7 @@ export default function PhotoFilm({
|
|||||||
countOnHover?: number
|
countOnHover?: number
|
||||||
recipe?: FujifilmRecipe
|
recipe?: FujifilmRecipe
|
||||||
} & EntityLinkExternalProps) {
|
} & EntityLinkExternalProps) {
|
||||||
const { small, medium, large } = labelForFilmSimulation(simulation);
|
const { small, medium, large } = labelForFilm(simulation);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EntityLink
|
<EntityLink
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
import { labelForFilmSimulation } from '@/platforms/fujifilm/simulation';
|
import { labelForFilm } from '@/platforms/fujifilm/simulation';
|
||||||
import { CSSProperties } from 'react';
|
import { CSSProperties } from 'react';
|
||||||
import { FilmSimulation } from '.';
|
import { FilmSimulation } from '.';
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ export default function PhotoFilmIcon({
|
|||||||
className={className}
|
className={className}
|
||||||
style={style}
|
style={style}
|
||||||
aria-description={simulation
|
aria-description={simulation
|
||||||
? labelForFilmSimulation(simulation).large
|
? labelForFilm(simulation).large
|
||||||
: 'Film Simulation'}
|
: 'Film Simulation'}
|
||||||
width={INTRINSIC_WIDTH * height / INTRINSIC_HEIGHT}
|
width={INTRINSIC_WIDTH * height / INTRINSIC_HEIGHT}
|
||||||
height={height}
|
height={height}
|
||||||
|
|||||||
@ -12,6 +12,6 @@ export const getPhotosFilmSimulationDataCached = ({
|
|||||||
limit?: number,
|
limit?: number,
|
||||||
}) =>
|
}) =>
|
||||||
Promise.all([
|
Promise.all([
|
||||||
getPhotosCached({ simulation, limit }),
|
getPhotosCached({ film: simulation, limit }),
|
||||||
getPhotosMetaCached({ simulation }),
|
getPhotosMetaCached({ film: simulation }),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -10,44 +10,44 @@ import {
|
|||||||
} from '@/app/paths';
|
} from '@/app/paths';
|
||||||
import {
|
import {
|
||||||
FujifilmSimulation,
|
FujifilmSimulation,
|
||||||
labelForFilmSimulation,
|
labelForFilm,
|
||||||
} from '@/platforms/fujifilm/simulation';
|
} from '@/platforms/fujifilm/simulation';
|
||||||
|
|
||||||
export type FilmSimulation = FujifilmSimulation;
|
export type FilmSimulation = FujifilmSimulation;
|
||||||
|
|
||||||
export type FilmSimulationWithCount = {
|
export type FilmSimulationWithCount = {
|
||||||
simulation: FilmSimulation
|
film: FilmSimulation
|
||||||
count: number
|
count: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FilmSimulations = FilmSimulationWithCount[]
|
export type FilmSimulations = FilmSimulationWithCount[]
|
||||||
|
|
||||||
export const sortFilmSimulations = (
|
export const sortFilms = (
|
||||||
simulations: FilmSimulations,
|
films: FilmSimulations,
|
||||||
) => simulations.sort(sortFilmSimulationsWithCount);
|
) => films.sort(sortFilmsWithCount);
|
||||||
|
|
||||||
export const sortFilmSimulationsWithCount = (
|
export const sortFilmsWithCount = (
|
||||||
a: FilmSimulationWithCount,
|
a: FilmSimulationWithCount,
|
||||||
b: FilmSimulationWithCount,
|
b: FilmSimulationWithCount,
|
||||||
) => {
|
) => {
|
||||||
const aLabel = labelForFilmSimulation(a.simulation).large;
|
const aLabel = labelForFilm(a.film).large;
|
||||||
const bLabel = labelForFilmSimulation(b.simulation).large;
|
const bLabel = labelForFilm(b.film).large;
|
||||||
return aLabel.localeCompare(bLabel);
|
return aLabel.localeCompare(bLabel);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const titleForFilmSimulation = (
|
export const titleForFilmSimulation = (
|
||||||
simulation: FilmSimulation,
|
film: FilmSimulation,
|
||||||
photos: Photo[],
|
photos: Photo[],
|
||||||
explicitCount?: number,
|
explicitCount?: number,
|
||||||
) => [
|
) => [
|
||||||
labelForFilmSimulation(simulation).large,
|
labelForFilm(film).large,
|
||||||
photoQuantityText(explicitCount ?? photos.length),
|
photoQuantityText(explicitCount ?? photos.length),
|
||||||
].join(' ');
|
].join(' ');
|
||||||
|
|
||||||
export const shareTextForFilmSimulation = (
|
export const shareTextForFilmSimulation = (
|
||||||
simulation: FilmSimulation,
|
film: FilmSimulation,
|
||||||
) =>
|
) =>
|
||||||
`Photos shot on Fujifilm ${labelForFilmSimulation(simulation).large}`;
|
`Photos shot on Fujifilm ${labelForFilm(film).large}`;
|
||||||
|
|
||||||
export const descriptionForFilmSimulationPhotos = (
|
export const descriptionForFilmSimulationPhotos = (
|
||||||
photos: Photo[],
|
photos: Photo[],
|
||||||
@ -64,20 +64,20 @@ export const descriptionForFilmSimulationPhotos = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const generateMetaForFilmSimulation = (
|
export const generateMetaForFilmSimulation = (
|
||||||
simulation: FilmSimulation,
|
film: FilmSimulation,
|
||||||
photos: Photo[],
|
photos: Photo[],
|
||||||
explicitCount?: number,
|
explicitCount?: number,
|
||||||
explicitDateRange?: PhotoDateRange,
|
explicitDateRange?: PhotoDateRange,
|
||||||
) => ({
|
) => ({
|
||||||
url: absolutePathForFilmSimulation(simulation),
|
url: absolutePathForFilmSimulation(film),
|
||||||
title: titleForFilmSimulation(simulation, photos, explicitCount),
|
title: titleForFilmSimulation(film, photos, explicitCount),
|
||||||
description: descriptionForFilmSimulationPhotos(
|
description: descriptionForFilmSimulationPhotos(
|
||||||
photos,
|
photos,
|
||||||
true,
|
true,
|
||||||
explicitCount,
|
explicitCount,
|
||||||
explicitDateRange,
|
explicitDateRange,
|
||||||
),
|
),
|
||||||
images: absolutePathForFilmSimulationImage(simulation),
|
images: absolutePathForFilmSimulationImage(film),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const photoHasFilmSimulationData = (photo: Photo) =>
|
export const photoHasFilmSimulationData = (photo: Photo) =>
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import ImageCaption from './components/ImageCaption';
|
|||||||
import ImagePhotoGrid from './components/ImagePhotoGrid';
|
import ImagePhotoGrid from './components/ImagePhotoGrid';
|
||||||
import ImageContainer from './components/ImageContainer';
|
import ImageContainer from './components/ImageContainer';
|
||||||
import {
|
import {
|
||||||
labelForFilmSimulation,
|
labelForFilm,
|
||||||
} from '@/platforms/fujifilm/simulation';
|
} from '@/platforms/fujifilm/simulation';
|
||||||
import PhotoFilmIcon from
|
import PhotoFilmIcon from
|
||||||
'@/film/PhotoFilmIcon';
|
'@/film/PhotoFilmIcon';
|
||||||
@ -41,7 +41,7 @@ export default function FilmImageResponse({
|
|||||||
height={height * .081}
|
height={height * .081}
|
||||||
style={{ transform: `translateY(${height * .001}px)`}}
|
style={{ transform: `translateY(${height * .001}px)`}}
|
||||||
/>,
|
/>,
|
||||||
title: labelForFilmSimulation(simulation).medium.toLocaleUpperCase(),
|
title: labelForFilm(simulation).medium.toLocaleUpperCase(),
|
||||||
}} />
|
}} />
|
||||||
</ImageContainer>
|
</ImageContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export default function InfinitePhotoScroll({
|
|||||||
tag,
|
tag,
|
||||||
camera,
|
camera,
|
||||||
lens,
|
lens,
|
||||||
simulation,
|
film: simulation,
|
||||||
wrapMoreButtonInGrid,
|
wrapMoreButtonInGrid,
|
||||||
useCachedPhotos = true,
|
useCachedPhotos = true,
|
||||||
includeHiddenPhotos,
|
includeHiddenPhotos,
|
||||||
@ -73,7 +73,7 @@ export default function InfinitePhotoScroll({
|
|||||||
camera,
|
camera,
|
||||||
lens,
|
lens,
|
||||||
tag,
|
tag,
|
||||||
simulation,
|
film: simulation,
|
||||||
}, warmOnly)
|
}, warmOnly)
|
||||||
, [
|
, [
|
||||||
useCachedPhotos,
|
useCachedPhotos,
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export default function PhotoDetailPage({
|
|||||||
tag,
|
tag,
|
||||||
camera,
|
camera,
|
||||||
lens,
|
lens,
|
||||||
simulation,
|
film: simulation,
|
||||||
recipe,
|
recipe,
|
||||||
focal,
|
focal,
|
||||||
indexNumber,
|
indexNumber,
|
||||||
@ -149,7 +149,7 @@ export default function PhotoDetailPage({
|
|||||||
selectedPhoto={photo}
|
selectedPhoto={photo}
|
||||||
tag={tag}
|
tag={tag}
|
||||||
camera={camera}
|
camera={camera}
|
||||||
simulation={simulation}
|
film={simulation}
|
||||||
focal={focal}
|
focal={focal}
|
||||||
animateOnFirstLoadOnly
|
animateOnFirstLoadOnly
|
||||||
/>}
|
/>}
|
||||||
|
|||||||
@ -48,7 +48,7 @@ export default function PhotoGridSidebar({
|
|||||||
cameras,
|
cameras,
|
||||||
lenses,
|
lenses,
|
||||||
tags,
|
tags,
|
||||||
simulations,
|
films: simulations,
|
||||||
recipes,
|
recipes,
|
||||||
focalLengths,
|
focalLengths,
|
||||||
} = categories;
|
} = categories;
|
||||||
@ -199,7 +199,7 @@ export default function PhotoGridSidebar({
|
|||||||
icon={<IconFilm size={15} />}
|
icon={<IconFilm size={15} />}
|
||||||
maxItems={maxItemsPerCategory}
|
maxItems={maxItemsPerCategory}
|
||||||
items={simulations
|
items={simulations
|
||||||
.map(({ simulation, count }) =>
|
.map(({ film: simulation, count }) =>
|
||||||
<PhotoFilm
|
<PhotoFilm
|
||||||
key={simulation}
|
key={simulation}
|
||||||
simulation={simulation}
|
simulation={simulation}
|
||||||
|
|||||||
@ -464,7 +464,7 @@ export default function PhotoLarge({
|
|||||||
tag={shouldShareTag ? primaryTag : undefined}
|
tag={shouldShareTag ? primaryTag : undefined}
|
||||||
camera={shouldShareCamera ? camera : undefined}
|
camera={shouldShareCamera ? camera : undefined}
|
||||||
lens={shouldShareLens ? lens : undefined}
|
lens={shouldShareLens ? lens : undefined}
|
||||||
simulation={shouldShareSimulation
|
film={shouldShareSimulation
|
||||||
? photo.filmSimulation
|
? photo.filmSimulation
|
||||||
: undefined}
|
: undefined}
|
||||||
recipe={shouldShareRecipe
|
recipe={shouldShareRecipe
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export const getWheresFromOptions = (
|
|||||||
tag,
|
tag,
|
||||||
camera,
|
camera,
|
||||||
lens,
|
lens,
|
||||||
simulation,
|
film: simulation,
|
||||||
recipe,
|
recipe,
|
||||||
focal,
|
focal,
|
||||||
} = options;
|
} = options;
|
||||||
|
|||||||
@ -417,7 +417,7 @@ export const getUniqueFilmSimulations = async () =>
|
|||||||
ORDER BY film_simulation ASC
|
ORDER BY film_simulation ASC
|
||||||
`.then(({ rows }): FilmSimulations => rows
|
`.then(({ rows }): FilmSimulations => rows
|
||||||
.map(({ film_simulation, count }) => ({
|
.map(({ film_simulation, count }) => ({
|
||||||
simulation: film_simulation as FilmSimulation,
|
film: film_simulation as FilmSimulation,
|
||||||
count: parseInt(count, 10),
|
count: parseInt(count, 10),
|
||||||
})))
|
})))
|
||||||
, 'getUniqueFilmSimulations');
|
, 'getUniqueFilmSimulations');
|
||||||
|
|||||||
@ -225,8 +225,8 @@ const ALL_POSSIBLE_FILM_SIMULATION_LABELS = Object
|
|||||||
export const isStringFilmSimulation = (simulation: string) =>
|
export const isStringFilmSimulation = (simulation: string) =>
|
||||||
ALL_POSSIBLE_FILM_SIMULATION_LABELS.includes(simulation.toLocaleLowerCase());
|
ALL_POSSIBLE_FILM_SIMULATION_LABELS.includes(simulation.toLocaleLowerCase());
|
||||||
|
|
||||||
export const labelForFilmSimulation = (simulation: FujifilmSimulation) =>
|
export const labelForFilm = (film: FujifilmSimulation) =>
|
||||||
FILM_SIMULATION_LABELS[simulation];
|
FILM_SIMULATION_LABELS[film];
|
||||||
|
|
||||||
export const getFujifilmSimulationFromMakerNote = (
|
export const getFujifilmSimulationFromMakerNote = (
|
||||||
bytes: Buffer,
|
bytes: Buffer,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import {
|
|||||||
generateRecipeText,
|
generateRecipeText,
|
||||||
RecipeProps,
|
RecipeProps,
|
||||||
} from '.';
|
} from '.';
|
||||||
import { labelForFilmSimulation } from '@/platforms/fujifilm/simulation';
|
import { labelForFilm } from '@/platforms/fujifilm/simulation';
|
||||||
import { TbChecklist } from 'react-icons/tb';
|
import { TbChecklist } from 'react-icons/tb';
|
||||||
import CopyButton from '@/components/CopyButton';
|
import CopyButton from '@/components/CopyButton';
|
||||||
import { pathForRecipe } from '@/app/paths';
|
import { pathForRecipe } from '@/app/paths';
|
||||||
@ -147,7 +147,7 @@ export default function PhotoRecipeOverlay({
|
|||||||
<div className="col-span-8">
|
<div className="col-span-8">
|
||||||
{renderDataSquare(
|
{renderDataSquare(
|
||||||
<div className="flex items-center gap-1.5">
|
<div className="flex items-center gap-1.5">
|
||||||
{labelForFilmSimulation(simulation).medium.toLocaleUpperCase()}
|
{labelForFilm(simulation).medium.toLocaleUpperCase()}
|
||||||
<PhotoFilm
|
<PhotoFilm
|
||||||
contrast="frosted"
|
contrast="frosted"
|
||||||
simulation={simulation}
|
simulation={simulation}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
} from '@/utility/string';
|
} from '@/utility/string';
|
||||||
import { FujifilmRecipe } from '@/platforms/fujifilm/recipe';
|
import { FujifilmRecipe } from '@/platforms/fujifilm/recipe';
|
||||||
import { FilmSimulation } from '@/film';
|
import { FilmSimulation } from '@/film';
|
||||||
import { labelForFilmSimulation } from '@/platforms/fujifilm/simulation';
|
import { labelForFilm } from '@/platforms/fujifilm/simulation';
|
||||||
|
|
||||||
export type RecipeWithCount = {
|
export type RecipeWithCount = {
|
||||||
recipe: string
|
recipe: string
|
||||||
@ -62,7 +62,7 @@ export const generateRecipeText = ({
|
|||||||
abbreviate?: boolean,
|
abbreviate?: boolean,
|
||||||
) => {
|
) => {
|
||||||
const lines = [
|
const lines = [
|
||||||
`${labelForFilmSimulation(simulation).small.toLocaleUpperCase()}`,
|
`${labelForFilm(simulation).small.toLocaleUpperCase()}`,
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
`${formatWhiteBalance(recipe).toLocaleUpperCase()} ${formatWhiteBalanceColor(recipe)}`,
|
`${formatWhiteBalance(recipe).toLocaleUpperCase()} ${formatWhiteBalanceColor(recipe)}`,
|
||||||
];
|
];
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export default function ShareModals() {
|
|||||||
camera,
|
camera,
|
||||||
lens,
|
lens,
|
||||||
tag,
|
tag,
|
||||||
simulation,
|
film: simulation,
|
||||||
recipe,
|
recipe,
|
||||||
focal,
|
focal,
|
||||||
} = shareModalProps;
|
} = shareModalProps;
|
||||||
@ -30,7 +30,7 @@ export default function ShareModals() {
|
|||||||
photo,
|
photo,
|
||||||
tag,
|
tag,
|
||||||
camera,
|
camera,
|
||||||
simulation,
|
film: simulation,
|
||||||
recipe,
|
recipe,
|
||||||
focal,
|
focal,
|
||||||
}} />;
|
}} />;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export const getSharePathFromShareModalProps = ({
|
|||||||
lens,
|
lens,
|
||||||
tag,
|
tag,
|
||||||
recipe,
|
recipe,
|
||||||
simulation,
|
film: simulation,
|
||||||
focal,
|
focal,
|
||||||
}: ShareModalProps) => {
|
}: ShareModalProps) => {
|
||||||
if (photo) {
|
if (photo) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user