Define Pages
// src/mock-server/mock-data/pages/index.ts
import {
PageFactoryService,
Pages,
cmsParagraphComponent,
contentSlot,
} from '@valantic/spartacus-mock';
import { customSlots } from './slots';
export const contentPages = (): Pages => {
// pass in your customSlots function if you need custom slots, otherwise pass in empty array
const pageFactoryService = new PageFactoryService(
customSlots()
);
return {
'hello-world': pageFactoryService.createContentPage(
'/hello-world',
'Hello World',
[
contentSlot('Section2A', [
cmsParagraphComponent('Hello World!'),
]),
]
),
// overrides the default page with page label /contact
contact: pageFactoryService.createContentPage(
'/contact',
'Contact Custom',
[
contentSlot('Section2A', [
cmsParagraphComponent('Custom Contact Page!'),
]),
]
),
};
};Last updated