mirror of
https://github.com/adoyle0/thaw.git
synced 2025-02-02 08:34:15 -05:00
fix: the grid property is changed to a non-negative
This commit is contained in:
parent
c46f8f9eac
commit
0404b5bf94
2 changed files with 6 additions and 6 deletions
|
@ -4,7 +4,7 @@ use leptos::*;
|
|||
#[component]
|
||||
pub fn GridItem(
|
||||
#[prop(default = MaybeSignal::Static(1u16), into)] column: MaybeSignal<u16>,
|
||||
#[prop(optional, into)] offset: MaybeSignal<i32>,
|
||||
#[prop(optional, into)] offset: MaybeSignal<u16>,
|
||||
children: Children,
|
||||
) -> impl IntoView {
|
||||
let grid = use_grid();
|
||||
|
@ -12,7 +12,7 @@ pub fn GridItem(
|
|||
let style = create_memo(move |_| {
|
||||
let mut style = String::new();
|
||||
let offset = offset.get();
|
||||
let column = i32::from(column.get());
|
||||
let column = column.get();
|
||||
let x_gap = grid.x_gap.get();
|
||||
|
||||
if offset > 0 {
|
||||
|
|
|
@ -6,8 +6,8 @@ use leptos::*;
|
|||
#[component]
|
||||
pub fn Grid(
|
||||
#[prop(default = MaybeSignal::Static(1u16), into)] cols: MaybeSignal<u16>,
|
||||
#[prop(optional, into)] x_gap: MaybeSignal<i32>,
|
||||
#[prop(optional, into)] y_gap: MaybeSignal<i32>,
|
||||
#[prop(optional, into)] x_gap: MaybeSignal<u16>,
|
||||
#[prop(optional, into)] y_gap: MaybeSignal<u16>,
|
||||
children: Children,
|
||||
) -> impl IntoView {
|
||||
let grid_injection_key = GridInjection::new(x_gap);
|
||||
|
@ -32,11 +32,11 @@ pub fn Grid(
|
|||
|
||||
#[derive(Clone)]
|
||||
pub(crate) struct GridInjection {
|
||||
x_gap: MaybeSignal<i32>,
|
||||
x_gap: MaybeSignal<u16>,
|
||||
}
|
||||
|
||||
impl GridInjection {
|
||||
pub fn new(x_gap: MaybeSignal<i32>) -> Self {
|
||||
pub fn new(x_gap: MaybeSignal<u16>) -> Self {
|
||||
Self { x_gap }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue