46 lines
1.6 KiB
Rust
46 lines
1.6 KiB
Rust
use yew::prelude::*;
|
|
use wasm_bindgen::prelude::*;
|
|
use self_components::{Registration, RegistrationConfig};
|
|
|
|
#[function_component(App)]
|
|
fn app() -> Html {
|
|
let registration_complete = Callback::from(|data: (String, String)| {
|
|
let (email, public_key) = data;
|
|
web_sys::console::log_1(&format!("Registration completed for {} with public key: {}", email, public_key).into());
|
|
});
|
|
|
|
let server_url = option_env!("SERVER_URL")
|
|
.unwrap_or("http://localhost:8080")
|
|
.to_string();
|
|
|
|
let config = RegistrationConfig {
|
|
server_url,
|
|
app_name: "Self-Sovereign Identity".to_string(),
|
|
};
|
|
|
|
html! {
|
|
<div class="app-container" style="min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 2rem 0;">
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-12 col-lg-8">
|
|
<div class="text-center mb-4">
|
|
<h1 class="display-4 text-white mb-3">{"Self"}</h1>
|
|
<p class="lead text-white-50">{"Sovereign Entity Local Framework"}</p>
|
|
</div>
|
|
|
|
<Registration
|
|
config={config}
|
|
on_complete={registration_complete}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
#[wasm_bindgen::prelude::wasm_bindgen(start)]
|
|
pub fn run_app() {
|
|
yew::Renderer::<App>::new().render();
|
|
}
|