Skip to content

Commit

Permalink
Refactor footer
Browse files Browse the repository at this point in the history
  • Loading branch information
vaijira committed May 8, 2024
1 parent 3daca9e commit 6cf657d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 87 deletions.
84 changes: 1 addition & 83 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 12,6 @@ use crate::css::{
FLEX_CONTAINER_ITEM_40_CLASS, ROOT_CLASS, SECTION_HEADER,
};
use crate::data::{AccountNote, BalanceNote, BrokerInformation, FinancialInformation};
use crate::feathers::{
render_svg_facebook_icon, render_svg_instagram_icon, render_svg_linkedin_icon,
render_svg_twitter_icon,
};
use crate::parsers::degiro_csv::DegiroCSVParser;
use crate::parsers::ib::IBParser;
use crate::parsers::ib_csv::IBCSVParser;
Expand Down Expand Up @@ -741,84 737,6 @@ impl App {
})
}

fn render_footer() -> Dom {
html!("footer", {
.text("Comparte en tus redes sociales si te ha sido de utilidad.")
.children(&mut[
html!("div",{
.children(&mut[
html!("span", {
.style("margin", "2px")
.child(
html!("a", {
.attr("alt", "Compartir en twitter")
.attr("aria-label", "Compartir en twitter")
.attr("href", "https://twitter.com/intent/tweet?text=Te ayuda a rellenar el modelo 720&url=https://www.burocratin.com")
.attr("target", "_blank")
.attr("rel", "external nofollow")
.child(render_svg_twitter_icon("lightblue", "24"))
})
)
}),
html!("span", {
.style("margin", "5px")
.child(
html!("a", {
.attr("alt", "Compartir en facebook")
.attr("aria-label", "Compartir en facebook")
.attr("href", "https://www.facebook.com/sharer/sharer.php?u=www.burocratin.com")
.attr("target", "_blank")
.attr("rel", "external nofollow")
.child(render_svg_facebook_icon("blue", "24"))
})
)
}),
html!("span", {
.style("margin", "5px")
.child(
html!("a", {
.attr("alt", "Compartir en instagram")
.attr("aria-label", "Compartir en instagram")
.attr("href", "https://www.instagram.com")
.attr("target", "_blank")
.attr("rel", "external nofollow")
.child(render_svg_instagram_icon("darkviolet", "24"))
})
)
}),
html!("span", {
.style("margin", "5px")
.child(
html!("a", {
.attr("alt", "Compartir en linkedin")
.attr("aria-label", "Compartir en linkedin")
.attr("href", "https://www.linkedin.com/sharing/share-offsite/?url=https://www.burocratin.com")
.attr("target", "_blank")
.attr("rel", "external nofollow")
.child(render_svg_linkedin_icon("blue", "24"))
})
)
}),

])
}),
html!("p", {
.text("Para cualquier mejora, duda, sugerencia o error puedes crear un ")
.child(
html!("a", {
.attr("href", "https://github.com/vaijira/burocratin/issues/new?title=Error&body=He encontrado un error")
.attr("alt", "informar de problemas o sugerencias")
.attr("target", "_blank")
.attr("rel", "external nofollow")
.text("ticket")
})
)
.text(".")
}),
]
)})
}

pub fn render(app: Arc<Self>) -> Dom {
stylesheet!("html", {
.style("font-family", "arial")
Expand Down Expand Up @@ -856,7 774,7 @@ impl App {
}),
App::render_download_button(app),
html!("hr", {}),
App::render_footer(),
crate::footer::render_footer(),

Check failure on line 777 in src/app.rs

View workflow job for this annotation

GitHub Actions / Unit Tests on 1.76.0

cannot find function `render_footer` in module `crate::footer`

Check failure on line 777 in src/app.rs

View workflow job for this annotation

GitHub Actions / Format & Clippy (1.76.0)

cannot find function `render_footer` in module `crate::footer`
])

})
Expand Down
8 changes: 4 additions & 4 deletions src/feathers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 32,20 @@ pub fn render_svg_help_icon(color: &str, size: &str) -> Dom {
}

pub fn render_svg_twitter_icon(color: &str, size: &str) -> Dom {
// <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-twitter"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg>
// <svg alt="X twitter icon" width="24" height="24" viewBox="0 0 24 24"><path d="m 18.744792,0 h 3.850107 l -8.453496,10.079827 9.876362,13.673506 H 16.267332 L 10.199228,15.444049 3.2522952,23.753333 H -0.59781209 L 8.3578721,12.9723 -1.1,0 h 7.9429388 l 5.4822182,7.5905485 z m -1.347537,21.386764 h 2.134298 L 5.7213859,2.2789175 H 3.4280611 Z" style="stroke-width:0.0856513"></path></svg>
svg!("svg", {
.attr("alt", "twitter icon")
.attr("alt", "X twitter icon")
.attr("width", size)
.attr("height", size)
.attr("viewBox", "0 0 24 24")
.attr("fill", color)
.attr("stroke", color)
.attr("stroke-width", "2")
.attr("stroke-width", "0.0856513")
.attr("stroke-linecap", "round")
.attr("stroke-linejoin", "round")
.children(&mut[
svg!("path",{
.attr("d", "M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z")
.attr("d", "m 18.744792,0 h 3.850107 l -8.453496,10.079827 9.876362,13.673506 H 16.267332 L 10.199228,15.444049 3.2522952,23.753333 H -0.59781209 L 8.3578721,12.9723 -1.1,0 h 7.9429388 l 5.4822182,7.5905485 z m -1.347537,21.386764 h 2.134298 L 5.7213859,2.2789175 H 3.4280611 Z")
}),
])
})
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 15,7 @@ mod app;
mod css;
mod data;
mod feathers;
mod footer;

Check failure on line 18 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Unit Tests on 1.76.0

file not found for module `footer`

Check failure on line 18 in src/lib.rs

View workflow job for this annotation

GitHub Actions / Format & Clippy (1.76.0)

file not found for module `footer`
mod parsers;
mod reports;
mod tooltip;
Expand Down

0 comments on commit 6cf657d

Please sign in to comment.