aboutsummaryrefslogtreecommitdiff
path: root/src/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/components')
-rw-r--r--src/app/components/icons/root.zig6
-rw-r--r--src/app/components/navbutton/root.zig9
2 files changed, 10 insertions, 5 deletions
diff --git a/src/app/components/icons/root.zig b/src/app/components/icons/root.zig
index 298cfa6..6f7ab4a 100644
--- a/src/app/components/icons/root.zig
+++ b/src/app/components/icons/root.zig
@@ -6,16 +6,12 @@ pub const icons: []const zs.Component = &.{
icon("settings"),
};
-const Icon = struct {
- pub fn init(_: *@This(), _: *zs.Object) void {}
-};
-
pub fn icon(name: []const u8) zs.Component {
return .{
.namespace = "icon",
.name = name,
.html = .parse(@embedFile(name ++ ".svg")),
.css = @embedFile("index.css"),
- .link = Icon,
+ .link = struct {},
};
}
diff --git a/src/app/components/navbutton/root.zig b/src/app/components/navbutton/root.zig
index 7704b90..b76af43 100644
--- a/src/app/components/navbutton/root.zig
+++ b/src/app/components/navbutton/root.zig
@@ -27,6 +27,15 @@ pub fn init(self: *Self, element: *zs.Object) !void {
self.button.classList = try button.get(&env, "classList").await(&env, .object);
}
+pub fn deinit(self: *Self) !void {
+ var env: zs.Env = .default;
+ defer env.deinit();
+
+ _ = self.element.free(&env);
+ _ = self.shadow_root.free(&env);
+ _ = self.button.classList.free(&env);
+}
+
pub fn open(self: *Self) !void {
var env: zs.Env = .default;
defer env.deinit();