mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-20 23:02:34 +02:00
role based content
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
use yew::{function_component, html, Callback, Html};
|
||||
use crate::app::components::loading_indicator::BusyIndicator;
|
||||
use crate::app::components::{IconButton, ToastrView};
|
||||
use crate::hooks::use_service_context;
|
||||
use crate::provider::DialogProvider;
|
||||
|
||||
#[function_component]
|
||||
pub fn ApiUserView() -> Html {
|
||||
let services = use_service_context();
|
||||
|
||||
let handle_logout = {
|
||||
let services_ctx = services.clone();
|
||||
Callback::from(move |_| services_ctx.auth.logout())
|
||||
};
|
||||
|
||||
html! {
|
||||
<DialogProvider>
|
||||
<ToastrView />
|
||||
<div class="tp__app">
|
||||
<BusyIndicator />
|
||||
|
||||
<div class="tp__app-main">
|
||||
<div class="tp__app-main__header tp__app-header">
|
||||
<div class="tp__app-main__header-left">
|
||||
{
|
||||
if let Some(ref title) = services.config.ui_config.app_title {
|
||||
html! { title.as_str() }
|
||||
} else {
|
||||
html! { /*<AppIcon name="AppTitle" /> */ }
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class={"tp__app-header-toolbar"}>
|
||||
<IconButton name="Logout" icon="Logout" onclick={handle_logout} />
|
||||
</div>
|
||||
</div>
|
||||
<div class="tp__app-main__body">
|
||||
{" TODO "}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</DialogProvider>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user