Skip to content

Commit 23d1495

Browse files
Move example button to the top of challenge example
1 parent d0c7cc1 commit 23d1495

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

components/challenges/ItemExamples.vue

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@
1616
'border-success': example.solved == 'solved',
1717
'border-error': example.solved != 'solved' && example.solved != 'pending',
1818
}">
19+
<div class="flex justify-between mb-4">
20+
<p class="text-heading">{{ t("Headings.Example") }}: {{ i + 1 }}</p>
21+
<div v-if="example.solved == 'solved' && !example.loading"
22+
class="flex items-center bg-primary py-1.5 px-2 rounded-md shadow-md">
23+
<CheckCircleIcon class="h-5 w-5 text-accent mr-2" />
24+
<p class="text-sm text-success">
25+
{{ t("Headings.Solved") }}
26+
</p>
27+
</div>
28+
<InputBtn v-else secondary :icon="PlayIcon" :loading="example.loading" @click="testExample(example.id)" sm
29+
class="text-white">
30+
{{ t("Buttons.Test") }}
31+
</InputBtn>
32+
</div>
1933
<div class="sm:flex max-sm:space-y-2 sm:space-x-4 mb-4">
2034
<div class="w-full text-sm bg-secondary py-2 px-4 rounded-md">
2135
<p class="text-white">
@@ -54,7 +68,8 @@
5468
<p class="whitespace-pre-wrap"> {{ example?.stderr ?? '' }} </p>
5569
</div>
5670

57-
<div class="text-sm bg-primary py-2 px-4 rounded-md my-4" v-if="!!example?.stdout && example.solved != 'solved' && !example.loading">
71+
<div class="text-sm bg-primary py-2 px-4 rounded-md my-4"
72+
v-if="!!example?.stdout && example.solved != 'solved' && !example.loading">
5873
<p class="text-success mb-2">{{ t("Headings.ActualOutput") }}:</p>
5974
<p class="whitespace-pre-wrap"> {{ example?.stdout ?? '' }} </p>
6075
</div>
@@ -64,19 +79,7 @@
6479
<p class="whitespace-pre-wrap"> {{ example?.explanation ?? '' }} </p>
6580
</div>
6681

67-
<div class="flex justify-end">
68-
<div v-if="example.solved == 'solved' && !example.loading"
69-
class="flex items-center bg-primary py-1.5 px-2 rounded-md shadow-md">
70-
<CheckCircleIcon class="h-5 w-5 text-accent mr-2" />
71-
<p class="text-sm text-success">
72-
{{ t("Headings.Solved") }}
73-
</p>
74-
</div>
75-
<InputBtn v-else secondary :icon="PlayIcon" :loading="example.loading" @click="testExample(example.id)" sm
76-
class="text-white">
77-
{{ t("Buttons.Test") }}
78-
</InputBtn>
79-
</div>
82+
8083
</div>
8184
</section>
8285
</div>

0 commit comments

Comments
 (0)