From 54700d4a765c429dd2445495625ccbfb7687e5ec Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 18 Sep 2024 12:23:24 +0500 Subject: [PATCH] add onlyWidgets --- docs/frontend-tricks.md | 10 ++++++++++ .../overlay/src/components/layouts/MainLayout.tsx | 3 +++ 2 files changed, 13 insertions(+) diff --git a/docs/frontend-tricks.md b/docs/frontend-tricks.md index d96dc266..e6e38740 100644 --- a/docs/frontend-tricks.md +++ b/docs/frontend-tricks.md @@ -16,3 +16,13 @@ You can pass forces visual config using the forceVisualConfig Examples: - `http://host/overelay?forceVisualConfig=` + + +## onlyWidgets +You can pass onlyWidgets query params to show only the widgets that are passed in the query params by their id. + +Examples: +- `http://host/overlay?onlyWidgets=queue` + show only queue +- `http://host/overlay?onlyWidgets=teamview.BOTTOM_RIGHT,teamview.BOTTOM_LEFT` + show only bottom teamviews \ No newline at end of file diff --git a/src/frontend/overlay/src/components/layouts/MainLayout.tsx b/src/frontend/overlay/src/components/layouts/MainLayout.tsx index 58cb0e47..fba58a18 100644 --- a/src/frontend/overlay/src/components/layouts/MainLayout.tsx +++ b/src/frontend/overlay/src/components/layouts/MainLayout.tsx @@ -126,6 +126,9 @@ export const MainLayout = () => { if (params.get("scene") && obj.type !== "TeamLocatorWidget") { return null; } + if (params.get("onlyWidgets") && !params.get("onlyWidgets").split(",").includes(obj.widgetId)) { + return null; + } return {state => state !== "exited" &&