add on click thing
This commit is contained in:
parent
af34733ecb
commit
d9462251cc
1 changed files with 3 additions and 0 deletions
|
@ -83,10 +83,13 @@ function Workspaces() {
|
|||
|
||||
const workspaceButtons: number[] = (Array.from({ length: 10 }, (_, id) => id + 1))
|
||||
|
||||
const focusWorkspace = (workspaceId: number) => hypr.dispatch("workspace", workspaceId.toString());
|
||||
|
||||
return <box className="Workspaces">
|
||||
{workspaceButtons.map (workspace =>
|
||||
<button
|
||||
className={bind(hypr, "focused_workspace").as(fw => workspace === fw.id ? "focused" : hypr.get_workspace(workspace) ? "" : "inactive" )}
|
||||
onClicked={() => focusWorkspace(workspace)}
|
||||
>{workspace}</button>
|
||||
)}
|
||||
</box>
|
||||
|
|
Loading…
Reference in a new issue