✨ Change rendering from id to type
This commit is contained in:
1 parent
66f9dd51dd
commit
43dc1cd70c
3 files changed
+9
-7
No files matched your search
@@ -42,17 +42,18 @@ export function WrapperContent({ apps, refs, widgets }: WrapperContentProps) {
|
||||
);
|
||||
})}
|
||||
{widgets.map((widget) => {
|
||||
const definition = Widgets[widget.id as keyof typeof Widgets] as
|
||||
const definition = Widgets[widget.type as keyof typeof Widgets] as
|
||||
| IWidgetDefinition
|
||||
| undefined;
|
||||
if (!definition) return null;
|
||||
console.log(definition);
|
||||
|
||||
return (
|
||||
<GridstackTileWrapper
|
||||
type="widget"
|
||||
key={widget.id}
|
||||
itemRef={refs.items.current[widget.id]}
|
||||
id={definition.id}
|
||||
id={widget.id}
|
||||
{...definition.gridstack}
|
||||
{...widget.shape[shapeSize]?.location}
|
||||
{...widget.shape[shapeSize]?.size}
|
||||
@@ -60,7 +61,7 @@ export function WrapperContent({ apps, refs, widgets }: WrapperContentProps) {
|
||||
<WidgetWrapper
|
||||
className="grid-stack-item-content"
|
||||
widget={widget}
|
||||
widgetId={widget.id}
|
||||
widgetType={widget.type}
|
||||
WidgetComponent={definition.component}
|
||||
/>
|
||||
</GridstackTileWrapper>
|
||||
|
||||
Reference in new issue
Block a user