From ce843fcb3a27fba9fb7918fbd7691007f6ed2bbf Mon Sep 17 00:00:00 2001 From: Dan <39170265+chillenberger@users.noreply.github.com> Date: Thu, 26 Oct 2023 16:57:11 -0600 Subject: [PATCH] update list items to take color, move text highlight and party time to typography, add pricing nav to marketing nav --- .../src/components/lists/item/mod.rs | 30 +++++++++++++++++++ .../src/components/lists/item/template.html | 4 ++- .../navigation/navbar/marketing/template.html | 10 +++---- .../static/css/scss/base/_base.scss | 17 ----------- .../static/css/scss/base/_typography.scss | 5 +++- 5 files changed, 42 insertions(+), 24 deletions(-) diff --git a/pgml-dashboard/src/components/lists/item/mod.rs b/pgml-dashboard/src/components/lists/item/mod.rs index 8a0ff1645..0ae5d1b73 100644 --- a/pgml-dashboard/src/components/lists/item/mod.rs +++ b/pgml-dashboard/src/components/lists/item/mod.rs @@ -1,16 +1,41 @@ use pgml_components::component; use sailfish::TemplateOnce; +use std::fmt; + +#[derive(PartialEq, Eq, Default, Clone)] +pub enum Color { + #[default] + Green, + Blue, + Orange, + Pink, + Purple, +} + +impl fmt::Display for Color { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Color::Green => write!(f, "green"), + Color::Blue => write!(f, "blue"), + Color::Orange => write!(f, "orange"), + Color::Pink => write!(f, "pink"), + Color::Purple => write!(f, "purple"), + } + } +} #[derive(TemplateOnce, Default)] #[template(path = "lists/item/template.html")] pub struct Item { value: String, + color: Color, } impl Item { pub fn new() -> Item { Item { value: String::from("Your list item"), + color: Color::Green, } } @@ -18,6 +43,11 @@ impl Item { self.value = value.into(); self } + + pub fn color(mut self, color: Color) -> Item { + self.color = color; + self + } } component!(Item); diff --git a/pgml-dashboard/src/components/lists/item/template.html b/pgml-dashboard/src/components/lists/item/template.html index 7df3b5ec6..d4c85e98d 100644 --- a/pgml-dashboard/src/components/lists/item/template.html +++ b/pgml-dashboard/src/components/lists/item/template.html @@ -1,4 +1,6 @@
- Checkmark + + check + <%- value %>
diff --git a/pgml-dashboard/src/components/navigation/navbar/marketing/template.html b/pgml-dashboard/src/components/navigation/navbar/marketing/template.html index ff3715baf..7d4313763 100644 --- a/pgml-dashboard/src/components/navigation/navbar/marketing/template.html +++ b/pgml-dashboard/src/components/navigation/navbar/marketing/template.html @@ -13,14 +13,14 @@