fix(components): Fix conditional rendering logic in kids elements files

This commit is contained in:
Fatih Kadir Akın
2026-01-15 14:38:41 +03:00
parent 05dd221ae3
commit a70f6b1aa5
7 changed files with 18 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 271 KiB

View File

@@ -382,7 +382,7 @@ export function DragDropPrompt({
>
{t("check")}
</button>
) : (
) : !correct ? (
<button
onClick={handleReset}
className="px-6 py-3 bg-[#8B4513] hover:bg-[#A0522D] text-white font-bold text-xl transition-colors"
@@ -390,7 +390,7 @@ export function DragDropPrompt({
>
{t("retry")}
</button>
)}
) : null}
</div>
</div>
);

View File

@@ -173,14 +173,14 @@ export function ExampleMatcher({
>
{t("check")}
</button>
) : (
) : !isCorrect ? (
<button
onClick={handleReset}
className="px-6 py-2 rounded-lg font-bold bg-[#6366F1] hover:bg-[#4F46E5] text-white"
>
{t("retry")}
</button>
)}
) : null}
</div>
{/* Result feedback */}

View File

@@ -306,12 +306,12 @@ export function MagicWords({
<Check className="h-5 w-5 mr-2" />
{t("check")}
</Button>
) : (
) : !allCorrect ? (
<Button onClick={handleReset} variant="outline" className="rounded-full h-12 text-xl px-6">
<RefreshCw className="h-5 w-5 mr-2" />
{t("retry")}
</Button>
)}
) : null}
</div>
</div>
</div>

View File

@@ -225,14 +225,16 @@ export function PromptVsMistake({
<p className="text-sm text-[#5D4037] m-0">{promiMessage}</p>
</div>
)}
<button
onClick={handleReset}
className="mt-3 inline-flex items-center gap-1 px-4 py-2 bg-[#8B4513] hover:bg-[#A0522D] text-white text-sm font-bold transition-colors"
style={{ clipPath: smallPixelClipPath }}
>
<PixelRefreshIcon />
{t("tryAgain")}
</button>
{!isCorrect && (
<button
onClick={handleReset}
className="mt-3 inline-flex items-center gap-1 px-4 py-2 bg-[#8B4513] hover:bg-[#A0522D] text-white text-sm font-bold transition-colors"
style={{ clipPath: smallPixelClipPath }}
>
<PixelRefreshIcon />
{t("tryAgain")}
</button>
)}
</div>
)}
</div>

View File

@@ -207,7 +207,7 @@ export function WordPredictor({
)}
{/* Reset button */}
{submitted && (
{submitted && !isCorrect && (
<button
onClick={handleReset}
className="px-6 py-2 font-bold bg-[#6366F1] hover:bg-[#4F46E5] text-white"

View File

@@ -1150,7 +1150,7 @@ export function PromptForm({ categories, tags, initialData, initialContributors
value={field.value}
onChange={field.onChange}
language="markdown"
placeholder={`# My Skill\n\nDescribe what this skill does and how the agent should use it.\n\n## Instructions\n\n- Step 1: ...\n- Step 2: ...`}
placeholder={`---\nname: my-skill-name\ndescription: A clear description of what this skill does and when to use it\n---\n\n# My Skill\n\nDescribe what this skill does and how the agent should use it.\n\n## Instructions\n\n- Step 1: ...\n- Step 2: ...`}
minHeight="400px"
className="border-0 rounded-none"
/>