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 / App.js

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

72 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Dashboard layout.
3 *
4 * Figures across the top, then the store's shape on the left with everything
5 * that wants doing on the right, then where to go next.
6 */
7
8 import { __ } from "@wordpress/i18n";
9 // TODO(refactor): replace @wordpress/components with our `wpsubs-*` admin
10 // components (wpsubs-table-card, wpsubs-btn, …) — see src/dashboard/index.js.
11 import { Card, CardHeader, CardBody, Button } from "@wordpress/components";
12 import StatTiles from "./StatTiles";
13 import SalesChart from "./SalesChart";
14 import HealthBanner from "./HealthBanner";
15 import SetupChecklist from "./SetupChecklist";
16 import BuildCards from "./BuildCards";
17 import FooterLinks from "./FooterLinks";
18 import ProBadge from "./ProBadge";
19
20 export default function App({ data }) {
21 const { pulse = [], chart, health, setup, build = [], footer = [] } = data;
22
23 return (
24 <div className="subscrpt-dash">
25 <Card className="subscrpt-dash__pulse">
26 <CardHeader>
27 <div>
28 <h2 className="subscrpt-heading">{__("Subscription pulse", "subscription")}</h2>
29 <p className="subscrpt-sub">
30 {__("Live counts of subscriptions and renewal activity in your store.", "subscription")}
31 </p>
32 </div>
33 </CardHeader>
34 <CardBody>
35 <StatTiles items={pulse} />
36 </CardBody>
37 </Card>
38
39 <div className="subscrpt-dash__split">
40 <div className="subscrpt-dash__main">
41 {chart && (
42 <Card>
43 <CardHeader>
44 <div>
45 <h2 className="subscrpt-heading">{__("Monthly sales", "subscription")}</h2>
46 <p className="subscrpt-sub">{__("Revenue from subscription orders.", "subscription")}</p>
47 </div>
48 <Button variant="tertiary" href={chart.url}>
49 {__("Open reports", "subscription")}
50 {chart.pro && " "}
51 {chart.pro && <ProBadge />}
52 </Button>
53 </CardHeader>
54 <CardBody>
55 <SalesChart chart={chart} />
56 </CardBody>
57 </Card>
58 )}
59 </div>
60
61 <aside className="subscrpt-dash__aside">
62 {health && <HealthBanner health={health} />}
63 {setup && <SetupChecklist setup={setup} />}
64 </aside>
65 </div>
66
67 <BuildCards cards={build} />
68 <FooterLinks links={footer} />
69 </div>
70 );
71 }
72