From cd7c4a05553846ddd3846a1b231b3e69ed83a108 Mon Sep 17 00:00:00 2001 From: wyatt-avilla Date: Fri, 21 Jun 2024 13:36:40 -0700 Subject: [PATCH] svg's as assets instead of in html macros --- frontend/src/components/assets/cake.svg | 3 ++ frontend/src/components/assets/clock.svg | 3 ++ frontend/src/components/assets/github.svg | 10 ++++++ frontend/src/components/assets/goodreads.svg | 3 ++ frontend/src/components/assets/lastfm.svg | 3 ++ frontend/src/components/assets/letterboxd.svg | 30 ++++++++++++++++ frontend/src/components/assets/play.svg | 10 ++++++ frontend/src/components/assets/repo.svg | 4 +++ frontend/src/components/github/button.rs | 16 +-------- frontend/src/components/github/row.rs | 9 +---- frontend/src/components/goodreads/button.rs | 8 +---- frontend/src/components/lastfm/button.rs | 8 +---- frontend/src/components/lastfm/row.rs | 15 +------- frontend/src/components/letterboxd/button.rs | 35 +------------------ frontend/src/components/profile/card.rs | 16 ++------- 15 files changed, 74 insertions(+), 99 deletions(-) create mode 100644 frontend/src/components/assets/cake.svg create mode 100644 frontend/src/components/assets/clock.svg create mode 100644 frontend/src/components/assets/github.svg create mode 100644 frontend/src/components/assets/goodreads.svg create mode 100644 frontend/src/components/assets/lastfm.svg create mode 100644 frontend/src/components/assets/letterboxd.svg create mode 100644 frontend/src/components/assets/play.svg create mode 100644 frontend/src/components/assets/repo.svg diff --git a/frontend/src/components/assets/cake.svg b/frontend/src/components/assets/cake.svg new file mode 100644 index 0000000..3b116af --- /dev/null +++ b/frontend/src/components/assets/cake.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/components/assets/clock.svg b/frontend/src/components/assets/clock.svg new file mode 100644 index 0000000..43638e5 --- /dev/null +++ b/frontend/src/components/assets/clock.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/components/assets/github.svg b/frontend/src/components/assets/github.svg new file mode 100644 index 0000000..b8a8423 --- /dev/null +++ b/frontend/src/components/assets/github.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frontend/src/components/assets/goodreads.svg b/frontend/src/components/assets/goodreads.svg new file mode 100644 index 0000000..60a71b5 --- /dev/null +++ b/frontend/src/components/assets/goodreads.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/components/assets/lastfm.svg b/frontend/src/components/assets/lastfm.svg new file mode 100644 index 0000000..896029b --- /dev/null +++ b/frontend/src/components/assets/lastfm.svg @@ -0,0 +1,3 @@ + + + diff --git a/frontend/src/components/assets/letterboxd.svg b/frontend/src/components/assets/letterboxd.svg new file mode 100644 index 0000000..4722677 --- /dev/null +++ b/frontend/src/components/assets/letterboxd.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/components/assets/play.svg b/frontend/src/components/assets/play.svg new file mode 100644 index 0000000..c505547 --- /dev/null +++ b/frontend/src/components/assets/play.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/frontend/src/components/assets/repo.svg b/frontend/src/components/assets/repo.svg new file mode 100644 index 0000000..82b9fb5 --- /dev/null +++ b/frontend/src/components/assets/repo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/src/components/github/button.rs b/frontend/src/components/github/button.rs index c4ffa27..9d8d63a 100644 --- a/frontend/src/components/github/button.rs +++ b/frontend/src/components/github/button.rs @@ -4,20 +4,6 @@ use yew::prelude::*; #[styled_component] pub fn Button() -> Html { - let icon_svg = html! { - - - - - - - - - - - - }; - html! { Html { cursor: pointer; border-radius: 50%; "#)}> - { icon_svg.clone() } + Github Icon } } diff --git a/frontend/src/components/github/row.rs b/frontend/src/components/github/row.rs index a5fa14f..4869c19 100644 --- a/frontend/src/components/github/row.rs +++ b/frontend/src/components/github/row.rs @@ -12,13 +12,6 @@ pub fn Row(props: &Commit) -> Html { repository_link, } = props; - let repo_svg = html! { - - - - - }; - html! {
Html { "#)}> { repository_name } - { repo_svg.clone() } + Repo Icon
diff --git a/frontend/src/components/goodreads/button.rs b/frontend/src/components/goodreads/button.rs index ec92712..67a2ad5 100644 --- a/frontend/src/components/goodreads/button.rs +++ b/frontend/src/components/goodreads/button.rs @@ -4,12 +4,6 @@ use yew::prelude::*; #[styled_component] pub fn Button() -> Html { - let icon_svg = html! { - - - - }; - html! { Html { cursor: pointer; border-radius: 50%; "#)}> - { icon_svg.clone() } + Goodreads Icon } } diff --git a/frontend/src/components/lastfm/button.rs b/frontend/src/components/lastfm/button.rs index 1540e51..72709b7 100644 --- a/frontend/src/components/lastfm/button.rs +++ b/frontend/src/components/lastfm/button.rs @@ -4,12 +4,6 @@ use yew::prelude::*; #[styled_component] pub fn Button() -> Html { - let icon_svg = html! { - - - - }; - html! { Html { cursor: pointer; border-radius: 50%; "#)}> - { icon_svg.clone() } + Lastfm Icon } } diff --git a/frontend/src/components/lastfm/row.rs b/frontend/src/components/lastfm/row.rs index 1cd3a18..be5668e 100644 --- a/frontend/src/components/lastfm/row.rs +++ b/frontend/src/components/lastfm/row.rs @@ -13,19 +13,6 @@ pub fn Row(props: &Song) -> Html { url, } = props; - let play_svg = html! { - - - - - - - - - - - }; - html! {
Html { display: flex; align-items: center; "#)}> - { play_svg.clone() } + Play Button Icon
diff --git a/frontend/src/components/letterboxd/button.rs b/frontend/src/components/letterboxd/button.rs index 47bb5cf..3e7f753 100644 --- a/frontend/src/components/letterboxd/button.rs +++ b/frontend/src/components/letterboxd/button.rs @@ -4,39 +4,6 @@ use yew::prelude::*; #[styled_component] pub fn Button() -> Html { - let icon_svg = html! { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }; - html! { Html { cursor: pointer; border-radius: 50%; "#)}> - { icon_svg.clone() } + Letterboxd Icon } } diff --git a/frontend/src/components/profile/card.rs b/frontend/src/components/profile/card.rs index e719564..caf9905 100644 --- a/frontend/src/components/profile/card.rs +++ b/frontend/src/components/profile/card.rs @@ -19,18 +19,6 @@ fn age() -> i32 { #[styled_component] pub fn Card() -> Html { - let cake_svg = html! { - - - - }; - - let clock_svg = html! { - - - - }; - html! {
Html { align-items: center; gap: 5px; "#)}> - { cake_svg } + Cake Icon { age() }
Html { align-items: center; gap: 5px; "#)}> - { clock_svg } + Clock Icon { Utc::now().with_timezone(&Pacific).format("%l:%M %p") }