index.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Button, defineDashboardExtension } from '@vendure/dashboard';
  2. import { CustomWidget } from './custom-widget';
  3. import { reviewDetail } from './review-detail';
  4. import { reviewList } from './review-list';
  5. export default defineDashboardExtension({
  6. routes: [reviewList, reviewDetail],
  7. widgets: [
  8. {
  9. id: 'custom-widget',
  10. name: 'Custom Widget',
  11. component: CustomWidget,
  12. defaultSize: { w: 3, h: 3 },
  13. },
  14. ],
  15. actionBarItems: [
  16. {
  17. label: 'Custom Action Bar Item',
  18. component: props => {
  19. return <Button>YOLO swag</Button>;
  20. },
  21. locationId: 'product-detail',
  22. },
  23. ],
  24. pageBlocks: [
  25. {
  26. id: 'my-block',
  27. component: ({ context }) => {
  28. return <div>Here is my custom block!</div>;
  29. },
  30. title: 'My Custom Block',
  31. location: {
  32. pageId: 'product-detail',
  33. column: 'side',
  34. position: { blockId: 'main-form', order: 'after' },
  35. },
  36. },
  37. ],
  38. });