@use crate::extensions::ProfileExt; @use crate::nav::NavState; @use crate::profiles::EditProfileState; @use crate::templates::{button_js, file_js}; @use crate::templates::layouts::home; @use hyaenidae_toolkit::{templates::{button, button_group}, Button}; @use hyaenidae_toolkit::{templates::{card, card_body, card_title}, Card}; @use hyaenidae_toolkit::templates::file_input; @use hyaenidae_toolkit::templates::image; @use hyaenidae_toolkit::templates::profile; @use hyaenidae_toolkit::templates::text_input; @(state: &EditProfileState, 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()), { @:profile(&state.profile().heading().dark(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.profile.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(nav_state.dark())) @:text_input(&state.description(nav_state.dark()))
@:button_group(&[ Button::primary("Save").dark(nav_state.dark()), ])
}) @:card_body({
@if let Some(error) = &state.icon_error {

@error

}
@if let Some(img) = state.icon_image() { @:image(&img) } 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(nav_state.dark())) @:button(&Button::primary("Save").dark(nav_state.dark()))
}) @:card_body({
@if let Some(error) = &state.banner_error {

@error

}
@if let Some(img) = state.banner_image() { @:image(&img) } else {

No banner set

}

New Banner

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

@:file_input(&state.banner(nav_state.dark())) @: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()), ]) }) }) })