🎨 (pagetop): Mejora gestión de URLs según contexto
This commit is contained in:
parent
33669d90f6
commit
498df42b5b
6 changed files with 32 additions and 28 deletions
|
|
@ -81,7 +81,7 @@ impl Component for Item {
|
|||
} => {
|
||||
let path = path(cx);
|
||||
let current_path = cx.request().map(|request| request.path());
|
||||
let is_current = !*disabled && (current_path == Some(path));
|
||||
let is_current = !*disabled && (current_path == Some(&path));
|
||||
|
||||
let mut classes = "dropdown-item".to_string();
|
||||
if is_current {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ impl Component for Item {
|
|||
} => {
|
||||
let path = path(cx);
|
||||
let current_path = cx.request().map(|request| request.path());
|
||||
let is_current = !*disabled && (current_path == Some(path));
|
||||
let is_current = !*disabled && (current_path == Some(&path));
|
||||
|
||||
let mut classes = "nav-link".to_string();
|
||||
if is_current {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ pub struct Brand {
|
|||
/// Devuelve el eslogan de la marca.
|
||||
slogan: L10n,
|
||||
/// Devuelve la función que resuelve la URL asociada a la marca (si existe).
|
||||
#[default(_code = "Some(|_| \"/\")")]
|
||||
#[default(_code = "Some(|_| \"/\".into())")]
|
||||
path: Option<FnPathByContext>,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue