Add FamDone Brand component and add rewards count system

This commit is contained in:
JCEEE
2026-09-02 13:32:11 +01:00
parent eaa5104817
commit 1360799b60
11 changed files with 123 additions and 54 deletions
+2 -4
View File
@@ -277,8 +277,7 @@ export const actions: Actions = {
rewardType: (fd.get('rewardType') as string) || 'points',
rewardValue: (fd.get('rewardValue') as string) || '',
criteriaValue: Number(fd.get('criteriaValue') || 0),
period: (fd.get('period') as string) || 'weekly',
isPocketMoney: fd.get('isPocketMoney') === 'true'
period: (fd.get('period') as string) || 'weekly'
});
}
return { success: true };
@@ -322,8 +321,7 @@ export const actions: Actions = {
rewardType: (fd.get('rewardType') as string) || 'points',
rewardValue: (fd.get('rewardValue') as string) || '',
criteriaValue: Number(fd.get('criteriaValue') || 0),
period: (fd.get('period') as string) || 'weekly',
isPocketMoney: fd.get('isPocketMoney') === 'true'
period: (fd.get('period') as string) || 'weekly'
});
}
return { success: true };
+8 -23
View File
@@ -45,8 +45,7 @@
rewardType: 'points',
rewardValue: '',
criteriaValue: 0,
period: 'weekly',
isPocketMoney: false
period: 'weekly'
};
let tplVals = $state({ ...blankTpl });
@@ -74,8 +73,7 @@
rewardType: rec.rewardType || 'points',
rewardValue: rec.rewardValue ?? '',
criteriaValue: rec.criteriaValue ?? 0,
period: rec.period || 'weekly',
isPocketMoney: !!rec.isPocketMoney
period: rec.period || 'weekly'
};
showTplModal = true;
}
@@ -522,11 +520,11 @@
</label>
<label>
Type
<select name="bonusType" bind:value={tplVals.bonusType}>
<option value="threshold">Threshold</option>
<option value="count">Count</option>
<option value="manual">Manual</option>
</select>
<select name="bonusType" bind:value={tplVals.bonusType}>
<option value="threshold">Threshold</option>
<option value="count">Count - (chores)</option>
<option value="manual">Manual</option>
</select>
</label>
{#if tplVals.bonusType === 'threshold'}
<label>
@@ -568,15 +566,7 @@
<option value="monthly">Monthly</option>
</select>
</label>
<label class="check">
<input
type="checkbox"
name="isPocketMoney"
value="true"
bind:checked={tplVals.isPocketMoney}
/>
Pocket Money
</label>
{/if}
<div class="modal-actions">
@@ -1118,11 +1108,6 @@
background: #dcfce7;
color: #166534;
}
.check {
display: flex;
align-items: center;
gap: 0.4rem;
}
/* ── Modal (shared) ── */
.overlay {