Skip to content

Commit

Permalink
add onlyWidgets
Browse files Browse the repository at this point in the history
  • Loading branch information
irdkwmnsb committed Sep 18, 2024
1 parent afd07dc commit 54700d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/frontend-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions src/frontend/overlay/src/components/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Transition key={obj.widgetId} timeout={Widget.overrideTimeout ?? c.WIDGET_TRANSITION_TIME}>
{state =>
state !== "exited" && <WidgetWrap
Expand Down

0 comments on commit 54700d4

Please sign in to comment.