Skip to content

Commit

Permalink
replaced item_representation with item_widget, now styling works prop…
Browse files Browse the repository at this point in the history
…erly
  • Loading branch information
Clementine2722 committed Jul 10, 2024
1 parent 99f39bf commit 64c436d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/components/canvas/ListWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const WIDGET_TYPE = "list";
export type ListCanvasRepresentation = {
type: "list";
source: Source | Source[];
item_representation?: Representation | Representation[];
item_widget?: Representation | Representation[];
} & Representation;


Expand Down Expand Up @@ -61,10 +61,10 @@ const getListSize = (
console.error("Can't get structure item", items);
return undefined;
}
const item_representation = Array.isArray(representation.item_representation) ? (
representation.item_representation[i]
const item_representation = Array.isArray(representation.item_widget) ? (
representation.item_widget[i]
) : (
representation.item_representation
representation.item_widget
);
const itemSize = getSize(item_structure, item_representation || null);
if (itemSize === undefined) {
Expand Down Expand Up @@ -126,10 +126,10 @@ function ListCanvasComponent(props: WidgetProps) {
let collectedX = representation.style?.margin ?? 5;

const children = structure.data.map((item, i) => {
const item_representation = Array.isArray(representation.item_representation) ? (
representation.item_representation[i]
const item_representation = Array.isArray(representation.item_widget) ? (
representation.item_widget[i]
) : (
representation.item_representation
representation.item_widget
) || null;
const compSize = getSize(item, item_representation);
if (compSize === undefined) {
Expand Down
14 changes: 7 additions & 7 deletions src/components/canvas/VListWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const WIDGET_TYPE = "vlist";
export type ListCanvasRepresentation = {
type: "vlist";
source: Source | Source[];
item_representation?: Representation | Representation[];
item_widget?: Representation | Representation[];
} & Representation;


Expand Down Expand Up @@ -57,10 +57,10 @@ const getListSize = (

for (let i = 0; i < items.data.length; i++) {
const item_structure = items.data[i];
const item_representation = Array.isArray(representation.item_representation) ? (
representation.item_representation[i]
const item_representation = Array.isArray(representation.item_widget) ? (
representation.item_widget[i]
) : (
representation.item_representation
representation.item_widget
);
const itemSize = getSize(item_structure, item_representation || null);
if (itemSize === undefined) {
Expand Down Expand Up @@ -124,10 +124,10 @@ function ListCanvasComponent(props: WidgetProps) {
let collectedY = representation.style?.margin ?? 5;

const children = structure.data.map((item, i) => {
const item_representation = Array.isArray(representation.item_representation) ? (
representation.item_representation[i]
const item_representation = Array.isArray(representation.item_widget) ? (
representation.item_widget[i]
) : (
representation.item_representation
representation.item_widget
) || null;
const compSize = getSize(item, item_representation);
if (compSize === undefined) {
Expand Down

0 comments on commit 64c436d

Please sign in to comment.