Compare commits

..

1 Commits

Author SHA1 Message Date
review-agent-prime[bot]
0de0ca7edf Edit apps/web/app/(app)/environments/[environmentId]/surveys/components/Modal.tsx 2024-03-04 16:40:17 +00:00
2 changed files with 44 additions and 44 deletions

View File

@@ -41,20 +41,20 @@ export default function Modal({
}
let placementClass = "";
if (placement === "bottomLeft") {
placementClass = "bottom left";
} else if (placement === "bottomRight") {
placementClass = "bottom right";
} else if (placement === "topLeft") {
placementClass = "top left";
} else if (placement === "topRight") {
placementClass = "top right";
}
return {
transform: `scale(${scaleValue})`,
transformOrigin: placementClass,
switch (placement) {
case "bottomLeft":
placementClass = "bottom left";
break;
case "bottomRight":
placementClass = "bottom right";
break;
case "topLeft":
placementClass = "top left";
break;
case "topRight":
placementClass = "top right";
break;
}
};
};

View File

@@ -15,37 +15,37 @@ async function main() {
return;
}
const updates = products.map(product => {
if (product.styling !== null) {
// styling object already exists for this product
return;
}
const styling: TStyling = {
unifiedStyling: true,
allowStyleOverwrite: true,
brandColor: {
light: product.brandColor,
},
...(product.highlightBorderColor && {
highlightBorderColor: {
light: product.highlightBorderColor,
dark: product.highlightBorderColor,
if (products.length) {
for (const product of products) {
if (product.styling !== null) {
// styling object already exists for this product
continue;
}
const styling: TStyling = {
unifiedStyling: true,
allowStyleOverwrite: true,
brandColor: {
light: product.brandColor,
},
}),
};
return tx.product.update({
where: {
id: product.id,
},
data: {
styling,
},
});
});
await tx.$transaction(updates);
...(product.highlightBorderColor && {
highlightBorderColor: {
light: product.highlightBorderColor,
dark: product.highlightBorderColor,
},
}),
};
await tx.product.update({
where: {
id: product.id,
},
data: {
styling,
},
});
}
}
});
}