2021-01-08 04:44:43 +00:00
|
|
|
@use hyaenidae_accounts::LogoutState;
|
|
|
|
@use hyaenidae_toolkit::{templates::button_group, Button};
|
|
|
|
|
2021-01-09 04:35:35 +00:00
|
|
|
@(user_opt: &Option<LogoutState>, dark: bool)
|
2021-01-08 04:44:43 +00:00
|
|
|
|
|
|
|
@if let Some(logout_state) = user_opt.as_ref() {
|
|
|
|
@:button_group(&[
|
2021-01-09 04:35:35 +00:00
|
|
|
Button::primary("Home").href("/").dark(dark),
|
|
|
|
Button::secondary("Settings").href("/settings").dark(dark),
|
|
|
|
Button::secondary("Switch Profile").href("/profiles/change").dark(dark),
|
|
|
|
logout_state.button(&Button::primary_outline("Logout")).dark(dark),
|
2021-01-08 04:44:43 +00:00
|
|
|
])
|
|
|
|
} else {
|
|
|
|
@:button_group(&[
|
2021-01-09 04:35:35 +00:00
|
|
|
Button::primary_outline("Login").href("/session/auth/login").dark(dark),
|
|
|
|
Button::primary_outline("Register").href("/session/auth/register").dark(dark),
|
2021-01-08 04:44:43 +00:00
|
|
|
])
|
|
|
|
}
|