index.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 type="button" onClick={() => {
  20. console.log('Clicked custom action bar item');
  21. }}>Test Button</Button>;
  22. },
  23. locationId: 'product-detail',
  24. },
  25. ],
  26. pageBlocks: [
  27. {
  28. id: 'my-block',
  29. component: ({ context }) => {
  30. return <div>Here is my custom block!</div>;
  31. },
  32. title: 'My Custom Block',
  33. location: {
  34. pageId: 'product-detail',
  35. column: 'side',
  36. position: { blockId: 'main-form', order: 'after' },
  37. },
  38. },
  39. ],
  40. });