Skip to content

Commit

Permalink
feat: added theme_override to page wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Feb 28, 2024
1 parent d934058 commit d4b1226
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/site-app/src/pages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ use crate::components::basic::Link;
pub fn SmallPageWrapper(
children: Children,
#[prop(default = "")] extra_class: &'static str,
#[prop(default = None)] theme_override: Option<&'static str>,
) -> impl IntoView {
view! {
<div class={format!("flex-1 flex flex-col justify-center items-center h-full {extra_class}")}>
<div
class={format!("flex-1 flex flex-col justify-center items-center h-full {extra_class}")}
data-theme=theme_override
>
<div class="d-card w-full max-w-sm bg-base-100 rounded-lg shadow-xl">
{children()}
</div>
Expand All @@ -33,6 +37,7 @@ pub fn PageWrapper(
#[prop(default = true)]
backed: bool,
#[prop(default = "")] extra_class: &'static str,
#[prop(default = None)] theme_override: Option<&'static str>,
) -> impl IntoView {
view! {
<div class={format!(
Expand All @@ -41,7 +46,7 @@ pub fn PageWrapper(
rounded = if backed { "md:rounded-xl" } else { "" },
shadow = if backed { "shadow" } else { "" },
bg_color = if backed { "bg-base-100" } else { "" },
)}>
)} data-theme=theme_override>
{children()}
</div>
}
Expand Down

0 comments on commit d4b1226

Please sign in to comment.