Skip to content

Commit dd9a269

Browse files
committed
build: upgrade leptos from v4 to v5
1 parent 23b4e35 commit dd9a269

12 files changed

+19
-30
lines changed

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
leptos = { version = "0.4.8", features = ["csr", "nightly"] }
8-
leptos_meta = { version = "0.4.8", features = ["csr", "nightly"] }
9-
leptos_router = { version = "0.4.8", features = ["csr", "nightly"] }
7+
leptos = { version = "0.5.0-beta", features = ["csr", "nightly"] }
8+
leptos_meta = { version = "0.5.0-beta", features = ["csr", "nightly"] }
9+
leptos_router = { version = "0.5.0-beta", features = ["csr", "nightly"] }
1010
log = "0.4"
1111
gloo-net = { version = "0.2", features = ["http"] }
1212

src/app.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ use leptos_router::*;
55
use crate::pages::index::Index;
66

77
#[component]
8-
pub fn App(cx: Scope) -> impl IntoView {
9-
provide_meta_context(cx);
8+
pub fn App() -> impl IntoView {
9+
provide_meta_context();
1010

1111
view! {
12-
cx,
1312
<Stylesheet id="leptos" href="/pkg/tailwind.css"/>
1413
<Link rel="shortcut icon" type_="image/ico" href="/LogoSegunMichael.ico"/>
1514
<Router>
1615
<Routes>
17-
<Route path="" view= move |cx| view! { cx, <Index /> }/>
16+
<Route path="" view=|| view! { <Index /> }/>
1817
</Routes>
1918
</Router>
2019
}

src/components/button_link.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use leptos::*;
33

44
#[component]
55
pub fn ButtonLink(
6-
cx: Scope,
76
href: String,
87
#[prop(default = "primary".to_string())] color: String,
98
#[prop(default = "normal".to_string())] size: String,
@@ -20,13 +19,13 @@ pub fn ButtonLink(
2019
let current_color = colors.get(&color).unwrap().to_string();
2120
let current_size = sizes.get(&size).unwrap().to_string();
2221

23-
view! { cx,
22+
view! {
2423
<a
2524
href=href.to_string()
2625
target="_blank"
2726
class=format!("tracking-widest font-work-sans border border-black flex items-center px-4 drop-shadow-[4px_4px_0_rgba(0,0,0)] hover:drop-shadow-[0_0_0_rgba(0,0,0)] transition w-fit gap-x-4 {} {}", current_color, current_size)
2827
>
29-
{children(cx)}
28+
{children()}
3029
</a>
3130
}
3231
}

src/components/header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use leptos::*;
33
use crate::components::button_link::ButtonLink;
44

55
#[component]
6-
pub fn Header(cx: Scope) -> impl IntoView {
7-
view! { cx,
6+
pub fn Header() -> impl IntoView {
7+
view! {
88
<header class="border-b border-b-black/20">
99
<div class="container mx-auto px-4 flex items-center justify-between">
1010
<div class="flex items-center gap-x-4">

src/components/hero.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use leptos::*;
33
use crate::components::header::Header;
44

55
#[component]
6-
pub fn Hero(cx: Scope) -> impl IntoView {
7-
view! { cx,
6+
pub fn Hero() -> impl IntoView {
7+
view! {
88
<section class="w-full flex flex-col">
99
<Header />
1010
<div class="flex items-center justify-center py-32">

src/components/icons/discord_icon.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ use leptos::*;
22

33
#[component]
44
pub fn DiscordIcon(
5-
cx: Scope,
65
#[prop(default = 40)] size: u32,
76
#[prop(default = "fill-black".to_string())] class: String,
87
) -> impl IntoView {
98
view!{
10-
cx,
119
<svg
1210
width=size
1311
height=size

src/components/icons/github_icon.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ use leptos::*;
22

33
#[component]
44
pub fn GithubIcon (
5-
cx: Scope,
65
#[prop(default = 40)] size: u32,
76
#[prop(default = "fill-black".to_string())] class: String,
87
) -> impl IntoView {
98
view! {
10-
cx,
119
<svg
1210
width=size
1311
height=size

src/components/icons/telegram_icon.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ use leptos::*;
22

33
#[component]
44
pub fn TelegramIcon(
5-
cx: Scope,
65
#[prop(default = 40)] size: u32,
76
#[prop(default = "fill-black".to_string())] class: String,
87
) -> impl IntoView {
98
view! {
10-
cx,
119
<svg
1210
width=size
1311
height=size

src/components/other_communities.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::components::icons::discord_icon::DiscordIcon;
44
use crate::components::icons::telegram_icon::TelegramIcon;
55

66
#[component]
7-
pub fn OtherCommunities(cx: Scope) -> impl IntoView {
8-
view! { cx,
7+
pub fn OtherCommunities() -> impl IntoView {
8+
view! {
99
<section class="bg-orange-100 py-20">
1010
<div class="container mx-auto px-4">
1111
<div class="w-full grid grid-cols-4 gap-x-8">

src/components/our_communities.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ use crate::components::icons::telegram_icon::TelegramIcon;
66
use crate::components::button_link::ButtonLink;
77

88
#[component]
9-
pub fn OurCommunities(cx: Scope) -> impl IntoView {
9+
pub fn OurCommunities() -> impl IntoView {
1010
view! {
11-
cx,
1211
<section class="bg-orange-300/30">
1312
<div class="container mx-auto px-4">
1413
<div class="flex flex-col items-center py-20 gap-y-6">

src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111

1212
log!("csr mode - mounting to body");
1313

14-
mount_to_body(|cx| {
15-
view! { cx, <App /> }
14+
mount_to_body(|| {
15+
view! { <App /> }
1616
});
1717
}

src/pages/index.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ use crate::components::our_communities::OurCommunities;
55
use crate::components::other_communities::OtherCommunities;
66

77
#[component]
8-
pub fn Index(
9-
cx: Scope
10-
) -> impl IntoView {
11-
view!{ cx,
8+
pub fn Index() -> impl IntoView {
9+
view!{
1210
<div>
1311
<Hero />
1412
<main>

0 commit comments

Comments
 (0)