Skip to content

Commit

Permalink
fix(website): updated #[component] annotations
Browse files Browse the repository at this point in the history
The latest Sycamore update properly breaks the old syntax, which was
still being used in some places. This has been breaking CI tests across branches.
  • Loading branch information
arctic-hen7 committed Oct 23, 2022
1 parent e678d44 commit 430d4a2
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion website/src/components/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct ContainerProps<'a, G: Html> {
pub footer: bool,
}

#[component(Container<G>)]
#[component]
pub fn Container<'a, G: Html>(cx: Scope<'a>, props: ContainerProps<'a, G>) -> View<G> {
let children = props.children.call(cx);

Expand Down
6 changes: 3 additions & 3 deletions website/src/templates/comparisons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct ComparisonRowProps<'a> {
comparison_val: &'a ReadSignal<String>,
name: String,
}
#[component(ComparisonRow<G>)]
#[component]
fn ComparisonRow<'a, G: Html>(cx: Scope<'a>, props: ComparisonRowProps<'a>) -> View<G> {
let show_details = create_signal(cx, false);
let name = create_ref(cx, props.name);
Expand Down Expand Up @@ -67,7 +67,7 @@ struct ComparisonTableProps<'a> {
comparison: &'a ReadSignal<Comparison>,
perseus_comparison: Comparison,
}
#[component(ComparisonTable<G>)]
#[component]
fn ComparisonTable<'a, G: Html>(cx: Scope<'a>, props: ComparisonTableProps<'a>) -> View<G> {
let comparison = props.comparison;
let Comparison {
Expand Down Expand Up @@ -279,7 +279,7 @@ pub struct ComparisonsPageProps {
}

#[perseus::template(ComparisonsPage)]
#[component(ComparisonsPage<G>)]
#[component]
pub fn comparisons_page<G: Html>(cx: Scope, props: ComparisonsPageProps) -> View<G> {
let comparisons = props.comparisons.clone();
let perseus_comparison = props.perseus_comparison;
Expand Down
4 changes: 2 additions & 2 deletions website/src/templates/docs/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct DocsVersionSwitcherProps {
manifest: DocsManifest,
current_version: String,
}
#[component(DocsVersionSwitcher<G>)]
#[component]
fn DocsVersionSwitcher<G: Html>(cx: Scope, props: DocsVersionSwitcherProps) -> View<G> {
// We'll fill this in from the reactive scope
// Astonishingly, this actually works...
Expand Down Expand Up @@ -100,7 +100,7 @@ pub struct DocsContainerProps<G: GenericNode> {
pub current_version: String,
}

#[component(DocsContainer<G>)]
#[component]
pub fn DocsContainer<G: Html>(cx: Scope, props: DocsContainerProps<G>) -> View<G> {
let docs_links = props.docs_links.clone();
let docs_links_clone = docs_links.clone();
Expand Down
1 change: 1 addition & 0 deletions website/src/templates/docs/search_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use sycamore::prelude::*;
// }
// }

#[component]
pub fn SearchBar<G: Html>(_cx: Scope) -> View<G> {
View::empty()
}
Expand Down
2 changes: 1 addition & 1 deletion website/src/templates/docs/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct DocsPageProps {
}

#[perseus::template(DocsPage)]
#[component(DocsPage<G>)]
#[component]
pub fn docs_page<G: Html>(cx: Scope, props: DocsPageProps) -> View<G> {
// These come pre-translated for the current locale
// Note that all the docs files have a title emblazoned at the top already, so
Expand Down
2 changes: 1 addition & 1 deletion website/src/templates/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ fn AnimatedCircularProgressBar<G: Html>(
}

#[perseus::template(IndexPage)]
#[component(IndexPage<G>)]
#[component]
pub fn index_page<G: Html>(cx: Scope, examples: CodeExamples) -> View<G> {
// // Fix these on mobile
// let nav_buttons = match props.nav_buttons {
Expand Down
2 changes: 1 addition & 1 deletion website/src/templates/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct PluginDetails {
}

#[perseus::template(PluginsPage)]
#[component(PluginsPage<G>)]
#[component]
fn plugins_page<G: Html>(cx: Scope, props: PluginsPageProps) -> View<G> {
let plugins = create_signal(cx, props.plugins);
// This will store the plugins relevant to the user's search (all of them by
Expand Down

0 comments on commit 430d4a2

Please sign in to comment.