Skip to content

Commit

Permalink
LEA -> Fix formatting of EDGAR Setup-String warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfm committed Jan 17, 2025
1 parent ba648fb commit 7db0079
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
13 changes: 2 additions & 11 deletions opendut-lea/src/components/generate_setup_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use leptos::{either::Either, prelude::*};
use opendut_auth::public::OptionalAuthData;
use opendut_types::peer::PeerId;

use crate::{app::use_app_globals, components::{use_toaster, ButtonColor, ButtonState, SimpleButton, Toast}, user::UNAUTHENTICATED_USER};
use crate::{app::use_app_globals, components::{use_toaster, ButtonColor, ButtonState, SimpleButton, Toast, WarningMessage}, user::UNAUTHENTICATED_USER};


#[component]
Expand Down Expand Up @@ -66,16 +66,7 @@ pub fn GenerateSetupStringForm(kind: GenerateSetupStringKind) -> impl IntoView {
})}
</Suspense>
<br/>
<div class="notification is-warning">
<div class="columns is-mobile is-vcentered">
<div class="column is-narrow">
<i class="fa-solid fa-triangle-exclamation fa-2xl"></i>
</div>
<div class="column">
<p>"Please keep Setup-Strings secret and handle them with care like your passwords."</p>
</div>
</div>
</div>
<WarningMessage>"Please keep Setup-Strings secret and handle them with care like your passwords."</WarningMessage>
}
}

Expand Down
2 changes: 2 additions & 0 deletions opendut-lea/src/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub use toast::{Toast, ToastContent, Toaster, ToastKind, use_toaster};
pub use util::ButtonStateSignalProvider;
pub use util::Toggled;
pub use util::use_active_tab;
pub use warning_message::WarningMessage;

pub mod health;
pub mod tooltip;
Expand All @@ -32,6 +33,7 @@ mod loading_spinner;
mod page;
mod toast;
mod util;
mod warning_message;

#[derive(Clone, Copy, Debug)]
#[allow(dead_code)]
Expand Down
17 changes: 17 additions & 0 deletions opendut-lea/src/components/warning_message.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use leptos::prelude::*;

#[component]
pub fn WarningMessage(children: Children) -> impl IntoView {
view! {
<div class="notification is-warning">
<div class="columns is-mobile is-vcentered">
<div class="column is-narrow">
<i class="fa-solid fa-triangle-exclamation fa-2xl"></i>
</div>
<div class="column">
<p>{children()}</p>
</div>
</div>
</div>
}
}
5 changes: 2 additions & 3 deletions opendut-lea/src/peers/configurator/tabs/setup/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use leptos::prelude::*;

use crate::components::{GenerateSetupStringForm, GenerateSetupStringKind};
use crate::components::{GenerateSetupStringForm, GenerateSetupStringKind, WarningMessage};
use crate::peers::configurator::types::UserPeerConfiguration;

#[component]
Expand All @@ -9,8 +9,7 @@ pub fn SetupTab(peer_configuration: ReadSignal<UserPeerConfiguration>) -> impl I
view! {
<div class="field">
<GenerateSetupStringForm kind=GenerateSetupStringKind::Edgar(peer_configuration.get().id) />
<br/>
<p>"Setup-Strings may only be used to set up one host. For setting up multiple hosts, you should create a peer for each host."</p>
<WarningMessage>"Setup-Strings may only be used to set up one host. For setting up multiple hosts, you should create a peer for each host."</WarningMessage>
</div>
}
}

0 comments on commit 7db0079

Please sign in to comment.