fix: Disable redeem button when points exceed available limit
This commit is contained in:
parent
9dc3edb40e
commit
4e64d0b24e
2 changed files with 3 additions and 2 deletions
|
@ -48,6 +48,7 @@ function RedeemPointsModal({ config }) {
|
||||||
{predefinedPoints.map(point => (
|
{predefinedPoints.map(point => (
|
||||||
<IconButton
|
<IconButton
|
||||||
variant='outlined'
|
variant='outlined'
|
||||||
|
disabled={points + point > config.available}
|
||||||
sx={{ borderRadius: '50%' }}
|
sx={{ borderRadius: '50%' }}
|
||||||
key={point}
|
key={point}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -69,7 +70,7 @@ function RedeemPointsModal({ config }) {
|
||||||
<Button
|
<Button
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
config.onSave({
|
config.onSave({
|
||||||
points,
|
points: Number(points),
|
||||||
userId: config.user.userId,
|
userId: config.user.userId,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ const TaskInput = ({ autoFocus, onChoreUpdate }) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
frequencyType: 'daily',
|
frequencyType: 'daily',
|
||||||
regex: /(every day|daily)$/i,
|
regex: /(every day|daily|everyday)$/i,
|
||||||
name: 'Every day',
|
name: 'Every day',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue