🚧 Code tweaks
This commit is contained in:
parent
1e554aac68
commit
4fb7861ab0
1 changed files with 10 additions and 8 deletions
|
|
@ -11,7 +11,7 @@ pub enum PoweredByLogo {
|
||||||
Color,
|
Color,
|
||||||
LineDark,
|
LineDark,
|
||||||
LineLight,
|
LineLight,
|
||||||
Line(u8, u8, u8),
|
LineRGB(u8, u8, u8),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
|
|
@ -49,14 +49,11 @@ impl ComponentTrait for PoweredBy {
|
||||||
(self.renderable.check)(cx)
|
(self.renderable.check)(cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
fn before_prepare_component(&mut self, cx: &mut Context) {
|
||||||
Minimal.load_assets(cx);
|
Minimal.load_assets(cx);
|
||||||
|
}
|
||||||
|
|
||||||
let mut credits = L10n::e("poweredby_pagetop", &LOCALES_MINIMAL).with_arg(
|
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
|
||||||
"pagetop_link",
|
|
||||||
"<a href=\"https://crates.io/crates/pagetop\">PageTop</a>",
|
|
||||||
);
|
|
||||||
|
|
||||||
let logo = match self.logo() {
|
let logo = match self.logo() {
|
||||||
PoweredByLogo::Color => {
|
PoweredByLogo::Color => {
|
||||||
let logo_txt = L10n::t("pagetop_logo", &LOCALES_MINIMAL);
|
let logo_txt = L10n::t("pagetop_logo", &LOCALES_MINIMAL);
|
||||||
|
|
@ -69,10 +66,15 @@ impl ComponentTrait for PoweredBy {
|
||||||
}
|
}
|
||||||
PoweredByLogo::LineDark => self.logo_line(10, 11, 9, cx),
|
PoweredByLogo::LineDark => self.logo_line(10, 11, 9, cx),
|
||||||
PoweredByLogo::LineLight => self.logo_line(255, 255, 255, cx),
|
PoweredByLogo::LineLight => self.logo_line(255, 255, 255, cx),
|
||||||
PoweredByLogo::Line(r, g, b) => self.logo_line(*r, *g, *b, cx),
|
PoweredByLogo::LineRGB(r, g, b) => self.logo_line(*r, *g, *b, cx),
|
||||||
_ => html! {},
|
_ => html! {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut credits = L10n::e("poweredby_pagetop", &LOCALES_MINIMAL).with_arg(
|
||||||
|
"pagetop_link",
|
||||||
|
"<a href=\"https://crates.io/crates/pagetop\">PageTop</a>",
|
||||||
|
);
|
||||||
|
|
||||||
PrepareMarkup::With(html! {
|
PrepareMarkup::With(html! {
|
||||||
div id=[self.id()] {
|
div id=[self.id()] {
|
||||||
@if let Some(c) = self.copyright() {
|
@if let Some(c) = self.copyright() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue