-
Notifications
You must be signed in to change notification settings - Fork 21
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 #18 from MutinyWallet/add-mint-screen
add mint screen
- Loading branch information
Showing
7 changed files
with
93 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -1,18 +1,43 @@ | ||
use iced::widget::{column, container, scrollable}; | ||
use iced::Length; | ||
use iced::{Alignment, Element}; | ||
use iced::widget::{column, container, scrollable, text}; | ||
use iced::{Color, Element}; | ||
use iced::{Length, Padding}; | ||
|
||
use crate::components::{h_button, h_header, h_input, SvgIcon}; | ||
use crate::{HarborWallet, Message}; | ||
|
||
pub fn mints(_harbor: &HarborWallet) -> Element<Message> { | ||
container( | ||
scrollable( | ||
column!["These are the mints!",] | ||
.spacing(32) | ||
.align_items(Alignment::Center) | ||
.width(Length::Fill), | ||
) | ||
.height(Length::Fill), | ||
) | ||
pub fn mints(harbor: &HarborWallet) -> Element<Message> { | ||
let header = h_header("Mints", "Manage your mints here."); | ||
|
||
let mint_input = h_input( | ||
"Mint Invite Code", | ||
"", | ||
&harbor.mint_invite_code_str, | ||
Message::MintInviteCodeInputChanged, | ||
Message::Noop, | ||
false, | ||
None, | ||
None, | ||
); | ||
|
||
let add_mint_button = h_button("Add Mint", SvgIcon::Plus) | ||
.on_press(Message::AddFederation(harbor.mint_invite_code_str.clone())); | ||
|
||
let column = column![header, mint_input, add_mint_button].spacing(48); | ||
|
||
// TODO: better error styling | ||
let column = column.push_maybe( | ||
harbor | ||
.add_federation_failure_reason | ||
.as_ref() | ||
.map(|r| text(r).size(18).color(Color::from_rgb8(255, 0, 0))), | ||
); | ||
|
||
container(scrollable( | ||
column | ||
.spacing(48) | ||
.width(Length::Fill) | ||
.max_width(512) | ||
.padding(Padding::new(48.)), | ||
)) | ||
.into() | ||
} |