diff --git a/package.json b/package.json index 4d7425d..d8534f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "siteforge", "private": true, - "version": "1.1.37", + "version": "1.1.38", "type": "module", "scripts": { "dev": "vite", diff --git a/src/AdminPage.tsx b/src/AdminPage.tsx index bc79e04..281ac5e 100644 --- a/src/AdminPage.tsx +++ b/src/AdminPage.tsx @@ -699,7 +699,7 @@ type StringField = Exclude) { if (placement === 'footer') return 'Footer navigation links' if (placement === 'otherSites') return 'Other site links in footer dropdown' if (placement === 'externalSites') return 'Homepage external site links' + if (placement === 'books') return 'Downloads page (Reading List)' + if (placement === 'recommended') return 'Downloads page (Recommended Resources)' return 'Downloads page (More Resources)' } function getCustomLinkPreviewPath(placement: CustomLink['placement']) { if (placement === 'resources') return '/resources' + if (placement === 'books') return '/resources' + if (placement === 'recommended') return '/resources' return '/' } @@ -2162,6 +2168,26 @@ async function handleAssetUpload(event: ChangeEvent) { })) } + function addBook() { + setForm(f => ({ + ...f, + customLinks: [ + ...(f.customLinks ?? []), + { id: Date.now().toString(36), label: '', url: '', imageUrl: '', description: '', amazonUrl: '', amazonLabel: 'View on Amazon', placement: 'books' as const }, + ], + })) + } + + function addRecommended() { + setForm(f => ({ + ...f, + customLinks: [ + ...(f.customLinks ?? []), + { id: Date.now().toString(36), label: '', url: '', imageUrl: '', description: '', placement: 'recommended' as const }, + ], + })) + } + function updateLink(id: string, field: keyof CustomLink, value: string | string[]) { setForm(f => ({ ...f, @@ -3828,6 +3854,14 @@ async function handleAssetUpload(event: ChangeEvent) {