-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from MutinyWallet/unlock-screen
add an unlock screen and unlocking msgs
- Loading branch information
Showing
8 changed files
with
141 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use iced::{widget::Svg, Theme}; | ||
|
||
pub enum SvgIcon { | ||
ChevronDown, | ||
DownLeft, | ||
Heart, | ||
Home, | ||
LeftRight, | ||
People, | ||
Settings, | ||
Squirrel, | ||
UpRight, | ||
Copy, | ||
} | ||
|
||
pub fn map_icon(icon: SvgIcon) -> Svg<'static, Theme> { | ||
match icon { | ||
SvgIcon::ChevronDown => Svg::from_path("assets/icons/chevron_down.svg"), | ||
SvgIcon::DownLeft => Svg::from_path("assets/icons/down_left.svg"), | ||
SvgIcon::Heart => Svg::from_path("assets/icons/heart.svg"), | ||
SvgIcon::Home => Svg::from_path("assets/icons/home.svg"), | ||
SvgIcon::LeftRight => Svg::from_path("assets/icons/left_right.svg"), | ||
SvgIcon::People => Svg::from_path("assets/icons/people.svg"), | ||
SvgIcon::Settings => Svg::from_path("assets/icons/settings.svg"), | ||
SvgIcon::Squirrel => Svg::from_path("assets/icons/squirrel.svg"), | ||
SvgIcon::UpRight => Svg::from_path("assets/icons/up_right.svg"), | ||
SvgIcon::Copy => Svg::from_path("assets/icons/copy.svg"), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ pub use util::*; | |
|
||
mod sidebar; | ||
pub use sidebar::*; | ||
|
||
mod icon; | ||
pub use icon::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use crate::components::{h_button, SvgIcon}; | ||
use iced::widget::{center, column, container, text_input, Svg}; | ||
use iced::{Alignment, Element, Length}; | ||
|
||
use crate::{HarborWallet, Message}; | ||
|
||
pub fn unlock(harbor: &HarborWallet) -> Element<Message> { | ||
// let receive_button = h_button("Receive", SvgIcon::DownLeft).on_press(Message::Receive(100)); | ||
let unlock_button = h_button("Unlock", SvgIcon::DownLeft) | ||
.on_press(Message::Unlock(harbor.password_input_str.clone())) | ||
.width(Length::Fill); | ||
|
||
let password_input = | ||
text_input("password", &harbor.password_input_str).on_input(Message::PasswordInputChanged); | ||
|
||
let harbor_logo = Svg::from_path("assets/harbor_logo.svg") | ||
.width(167) | ||
.height(61); | ||
|
||
container(center( | ||
column![harbor_logo, password_input, unlock_button] | ||
.spacing(32) | ||
.align_items(Alignment::Center) | ||
.width(Length::Fixed(256.)), | ||
)) | ||
.into() | ||
} |