From f3af05f2be1ca8fec14190ddf933d40b2914edd9 Mon Sep 17 00:00:00 2001 From: tanvirtin Date: Sun, 17 Nov 2024 14:57:17 -0500 Subject: [PATCH] chore(ui): remove unused component --- lua/vgit/ui/components/PopupComponent.lua | 60 ----------------------- 1 file changed, 60 deletions(-) delete mode 100644 lua/vgit/ui/components/PopupComponent.lua diff --git a/lua/vgit/ui/components/PopupComponent.lua b/lua/vgit/ui/components/PopupComponent.lua deleted file mode 100644 index 8a778807..00000000 --- a/lua/vgit/ui/components/PopupComponent.lua +++ /dev/null @@ -1,60 +0,0 @@ -local utils = require('vgit.core.utils') -local Window = require('vgit.core.Window') -local Buffer = require('vgit.core.Buffer') -local Component = require('vgit.ui.Component') - -local PopupComponent = Component:extend() - -function PopupComponent:constructor(props) - props = utils.object.assign({ - config = { - elements = { - header = false, - footer = false, - }, - }, - }, props) - return Component.constructor(self, props) -end - -function PopupComponent:call(callback) - self.window:call(callback) - - return self -end - -function PopupComponent:set_default_win_plot(win_plot) - win_plot.relative = 'cursor' - win_plot.border = self:render_border({ - hl = 'GitBorder', - chars = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' }, - }) - - return self -end - -function PopupComponent:mount() - if self.mounted then return self end - - local config = self.config - - local win_plot = self.plot.win_plot - - self:set_default_win_plot(win_plot) - - self.buffer = Buffer():create():assign_options(config.buf_options) - - self.window = Window:open(self.buffer, win_plot):assign_options(config.win_options) - - self.mounted = true - - return self -end - -function PopupComponent:unmount() - self.window:close() - - return self -end - -return PopupComponent