add on click thing

This commit is contained in:
Sakooooo 2024-11-26 17:49:44 +04:00
parent af34733ecb
commit d9462251cc
Signed by: sako
GPG key ID: FE52FD65B76E4751

View file

@ -83,10 +83,13 @@ function Workspaces() {
const workspaceButtons: number[] = (Array.from({ length: 10 }, (_, id) => id + 1)) const workspaceButtons: number[] = (Array.from({ length: 10 }, (_, id) => id + 1))
const focusWorkspace = (workspaceId: number) => hypr.dispatch("workspace", workspaceId.toString());
return <box className="Workspaces"> return <box className="Workspaces">
{workspaceButtons.map (workspace => {workspaceButtons.map (workspace =>
<button <button
className={bind(hypr, "focused_workspace").as(fw => workspace === fw.id ? "focused" : hypr.get_workspace(workspace) ? "" : "inactive" )} className={bind(hypr, "focused_workspace").as(fw => workspace === fw.id ? "focused" : hypr.get_workspace(workspace) ? "" : "inactive" )}
onClicked={() => focusWorkspace(workspace)}
>{workspace}</button> >{workspace}</button>
)} )}
</box> </box>