Skip to content

Commit

Permalink
update swap layout config
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Polyakov committed Mar 19, 2024
1 parent 1b28bee commit 97de72f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/shared/Widget/Grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function findWidgetInLayout(layout: Nullable<Layout>, widgetId: string) {
return layout?.find((widget: LayoutWidget) => widget.i === widgetId);
}
function shallowDiff<T>(a: T, b: T): Partial<T> {
function shallowDiff<T extends Record<string, boolean>>(a: T, b: T): Partial<T> {
return Object.entries(a).reduce(
(diff, [key, value]) => (isEqual(b[key], value) ? diff : { ...diff, [key]: value }),
{}
Expand Down
12 changes: 12 additions & 0 deletions src/views/Swap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ export default class Swap extends Mixins(mixins.LoadingMixin, TranslationMixin,
readonly SwapWidgets = SwapWidgets;
readonly DefaultLayouts: ResponsiveLayouts = {
lg: [
{ x: 0, y: 0, w: 6, h: 20, minW: 4, minH: 20, i: SwapWidgets.Form },
{ x: 6, y: 0, w: 9, h: 24, minW: 4, minH: 20, i: SwapWidgets.Chart },
{ x: 15, y: 0, w: 9, h: 24, minW: 4, minH: 24, i: SwapWidgets.Transactions },
{ x: 6, y: 24, w: 6, h: 6, minW: 4, minH: 6, i: SwapWidgets.Distribution },
],
md: [
{ x: 0, y: 0, w: 4, h: 20, minW: 4, minH: 20, i: SwapWidgets.Form },
{ x: 4, y: 0, w: 12, h: 20, minW: 4, minH: 20, i: SwapWidgets.Chart },
Expand All @@ -110,6 +116,12 @@ export default class Swap extends Mixins(mixins.LoadingMixin, TranslationMixin,
{ x: 0, y: 20, w: 4, h: 12, minW: 4, minH: 12, i: SwapWidgets.Distribution },
{ x: 4, y: 20, w: 4, h: 24, minW: 4, minH: 24, i: SwapWidgets.Transactions },
],
xss: [
{ x: 0, y: 0, w: 4, h: 20, minW: 4, minH: 20, i: SwapWidgets.Form },
{ x: 0, y: 20, w: 4, h: 12, minW: 4, minH: 12, i: SwapWidgets.Distribution },
{ x: 0, y: 32, w: 4, h: 20, minW: 4, minH: 20, i: SwapWidgets.Chart },
{ x: 0, y: 52, w: 4, h: 24, minW: 4, minH: 24, i: SwapWidgets.Transactions },
],
};
draggable = false;
Expand Down

0 comments on commit 97de72f

Please sign in to comment.