@use crate::templates::{button_js, file_js}; @use crate::{templates::{layouts::home, profiles::{banner, icon, view}}, nav::NavState, profiles::ProfileState}; @use hyaenidae_toolkit::{templates::{button, button_group, card, card_body, card_title, file_input, text_input}, Button, Card}; @(state: &ProfileState, nav_state: &NavState) @:home("Profile Settings", &format!("{}'s profile", state.profile.name()), nav_state, { @:button_js() @:file_js() }, { @:card(Card::full_width().dark(nav_state.dark()), { @:view(&state.profile, nav_state.dark()) }) @:card(Card::full_width().dark(nav_state.dark()), { @:card_title({ Profile Actions }) @:card_body({ @:button_group(&[ &Button::secondary("View Profile").href(&state.view_path()).dark(nav_state.dark()), &Button::secondary("Switch Profile").href("/profiles/change").dark(nav_state.dark()), ]) }) }) @:card(Card::full_width().dark(nav_state.dark()), { @:card_title({ Update Profile }) @:card_body({

Update Bio

Update the name that appears by your posts and on the top of your profile, and the description that appears on your profile page.

@:text_input(&state.display_name) @:text_input(&state.description)
@:button_group(&[&Button::primary("Save").dark(nav_state.dark())])
}) @:card_body({
@if let Some(error) = &state.icon_error {

@error

}
@if let Some(key) = state.profile.icon_key() { @:icon(key, &state.profile.name()) } else {

No icon set

}

New Icon

This icon appears at the top of your profile, and next to any submissions or comments you create

@:file_input(&state.icon) @:button(&Button::primary("Save").dark(nav_state.dark()))
}) @:card_body({
@if let Some(error) = &state.banner_error {

@error

}
@if let Some(key) = state.profile.banner_key() { @:banner(key, &state.profile.name()) } else {

No banner set

}

New Banner

This banner appears at the top of your profile on the profile page

@:file_input(&state.banner) @:button(&Button::primary("Save").dark(nav_state.dark()))
}) @:card_body({
@if let Some(error) = &state.login_required_error {

@error

}

Require Login

Choose whether your profile is visible to everyone, or only logged-in users.

@:button_group(&[&Button::primary("Save").dark(nav_state.dark())])
}) }) @:card(Card::full_width().dark(nav_state.dark()), { @:card_title({ Danger }) @:card_body({ @:button_group(&[ Button::primary_outline("Delete Profile").href("/profiles/delete").dark(nav_state.dark()), ]) }) }) })