From aec3b26e4fa9fd1e6a7afaea8f54f042b4b96dfc Mon Sep 17 00:00:00 2001 From: James <36777651+jbowa@users.noreply.github.com> Date: Sat, 30 Mar 2024 13:36:22 +0400 Subject: [PATCH] Replace home route with dashboard (#23) --- pkg/routes/dashboard.go | 23 ---- pkg/routes/router.go | 6 +- static/css/global.css | 32 ------ static/js/store.js | 2 +- templates/components/core.tmpl | 2 +- templates/components/css.tmpl | 4 +- templates/pages/dashboard.tmpl | 131 --------------------- templates/pages/home.tmpl | 202 ++++++++++++++++++++++++++++----- templates/templates.go | 5 +- 9 files changed, 179 insertions(+), 228 deletions(-) delete mode 100644 pkg/routes/dashboard.go delete mode 100644 static/css/global.css delete mode 100644 templates/pages/dashboard.tmpl diff --git a/pkg/routes/dashboard.go b/pkg/routes/dashboard.go deleted file mode 100644 index f4a3085..0000000 --- a/pkg/routes/dashboard.go +++ /dev/null @@ -1,23 +0,0 @@ -package routes - -import ( - "github.com/labstack/echo/v4" - - "github.com/tiny-blob/tinyblob/pkg/controller" - "github.com/tiny-blob/tinyblob/templates" -) - -type ( - dashboard struct { - controller.Controller - } -) - -func (c *dashboard) Get(ctx echo.Context) error { - page := controller.NewPage(ctx) - page.Layout = templates.LayoutMain - page.Name = templates.PageDashboard - page.Title = "Dashboard" - - return c.RenderPage(ctx, page) -} diff --git a/pkg/routes/router.go b/pkg/routes/router.go index 3c55202..8ae1bac 100644 --- a/pkg/routes/router.go +++ b/pkg/routes/router.go @@ -16,8 +16,7 @@ import ( ) const ( - routeNameDashboard = "dashboard" - routeNameHome = "home" + routeNameHome = "home" ) // BuildRouter builds the router. @@ -76,7 +75,4 @@ func BuildRouter(c *services.Container) { func userRoutes(g *echo.Group, ctr controller.Controller) { home := home{Controller: ctr} g.GET("/", home.Get).Name = routeNameHome - - dashboard := dashboard{Controller: ctr} - g.GET("/d", dashboard.Get).Name = routeNameDashboard } diff --git a/static/css/global.css b/static/css/global.css deleted file mode 100644 index e581fa6..0000000 --- a/static/css/global.css +++ /dev/null @@ -1,32 +0,0 @@ -:root { - font-family: Inter, sans-serif; - font-feature-settings: 'liga' 1, 'calt' 1, 'ss01' 1, 'ss02' 1, 'ss03' 1; -} -@supports (font-variation-settings: normal) { - :root { - font-family: InterVariable, sans-serif; - } -} - -body { - color: #fff; - font-size: 18px; - text-rendering: optimizeLegibility; - background: #fff; -} - -/* Inter */ -@font-face { - font-family: InterVariable; - font-style: normal; - font-weight: 100 900; - font-display: swap; - src: url('/files/fonts/InterVariable.woff2') format('woff2'); -} -@font-face { - font-family: InterVariable; - font-style: italic; - font-weight: 100 900; - font-display: swap; - src: url('/files/fonts/InterVariable-Italic.woff2') format('woff2'); -} diff --git a/static/js/store.js b/static/js/store.js index 5421e1d..75b316c 100644 --- a/static/js/store.js +++ b/static/js/store.js @@ -27,7 +27,7 @@ document.addEventListener('alpine:init', () => { if (__provider__?.isPhantom) { __provider__.on('connect', (pub_key) => { if (pub_key) { - this.init_wallet(); + this.init_wallet(pub_key); } else { this.clean_up(); } diff --git a/templates/components/core.tmpl b/templates/components/core.tmpl index 32eef06..c612681 100644 --- a/templates/components/core.tmpl +++ b/templates/components/core.tmpl @@ -14,7 +14,6 @@ {{define "js"}} - @@ -24,4 +23,5 @@ presets: [() => window.__unocss_runtime.presets.presetWind()] } + {{end}} \ No newline at end of file diff --git a/templates/components/css.tmpl b/templates/components/css.tmpl index 8230c02..8953cde 100644 --- a/templates/components/css.tmpl +++ b/templates/components/css.tmpl @@ -2,11 +2,10 @@ -