PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.0.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.0.0
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
subscription / src / dashboard / index.js

index.js in Subscriptions for WooCommerce with Stripe Recurring Payments 2.0.0, at src/dashboard/index.js

32 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WPSubscription dashboard.
3 *
4 * A small React screen built on @wordpress/components, so it looks like
5 * WordPress rather than like a second design system bolted into wp-admin.
6 *
7 * Everything shown is preloaded on `window.subscrptDashboard` by
8 * Admin\Dashboard::enqueue() — none of these figures change while the page is
9 * open, so there is nothing to fetch.
10 *
11 * The stylesheet lives in src/css/ because webpack.config.js prepends
12 * `@import "colors"` to every .scss outside that directory, which fails to
13 * resolve for anything that does not want the colour partial.
14 *
15 * TODO(refactor): migrate this dashboard off @wordpress/components and onto our
16 * own admin components (the `wpsubs-*` system in assets/css/admin-components/ —
17 * Card/CardHeader/CardBody -> `wpsubs-table-card`, Button -> `wpsubs-btn`, etc.)
18 * so the whole admin uses one consistent design system instead of two. Applies
19 * to every @wordpress/components import in this folder (App, HealthBanner,
20 * SetupChecklist).
21 */
22
23 import { createRoot } from "@wordpress/element";
24 import App from "./App";
25 import "../css/dashboard.scss";
26
27 const node = document.getElementById("subscrpt-dashboard");
28
29 if (node && window.subscrptDashboard) {
30 createRoot(node).render(<App data={window.subscrptDashboard} />);
31 }
32