Replace hardcoded 'Ditto' with appConfig.appName and appConfig.appId

User-facing display strings now read from config.appName so forks can
rebrand without code changes, and localStorage keys are namespaced by
config.appId so forks running on the same origin don't clobber each
other's preferences. Module-level cache-key constants that previously
hardcoded 'ditto:' have been refactored into hook-scoped reads from
config.appId (via a new getStorageKey() helper). The helpContent FAQ
template now uses {appName} placeholders substituted at read-time
through getFAQCategories(appName)/getFAQItem(appName, id).
This commit is contained in:
Alex Gleason
2026-04-17 11:01:04 -05:00
parent 9837c23a96
commit 52e42fcd6e
27 changed files with 251 additions and 142 deletions
+6 -3
View File
@@ -6,7 +6,8 @@ import {
AccordionItem,
AccordionTrigger,
} from '@/components/ui/accordion';
import { FAQ_CATEGORIES, type FAQCategory, type FAQItem } from '@/lib/helpContent';
import { useAppContext } from '@/hooks/useAppContext';
import { getFAQCategories, type FAQCategory, type FAQItem } from '@/lib/helpContent';
// ── Inline markup renderer ────────────────────────────────────────────────────
@@ -87,8 +88,10 @@ interface HelpFAQSectionProps {
* <HelpFAQSection items={['what-are-relays', 'what-are-blossom']} hideHeadings />
*/
export function HelpFAQSection({ categories, items, hideHeadings, className }: HelpFAQSectionProps) {
const { config } = useAppContext();
const filteredCategories = useMemo(() => {
let cats: FAQCategory[] = FAQ_CATEGORIES;
let cats: FAQCategory[] = getFAQCategories(config.appName);
// Filter to specific categories
if (categories) {
@@ -106,7 +109,7 @@ export function HelpFAQSection({ categories, items, hideHeadings, className }: H
}
return cats;
}, [categories, items]);
}, [categories, items, config.appName]);
if (filteredCategories.length === 0) return null;