Skip to content

Commit 78ec4a3

Browse files
committed
🎨 Improve descriptions and component position for replenished workbook (#1726)
1 parent f1d6004 commit 78ec4a3

File tree

1 file changed

+46
-43
lines changed

1 file changed

+46
-43
lines changed

src/lib/components/WorkBooks/WorkBookList.svelte

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,21 @@
103103
<!-- TODO: 「ユーザ作成」の問題集には、検索機能を追加 -->
104104
{#if workbookType === WorkBookType.CURRICULUM}
105105
<div class="mb-6">
106-
<div class="flex flex-col md:flex-row items-start md:items-center justify-between">
107-
<div class="flex items-center space-x-4">
108-
<ButtonGroup>
109-
{#each AVAILABLE_GRADES as grade}
110-
<Button
111-
onclick={() => filterByGradeMode(grade)}
112-
class={selectedGrade === grade ? 'text-primary-700' : 'text-gray-900'}
113-
>
114-
{getTaskGradeLabel(grade)}
115-
</Button>
116-
{/each}
117-
</ButtonGroup>
118-
119-
<TooltipWrapper
120-
tooltipContent="問題集のグレードを指定します(最頻値。2つ以上ある場合は、最も易しいグレードに掲載)"
121-
/>
122-
</div>
123-
124-
<div class="mt-4 md:mt-0">
125-
<Toggle bind:checked={isShowReplenishment}>「補充」があれば表示</Toggle>
126-
</div>
106+
<div class="flex items-center space-x-4">
107+
<ButtonGroup>
108+
{#each AVAILABLE_GRADES as grade}
109+
<Button
110+
onclick={() => filterByGradeMode(grade)}
111+
class={selectedGrade === grade ? 'text-primary-700' : 'text-gray-900'}
112+
>
113+
{getTaskGradeLabel(grade)}
114+
</Button>
115+
{/each}
116+
</ButtonGroup>
117+
118+
<TooltipWrapper
119+
tooltipContent="問題集のグレードを指定します(最頻値。2つ以上ある場合は、最も易しいグレードに掲載)"
120+
/>
127121
</div>
128122
</div>
129123
{/if}
@@ -144,31 +138,40 @@
144138
/>
145139
</div>
146140

147-
<!-- カリキュラムの場合、かつ、公開されている【補充】問題集があるときだけ表示 -->
148-
{#if workbookType === WorkBookType.CURRICULUM && readableReplenishedWorkbooksCount() && isShowReplenishment}
141+
<!-- カリキュラム、かつ、公開されている【補充】問題集があるときのみ -->
142+
{#if workbookType === WorkBookType.CURRICULUM && readableReplenishedWorkbooksCount()}
149143
<div class="mt-12">
150-
<div class="flex items-center space-x-3 pb-4">
151-
<div class="text-2xl dark:text-white">補充</div>
152-
153-
<LabelWithTooltips
154-
labelName=""
155-
tooltipId="tooltip-for-replenished-workbooks"
156-
tooltipContents={[
157-
'(任意)',
158-
'特定の課題を持つ人向けの問題集です。',
159-
'苦手意識があれば、挑戦してみましょう。',
160-
]}
161-
/>
144+
<!-- 見出しと説明文、表示の切り替え用ボタンを常に表示 -->
145+
<div class="flex flex-col md:flex-row items-start md:items-center md:space-x-6">
146+
<div class="flex items-center space-x-1 pb-0 md:pb-4">
147+
<div class="text-2xl dark:text-white">補充</div>
148+
149+
<LabelWithTooltips
150+
labelName=""
151+
tooltipId="tooltip-for-replenished-workbooks"
152+
tooltipContents={[
153+
'(任意)',
154+
'特定の課題(数学的素養や実装力など)を持つ人向けの問題集です。',
155+
'苦手意識があれば、挑戦してみましょう。',
156+
]}
157+
/>
158+
</div>
159+
160+
<div class="mt-4 md:mt-0 pb-4">
161+
<Toggle bind:checked={isShowReplenishment}>表示</Toggle>
162+
</div>
162163
</div>
163164

164-
<WorkBookBaseTable
165-
{workbookType}
166-
workbooks={replenishedWorkbooks}
167-
{workbookGradeModes}
168-
{userId}
169-
{role}
170-
taskResults={taskResultsWithWorkBookId}
171-
/>
165+
{#if isShowReplenishment}
166+
<WorkBookBaseTable
167+
{workbookType}
168+
workbooks={replenishedWorkbooks}
169+
{workbookGradeModes}
170+
{userId}
171+
{role}
172+
taskResults={taskResultsWithWorkBookId}
173+
/>
174+
{/if}
172175
</div>
173176
{/if}
174177
{:else}

0 commit comments

Comments
 (0)