blocks
4 days ago
common
1 year ago
components
6 months ago
containers
1 year ago
errors
2 years ago
hooks
2 years ago
promos
1 year ago
settings
1 year ago
stores
2 years ago
styles
1 year ago
supports
2 years ago
types
1 year ago
App.scss
2 years ago
App.tsx
6 months ago
blocks.json
1 year ago
index.tsx
2 years ago
index.tsx
52 lines
| 1 | import {createRoot, render, StrictMode} from '@wordpress/element'; |
| 2 | import {getCategories, setCategories} from '@wordpress/blocks'; |
| 3 | import registerBlocks from './common/registerBlocks'; |
| 4 | import registerHooks from './supports'; |
| 5 | import registerComponents from './components'; |
| 6 | import {__} from '@wordpress/i18n'; |
| 7 | |
| 8 | import App from './App'; |
| 9 | |
| 10 | setCategories([ |
| 11 | ...getCategories(), |
| 12 | { |
| 13 | slug: 'input', |
| 14 | title: __('Input Fields', 'give'), |
| 15 | }, |
| 16 | { |
| 17 | slug: 'content', |
| 18 | title: __('Content & Media', 'give'), |
| 19 | }, |
| 20 | { |
| 21 | // layout seems to be a core category slug |
| 22 | slug: 'section', |
| 23 | title: __('Layout', 'give'), |
| 24 | }, |
| 25 | { |
| 26 | slug: 'custom', |
| 27 | title: __('Custom Fields', 'give'), |
| 28 | }, |
| 29 | { |
| 30 | slug: 'addons', |
| 31 | title: __('Add-ons', 'give'), |
| 32 | }, |
| 33 | ]); |
| 34 | |
| 35 | registerHooks(); |
| 36 | registerComponents(); |
| 37 | registerBlocks(); |
| 38 | |
| 39 | const root = document.getElementById('root'); |
| 40 | |
| 41 | const RenderApp = () => ( |
| 42 | <StrictMode> |
| 43 | <App /> |
| 44 | </StrictMode> |
| 45 | ); |
| 46 | |
| 47 | if (createRoot) { |
| 48 | createRoot(root).render(<RenderApp />); |
| 49 | } else { |
| 50 | render(<RenderApp />, root); |
| 51 | } |
| 52 |