mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +00:00
fix(book): a summary's and a country's look are optional, so a stored book reads and saves as it did
Absent means the classic look. Defaulting it wrote the field into every element the auto layout and the templates build, which moved their parity fixtures and grew the page tools past their schema ceiling; the new descriptions are also shorter for the same reason.
This commit is contained in:
@@ -253,7 +253,7 @@ export function CountryLookView({ el, frameStyle }: { el: BookCountriesElement;
|
||||
const key = `${c.code}-${i}`;
|
||||
if (el.look === 'stamp') return <Stamp key={key} el={el} c={c} size={Math.min(cellW, cellH)} />;
|
||||
if (el.look === 'postcard') return <Postcard key={key} el={el} c={c} w={cellW} h={cellH} />;
|
||||
const Look = MORE[el.look] ?? Visa;
|
||||
const Look = MORE[el.look ?? 'visa'] ?? Visa;
|
||||
return <Look key={key} el={el} code={c.code} name={c.name} w={cellW} h={cellH} />;
|
||||
})}
|
||||
</div>
|
||||
|
||||
@@ -509,7 +509,7 @@ export function StatsLookView({ el, frameStyle }: { el: BookStatsElement; frameS
|
||||
...metricValue(metric, el.values, el.units, locale),
|
||||
label: t(`journey.studio.metric.${metric}`),
|
||||
}));
|
||||
const Look = LOOKS[el.look] ?? PosterLook;
|
||||
const Look = LOOKS[el.look ?? 'poster'] ?? PosterLook;
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
|
||||
@@ -37,7 +37,7 @@ import { studioTravelContext } from '../studioTravelContext';
|
||||
*/
|
||||
|
||||
/** The figures a summary offers: how far, how long, where, and how much was kept. */
|
||||
export const SUMMARY_METRICS: BookMetric[] = ['distance', 'days', 'countries', 'photos'];
|
||||
const SUMMARY_METRICS: BookMetric[] = ['distance', 'days', 'countries', 'photos'];
|
||||
|
||||
/** The looks of a summary, in the order the panel offers them. */
|
||||
export const SUMMARY_LOOKS: BookStatsLook[] = [
|
||||
|
||||
Reference in New Issue
Block a user