diff options
Diffstat (limited to 'widget')
-rw-r--r-- | widget/Battery.tsx | 12 | ||||
-rw-r--r-- | widget/Button.tsx | 34 |
2 files changed, 0 insertions, 46 deletions
diff --git a/widget/Battery.tsx b/widget/Battery.tsx deleted file mode 100644 index d1b70d6..0000000 --- a/widget/Battery.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import Battery from "gi://AstalBattery" -import { bind } from "astal" - -export default function BatteryPercentage() { - const bat = Battery.get_default() - - return <box> - <button onClick="echo hello" /> - <label label="hi" /> - <label label={bind(bat, "percentage").as((p) => p * 100 + "%")} /> - </box> -} diff --git a/widget/Button.tsx b/widget/Button.tsx deleted file mode 100644 index abc24ca..0000000 --- a/widget/Button.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Variable, bind } from "astal" - -type Props = { - p: string - child?: JSX.Element - children?: Array<JSX.Element> -} - -export default function MyButton({p, child, children}: Props) { - const count = Variable(0) - const labels = [p +"1", p +"2"] - - if (child) { - console.log(child.label) - } - - function increment() { - count.set(count.get() + 1) - } - - function handleClick(self, ...args) { - console.log(self, "was clicked") - } - return <box> - {labels.map(label => ( - <button onClick={handleClick}> - <label label={label}></label> - </button> - ))} - <button onClick={increment}> - <label label={bind(count).as(num => num.toString())}></label> - </button> - </box> -} |