Skip to content

Commit

Permalink
fix-typo-tg-button (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
tikitko authored Dec 12, 2024
1 parent cd67e98 commit be79a9b
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/components/navigation_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,34 @@ pub fn navigation_menu() -> Html {
.author()
.map(|a| a.editor == 1)
.unwrap_or(false);

let is_logged_in = !logged_user_context.is_not_inited() && logged_user_context.token() != None;

#[cfg(feature = "telegram")]
let tg_button: Option<Html> = Some(html! {
<button
title="Войти через Telegram"
aria-label="Войти через Telegram"
type="button"
data-bs-toggle="modal"
data-bs-target="#loginModal"
class="btn btn-light telegram-button"
>
<div class="btn inner">
<p>
<span>{ "Войти через" }</span>
<br/>
<span>{ "Telegram" }</span>
</p>
</div>
</button>
});
let tg_button: Option<Html> = if !is_logged_in {
Some(html! {
<button
title="Войти через Telegram"
aria-label="Войти через Telegram"
type="button"
data-bs-toggle="modal"
data-bs-target="#loginModal"
class="btn btn-light telegram-button"
>
<div class="btn inner">
<p>
<span>{ "Войти через" }</span>
<br/>
<span>{ "Telegram" }</span>
</p>
</div>
</button>
})
} else {
None
};
#[cfg(not(feature = "telegram"))]
let tg_button: Option<Html> = None;

html! {
<>
<Link<Route>
Expand Down

0 comments on commit be79a9b

Please sign in to comment.