diff --git a/Cargo.lock b/Cargo.lock index 1112b58..28545f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1144,6 +1144,41 @@ dependencies = [ "want", ] +[[package]] +name = "icondata" +version = "0.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f41f2deec9249d16ef6b1a8442fbe16013f67053797052aa0b7d2f5ebd0f0098" +dependencies = [ + "icondata_core", + "icondata_fa", + "icondata_fi", +] + +[[package]] +name = "icondata_core" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1640a4c1d5ddd08ab1d9854ffa7a2fa3dc52339492676b6d3031e77ca579f434" + +[[package]] +name = "icondata_fa" +version = "0.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a515ecda53468cf4a383409da1708da2e4c00253561873c46304cd7f412e9414" +dependencies = [ + "icondata_core", +] + +[[package]] +name = "icondata_fi" +version = "0.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68806fd5abc6bcf395fc54f6193b0f9085aa2a6c740d72825e7e43be4d6a366" +dependencies = [ + "icondata_core", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1373,6 +1408,17 @@ dependencies = [ "walkdir", ] +[[package]] +name = "leptos_icons" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b3fad7820b18b983d49ff4262df88de94dc8fd993278937979cc0dd188868e5" +dependencies = [ + "icondata", + "leptos", + "tracing", +] + [[package]] name = "leptos_integration_utils" version = "0.5.1" @@ -1766,6 +1812,7 @@ dependencies = [ "gloo-net 0.4.0", "leptos", "leptos_actix", + "leptos_icons", "leptos_meta", "leptos_router", "log", diff --git a/Cargo.toml b/Cargo.toml index 52a0d91..6a9d242 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,12 @@ gloo-net = { version = "0.4.0", features = ["http"] } log = "0.4" cfg-if = "1.0" +# https://carlosted.github.io/icondata/ +leptos_icons = { version = "0.1.0", features = [ + "FiExternalLink", + "FaGithubBrands", +]} + # dependecies for client (enable when csr or hydrate set) wasm-bindgen = { version = "0.2", optional = true } console_log = { version = "1", optional = true } diff --git a/src/app/components/link.rs b/src/app/components/link.rs new file mode 100644 index 0000000..4032b6f --- /dev/null +++ b/src/app/components/link.rs @@ -0,0 +1,17 @@ +use leptos::*; +use leptos_icons::FiIcon::FiExternalLink; +use leptos_icons::*; + +#[component] +pub fn Link( + #[prop[optional]] + url: String, + children: Children +) -> impl IntoView { + view! { + + { children() } + + + } +} \ No newline at end of file diff --git a/src/app/components/mod.rs b/src/app/components/mod.rs new file mode 100644 index 0000000..c9b9c5b --- /dev/null +++ b/src/app/components/mod.rs @@ -0,0 +1,5 @@ +mod tag; +pub use tag::Tag; + +mod link; +pub use link::Link; \ No newline at end of file diff --git a/src/app/components/tag.rs b/src/app/components/tag.rs new file mode 100644 index 0000000..41eed71 --- /dev/null +++ b/src/app/components/tag.rs @@ -0,0 +1,14 @@ +use leptos::*; + +#[component] +pub fn Tag( + #[prop[optional]] + url: String, + children: Children +) -> impl IntoView { + view! { + + {children()} + + } +} \ No newline at end of file diff --git a/src/app.rs b/src/app/mod.rs similarity index 91% rename from src/app.rs rename to src/app/mod.rs index 8f8b74c..4cfb426 100644 --- a/src/app.rs +++ b/src/app/mod.rs @@ -1,3 +1,5 @@ +mod components; + use leptos::*; use leptos_meta::*; use leptos_router::*; @@ -7,7 +9,6 @@ pub fn App() -> impl IntoView { provide_meta_context(); view! { - @@ -26,6 +27,8 @@ fn Home() -> impl IntoView { "Welcome to Leptos with Tailwind" "Tailwind will scan your Rust files for Tailwind class names and compile them into a CSS file." + Salut + Salut i { - @apply flex items-center; - - & > svg { - @apply scale-75; - } - } -} \ No newline at end of file diff --git a/src_old/components/Link.tsx b/src_old/components/Link.tsx deleted file mode 100644 index 531204d..0000000 --- a/src_old/components/Link.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import react, { ReactNode } from 'react'; -import './Link.scss' -import { FaExternalLinkAlt } from 'react-icons/fa'; - -type LinkProps = { - children: ReactNode, - url: string -} - -function Link({ children, url }: LinkProps) { - return ( - - { children } - - - ) -} - -export default Link \ No newline at end of file diff --git a/src_old/components/Tag.scss b/src_old/components/Tag.scss deleted file mode 100644 index 31c4b70..0000000 --- a/src_old/components/Tag.scss +++ /dev/null @@ -1,4 +0,0 @@ -.tag { - @apply rounded-lg px-3 py-1 font-normal text-sm; - @apply bg-primary dark:bg-dark_primary text-on_primary dark:text-dark_on_primary; -} \ No newline at end of file diff --git a/src_old/components/Tag.tsx b/src_old/components/Tag.tsx deleted file mode 100644 index a09ef4a..0000000 --- a/src_old/components/Tag.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import './Tag.scss' - -type TagProps = { - name: string, - url?: string -} - -function Tag({ name, url }: TagProps) { - return ( - - {name} - - ) -} - -export default Tag \ No newline at end of file diff --git a/src_old/index.css b/src_old/index.css deleted file mode 100644 index bd6213e..0000000 --- a/src_old/index.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; \ No newline at end of file
"Tailwind will scan your Rust files for Tailwind class names and compile them into a CSS file."