Skip to content

Commit

Permalink
Merge pull request #103 from HarborWallet/onboard-cleanup
Browse files Browse the repository at this point in the history
disabled states and getting started prompt
  • Loading branch information
futurepaul authored Nov 25, 2024
2 parents 8c6c0f6 + 3cddc4d commit b92ee5a
Show file tree
Hide file tree
Showing 17 changed files with 529 additions and 70 deletions.
1 change: 1 addition & 0 deletions harbor-ui/assets/icons/arrow_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions harbor-ui/assets/icons/clock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions harbor-ui/assets/icons/eye_closed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions harbor-ui/src/components/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ pub fn h_button(text_str: &str, icon: SvgIcon, loading: bool) -> Button<'_, Mess
Status::Pressed => darken(Color::BLACK, 0.1),
_ => theme.palette().background,
};

let text_color = match status {
Status::Disabled => gray,
_ => Color::WHITE,
};

button::Style {
background: Some(background.into()),
text_color: Color::WHITE,
text_color,
border,
shadow: Shadow::default(),
}
Expand All @@ -67,6 +73,8 @@ pub fn sidebar_button(

Button::new(content)
.style(move |theme, status| {
let gray = lighten(theme.palette().background, 0.5);

let border = Border {
color: Color::WHITE,
width: 0.,
Expand All @@ -85,9 +93,15 @@ pub fn sidebar_button(
(Status::Pressed, false) => darken(bg_color, 0.1),
_ => bg_color,
};

let text_color = match status {
Status::Disabled => gray,
_ => Color::WHITE,
};

button::Style {
background: Some(background.into()),
text_color: Color::WHITE,
text_color,
border,
shadow: Shadow::default(),
}
Expand Down
4 changes: 2 additions & 2 deletions harbor-ui/src/components/federation_item.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::Message;
use harbor_client::db_models::FederationItem;
use iced::{
widget::{column, row, text},
Alignment, Element,
};
use harbor_client::db_models::FederationItem;
use crate::Message;

use super::{bold_text, h_button, regular_text, subtitle, truncate_text};
use super::{format_amount, map_icon, SvgIcon};
Expand Down
6 changes: 6 additions & 0 deletions harbor-ui/src/components/icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub enum SvgIcon {
Heart,
Home,
LeftRight,
ArrowLeft,
People,
Settings,
Squirrel,
Expand All @@ -21,6 +22,8 @@ pub enum SvgIcon {
Bolt,
Chain,
Eye,
EyeClosed,
Clock,
}

macro_rules! icon_handle {
Expand Down Expand Up @@ -51,6 +54,9 @@ pub fn map_icon<'a>(icon: SvgIcon, width: f32, height: f32) -> Svg<'a, Theme> {
SvgIcon::Bolt => icon_handle!("bolt.svg"),
SvgIcon::Chain => icon_handle!("chain.svg"),
SvgIcon::Eye => icon_handle!("eye.svg"),
SvgIcon::EyeClosed => icon_handle!("eye_closed.svg"),
SvgIcon::Clock => icon_handle!("clock.svg"),
SvgIcon::ArrowLeft => icon_handle!("arrow_left.svg"),
}
.width(width)
.height(height)
Expand Down
Loading

0 comments on commit b92ee5a

Please sign in to comment.