Skip to content

Commit

Permalink
make cols props reactive
Browse files Browse the repository at this point in the history
  • Loading branch information
samijaber committed Apr 22, 2024
1 parent 46bd611 commit c85e1f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/sdks/src/blocks/columns/columns.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ useMetadata({

export default function Columns(props: ColumnProps) {
const state = useStore({
gutterSize: typeof props.space === 'number' ? props.space || 0 : 20,
cols: props.columns || [],
get gutterSize() {
return typeof props.space === 'number' ? props.space || 0 : 20;
},
get cols() {
return props.columns || [];
},
stackAt: props.stackColumnsAt || 'tablet',
getWidth(index: number) {
return state.cols[index]?.width || 100 / state.cols.length;
Expand Down

0 comments on commit c85e1f3

Please sign in to comment.