refactor
This commit is contained in:
1 parent
094e1351e3
commit
dddb4bce11
5 files changed
+70
-38
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import Mpris from "gi://AstalMpris";
|
||||
import { bind } from "astal";
|
||||
import { close_all_menus } from "../utils/windows";
|
||||
import { App } from "astal/gtk3";
|
||||
|
||||
export default function MediaPlayerButton() {
|
||||
const mpris = Mpris.get_default();
|
||||
return (
|
||||
<>
|
||||
{bind(mpris, "players").as((ps) =>
|
||||
ps[0] ? (
|
||||
<button
|
||||
onClicked={() => {
|
||||
close_all_menus("Mediamenu");
|
||||
App.toggle_window("Mediamenu");
|
||||
}}
|
||||
className="Menubutton"
|
||||
>
|
||||
|
||||
</button>
|
||||
) : (
|
||||
<></>
|
||||
),
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user