Skip to content

Commit a9e3e0f

Browse files
authored
Merge branch 'main' into translate-variables-hi
2 parents a3e8fc1 + 893004c commit a9e3e0f

File tree

6 files changed

+1446
-12
lines changed

6 files changed

+1446
-12
lines changed

src/components/CodeEmbed/index.jsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,23 @@ export const CodeEmbed = (props) => {
4444
previewHeight = previewHeight || parseFloat(canvasMatch[2]);
4545
}
4646

47-
const largeSketch = previewWidth && previewWidth > 770 - 60;
48-
4947
// Quick hack to make room for DOM that gets added below the canvas by default
5048
const domMatch = /create(Button|Select|P|Div|Input|ColorPicker)/.exec(initialCode);
5149
if (domMatch && previewHeight) {
5250
previewHeight += 100;
5351
}
5452

53+
// Fallback preview size when no usable canvas dimensions are detected.
54+
// Ensures DOM-based examples (e.g., createCapture with noCanvas) are visible.
55+
const DEFAULT_PREVIEW_WIDTH = 400;
56+
const DEFAULT_PREVIEW_HEIGHT = 300;
57+
if (previewWidth === undefined || previewHeight === undefined) {
58+
previewWidth = previewWidth ?? DEFAULT_PREVIEW_WIDTH;
59+
previewHeight = previewHeight ?? DEFAULT_PREVIEW_HEIGHT;
60+
}
61+
62+
const largeSketch = previewWidth && previewWidth > 770 - 60;
63+
5564
const codeFrameRef = useRef(null);
5665

5766
const updateOrReRun = () => {

src/components/Dropdown/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ export const Dropdown = ({
152152
</div>
153153
<button
154154
onClick={() => handleOptionClick(option)}
155-
ref={el => {
156-
optionRefs.current[index] = el as HTMLButtonElement
155+
ref={(el) => {
156+
optionRefs.current[index] = el as HTMLButtonElement;
157157
}}
158158
onBlur={handleBlur}
159159
>

src/components/PageHeader/HomePage.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { config } = Astro.props;
1010
1111
---
1212

13-
<div class="px-lg pt-[11.25rem] lg:pt-3xl pb-0 h-full">
13+
<div class="max-lg:flex max-lg:flex-col px-lg pt-[11.25rem] lg:pt-3xl pb-0 h-full">
1414
<div class="homepage-header-top">
1515
<div class="grid grid-cols-3 lg:grid-cols-4 gap-md overflow-visible h-min">
1616
<p class="col-span-2 lg:col-span-3 mt-0 text-md md:text-xl lg:text-3xl">
@@ -39,7 +39,7 @@ const { config } = Astro.props;
3939
{
4040
config.data.heroImages.map((im, i) => (
4141
im.linkTarget ?
42-
<a href={im.linkTarget} class={`hero-image-container ${i > 0 ? "hidden" : ""}`}>
42+
<a href={im.linkTarget} class={`max-lg:flex-1 max-lg:min-h-0 hero-image-container ${i > 0 ? "hidden" : ""}`}>
4343
<Image
4444
containerClass={"relative"}
4545
class={"hero-image"}
@@ -51,7 +51,7 @@ const { config } = Astro.props;
5151
</a>
5252
:
5353
<Image
54-
containerClass={`relative hero-image-container ${i > 0 ? "hidden" : ""}`}
54+
containerClass={`max-lg:flex-1 max-lg:min-h-0 relative hero-image-container ${i > 0 ? "hidden" : ""}`}
5555
class={"hero-image"}
5656
aspectRatio="none"
5757
src={im.image}

0 commit comments

Comments
 (0)