@dfosco/storyboard-react 1.17.1 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Viewfinder.jsx +8 -1
package/package.json
CHANGED
package/src/Viewfinder.jsx
CHANGED
|
@@ -3,6 +3,13 @@ import { useState, useEffect, useMemo } from 'react'
|
|
|
3
3
|
import { hash, resolveSceneRoute, getSceneMeta } from '@dfosco/storyboard-core'
|
|
4
4
|
import styles from './Viewfinder.module.css'
|
|
5
5
|
|
|
6
|
+
function formatSceneName(name) {
|
|
7
|
+
return name
|
|
8
|
+
.split('-')
|
|
9
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
10
|
+
.join(' ')
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
function PlaceholderGraphic({ name }) {
|
|
7
14
|
const seed = hash(name)
|
|
8
15
|
const rects = []
|
|
@@ -180,7 +187,7 @@ export default function Viewfinder({ scenes = {}, pageModules = {}, basePath, ti
|
|
|
180
187
|
<div className={showThumbnails ? styles.grid : styles.list}>
|
|
181
188
|
{sceneNames.map((name) => {
|
|
182
189
|
const meta = getSceneMeta(name)
|
|
183
|
-
const displayName = meta?.name || name
|
|
190
|
+
const displayName = meta?.title || meta?.name || formatSceneName(name)
|
|
184
191
|
return (
|
|
185
192
|
<a key={name} href={resolveSceneRoute(name, knownRoutes)} className={showThumbnails ? styles.card : styles.listItem}>
|
|
186
193
|
{showThumbnails && (
|