@samitouri / QOSami-HFS / commits / 8ce0b4ce

ux: admin/custom html: better names for top and bottom

Massimo Melina committed Jan 9, 2024 at 17:49 UTC 8ce0b4ce930d615d32cca9b321f47b55754db826
1 file changed +6 -1
admin/src/CustomHtmlPage.ts
+6 -1
@@ -12,6 +12,11 @@ import { useDebounce } from 'usehooks-ts'
12 import md from './md'
13 import { TextEditor } from './TextEditor';
14
15 +const names: any = {
16 + top: "Top of HTML Body",
17 + bottom: "Bottom of HTML Body",
18 +}
19 +
20 export default function CustomHtmlPage() {
21 const { data, reload } = useApiEx<{ sections: Dict<string> }>('get_custom_html')
22 const [section, setSection] = useState('')
@@ -25,7 +30,7 @@ export default function CustomHtmlPage() {
30 setSection(_.findKey(all, Boolean) || keys?.[0] || '') // prefer any key with content
31 return keys.map(x => ({
32 value: x,
28 - label: (prefix('HTTP ', HTTP_MESSAGES[x as any]) || _.startCase(x)) + (all[x]?.trim() ? ' *' : '')
33 + label: (names[x] || prefix('HTTP ', HTTP_MESSAGES[x as any]) || _.startCase(x)) + (all[x]?.trim() ? ' *' : '')
34 }))
35 }, [useDebounce(all, 500)])
36 const anyChange = useMemo(() => !_.isEqualWith(saved, all, (a,b) => !a && !b || undefined),