Skip to content

Commit 1049934

Browse files
committed
Fix environment params duplicate text
1 parent 2df774a commit 1049934

File tree

3 files changed

+17
-29
lines changed

3 files changed

+17
-29
lines changed

app/ui/fogparameters.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@ type Fog = { primaryFogColor?: number[]; secondaryFogColor?: number[] };
66
export default function FogParams(f: Fog) {
77
const { primaryFogColor, secondaryFogColor } = f ?? {};
88

9-
const noData = !primaryFogColor && !secondaryFogColor;
10-
119
return (
12-
<ParamSection title="Fog Parameters">
13-
{noData ? (
14-
<ParamRow label="">
15-
<span className="italic text-neutral-500">
16-
No data available.
17-
</span>
18-
</ParamRow>
19-
) : (
10+
<ParamSection title="">
2011
<>
2112
<ParamRow label="Primary Fog Color">
2213
{primaryFogColor && <Swatch rgb={primaryFogColor} />}
@@ -25,7 +16,6 @@ export default function FogParams(f: Fog) {
2516
{secondaryFogColor && <Swatch rgb={secondaryFogColor} />}
2617
</ParamRow>
2718
</>
28-
)}
2919
</ParamSection>
3020
);
3121
}

app/ui/modal.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,20 @@ export default function Modal({ slug, meta, onClose }: { slug: string; meta: Sky
125125
<div className="space-y-6">
126126
<h3 className="font-medium text-neutral-200">Environment Parameters</h3>
127127
<div className="grid gap-6 lg:grid-cols-2 lg:gap-x-8 items-start">
128-
{meta?.sunParameters && <SunParams {...meta.sunParameters} />}
129-
{meta?.fogParameters && <FogParams {...meta.fogParameters} />}
128+
{/* Fog Parameters */}
129+
{meta?.fogParameters && (
130+
<div className="bg-neutral-900/50 backdrop-blur-sm rounded-xl p-6 border border-neutral-800">
131+
<h2 className="text-xl font-semibold text-white mb-4">Fog Parameters</h2>
132+
<FogParams {...meta.fogParameters} />
133+
</div>
134+
)}
135+
{/* Sun Parameters */}
136+
{meta?.sunParameters && (
137+
<div className="bg-neutral-900/50 backdrop-blur-sm rounded-xl p-6 border border-neutral-800">
138+
<h2 className="text-xl font-semibold text-white mb-4">Sun Parameters</h2>
139+
<SunParams {...meta.sunParameters} />
140+
</div>
141+
)}
130142
</div>
131143
</div>
132144
)}

app/ui/sunparameters.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,9 @@ export type Sun = {
1111
export default function SunParams(s: Sun) {
1212
const { sunAngle, pitch, brightness, ambience } = s ?? {};
1313

14-
const noData =
15-
sunAngle === undefined &&
16-
pitch === undefined &&
17-
!brightness &&
18-
!ambience;
19-
2014
return (
21-
<ParamSection title="Sun Parameters">
22-
{noData ? (
23-
<ParamRow label="">
24-
<span className="italic text-neutral-500">
25-
No data available.
26-
</span>
27-
</ParamRow>
28-
) : (
29-
<>
15+
<ParamSection title="">
16+
<>
3017
<ParamRow label="Sun Angle">{sunAngle}</ParamRow>
3118
<ParamRow label="Pitch">{pitch}</ParamRow>
3219
<ParamRow label="Brightness">
@@ -36,7 +23,6 @@ export type Sun = {
3623
{ambience && <Swatch rgb={ambience} />}
3724
</ParamRow>
3825
</>
39-
)}
4026
</ParamSection>
4127
);
4228
}

0 commit comments

Comments
 (0)