mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 04:55:06 +09:00
take the smallest breakpoint as default when creating a new project
no longer require to have a 0 minWidth breakpoint
This commit is contained in:
1 parent
54373336ee
commit
ab9835b30d
1 file changed
+3
-3
@@ -7,11 +7,11 @@ import {
|
||||
import { applyPatches, type Patch } from "immer";
|
||||
import { prisma } from "./prisma.server";
|
||||
import { createInstance } from "~/shared/tree-utils";
|
||||
import { sort } from "~/shared/breakpoints";
|
||||
|
||||
export const createRootInstance = (breakpoints: Array<Breakpoint>) => {
|
||||
const defaultBreakpoint = breakpoints.find(
|
||||
(breakpoint) => breakpoint.minWidth === 0
|
||||
);
|
||||
// Take the smallest breakpoint as default
|
||||
const defaultBreakpoint = sort(breakpoints)[0];
|
||||
if (defaultBreakpoint === undefined) {
|
||||
throw new Error("A breakpoint with minWidth 0 is required");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user