Skip to content

Commit

Permalink
Updates to fix change requests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuidoZam committed Aug 14, 2024
1 parent e43d2d6 commit 259c544
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions docs/documentation/docs/controls/Dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ Provides size of the widget
| Single | Single-sized grid item. |
| Double | Double-width grid item. |
| Triple | Triple width grid item. |
| Quadruple | Quadruple width grid item. |
| Box | Double-width, double-height grid item. |

![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/Dashboard)
28 changes: 16 additions & 12 deletions src/controls/dashboard/widget/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ export const Widget = ({
gridColumnEnd: "span 4",
},
};
if (widget.size === WidgetSize.Double) {
cardStyle.gridColumnEnd = "span 2";
}
if (widget.size === WidgetSize.Box) {
cardStyle.gridColumnEnd = "span 2";
cardStyle.gridRowEnd = "span 2";
}
if (widget.size === WidgetSize.Triple) {
cardStyle.gridColumnEnd = "span 3";
}
if (widget.size === WidgetSize.Quadruple) {
cardStyle.gridColumnEnd = "span 4";

switch (widget.size) {
case WidgetSize.Double:
cardStyle.gridColumnEnd = "span 2";
break;
case WidgetSize.Box:
cardStyle.gridColumnEnd = "span 2";
cardStyle.gridRowEnd = "span 2";
break;
case WidgetSize.Triple:
cardStyle.gridColumnEnd = "span 3";
break;
case WidgetSize.Quadruple:
cardStyle.gridColumnEnd = "span 4";
break
}

if(widget.controlOptions && widget.controlOptions.isHidden){
return null;
}
Expand Down

0 comments on commit 259c544

Please sign in to comment.