PluginProbe ʕ •ᴥ•ʔ
Presto Player / 1.5.13
Presto Player v1.5.13
4.5.0 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.4 4.2.3 4.2.2 4.2.0 4.2.1 trunk 1.10.0 1.10.1 1.10.2 1.11.0 1.12.0 1.13.0 1.14.0 1.14.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 1.6.13 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.3-beta1 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.0-beta1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.1.0 3.1.1 3.1.2 3.1.3 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4
presto-player / src / admin / settings / app.js
presto-player / src / admin / settings Last commit date
components 5 years ago pages 5 years ago scss 5 years ago store 5 years ago app.js 5 years ago index.js 5 years ago routes.js 5 years ago settings.js 5 years ago settings.scss 5 years ago util.js 5 years ago
app.js
127 lines
1 const { __ } = wp.i18n;
2 const {
3 Card,
4 SnackbarList,
5 Flex,
6 FlexBlock,
7 FlexItem,
8 Spinner,
9 } = wp.components;
10 const { dispatch, useSelect } = wp.data;
11 const { useState, useEffect } = wp.element;
12
13 import { fetchSettings } from "@/admin/settings/settings";
14
15 import { Router, Link, Route } from "@/router";
16 import { routes } from "./routes";
17
18 import SaveButton from "./components/SaveButton";
19 import General from "./pages/General";
20 import Integrations from "./pages/Integrations";
21 import Performance from "./pages/Performance";
22
23 function App() {
24 let [loading, setLoading] = useState(true);
25
26 // scroll top on history change
27 window.onhashchange = () => {
28 window.scrollTo(0, 0);
29 };
30
31 useEffect(() => {
32 fetchSettings().then(() => {
33 setLoading(false);
34 });
35 }, []);
36
37 const notices = useSelect((select) => {
38 return select("presto-player/settings").notices();
39 });
40
41 const removeNotice = (id) => {
42 dispatch("presto-player/settings").removeNotice(id);
43 };
44
45 const scrollToTop = () => {
46 window.scrollTo(0, 0);
47 };
48
49 if (loading) {
50 return (
51 <div className="presto-settings__loading">
52 <Spinner />
53 </div>
54 );
55 }
56
57 return (
58 <div className="presto-settings">
59 <Router routes={routes} defaultRoute={routes?.general?.path}>
60 <Card className="presto-settings__navigation">
61 <Flex>
62 <FlexBlock>
63 <div
64 role="tablist"
65 aria-orientation="horizontal"
66 className="components-tab-panel__tabs"
67 >
68 <Link
69 to={routes?.general?.path}
70 type="button"
71 role="tab"
72 activeClassName="is-active"
73 className="components-button components-tab-panel__tabs-item presto-player__nav-general"
74 >
75 {__("General", "presto-player")}
76 </Link>
77 <Link
78 to={routes?.integrations?.path}
79 type="button"
80 role="tab"
81 activeClassName="is-active"
82 className="components-button components-tab-panel__tabs-item presto-player__nav-integrations"
83 >
84 {__("Integrations", "presto-player")}
85 </Link>
86 <Link
87 to={routes?.performance?.path}
88 type="button"
89 role="tab"
90 activeClassName="is-active"
91 className="components-button components-tab-panel__tabs-item presto-player__nav-performance"
92 >
93 {__("Performance", "presto-player")}
94 </Link>
95 </div>
96 </FlexBlock>
97 <FlexItem>
98 <SaveButton
99 style={{ margin: "0 10px" }}
100 form="presto-settings-form"
101 />
102 </FlexItem>
103 </Flex>
104 </Card>
105
106 <Route path={routes?.general?.path} onRoute={scrollToTop}>
107 <General />
108 </Route>
109 <Route path={routes?.integrations?.path} onRoute={scrollToTop}>
110 <Integrations />
111 </Route>
112 <Route path={routes?.performance?.path} onRoute={scrollToTop}>
113 <Performance />
114 </Route>
115 </Router>
116
117 <SnackbarList
118 className="presto-settings-page-notices"
119 notices={notices}
120 onRemove={removeNotice}
121 />
122 </div>
123 );
124 }
125
126 export default App;
127