Les échecs de défis donnent lieu à un mouvement de points nul
This commit is contained in:
@ -32,7 +32,7 @@ function MoneyUpdateListItem({ moneyUpdate }: { moneyUpdate: MoneyUpdate }) {
|
||||
case 'START': return 'star'
|
||||
case 'NEW_RUN': return 'run'
|
||||
case 'BUY_TRAIN': return 'train'
|
||||
case 'WIN_CHALLENGE': return 'cards'
|
||||
case 'CHALLENGE': return 'cards'
|
||||
}
|
||||
}, [moneyUpdate.reason])
|
||||
|
||||
@ -50,7 +50,7 @@ function MoneyUpdateListItem({ moneyUpdate }: { moneyUpdate: MoneyUpdate }) {
|
||||
const arrDateTime = new Date(train.arrivalTime)
|
||||
const arrTime = arrDateTime.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' })
|
||||
return `${train.from} ${depTime} => ${train.to} ${arrTime}`
|
||||
case 'WIN_CHALLENGE':
|
||||
case 'CHALLENGE':
|
||||
const challengeAction = challengeActions.find((challengeAction) => challengeAction.id === moneyUpdate.actionId)
|
||||
if (!challengeAction) return "Défi"
|
||||
const challenge = challenges.find((challenge) => challenge.id === challengeAction.challengeId)
|
||||
@ -62,7 +62,7 @@ function MoneyUpdateListItem({ moneyUpdate }: { moneyUpdate: MoneyUpdate }) {
|
||||
const description = useMemo(() => {
|
||||
const earnDate = new Date(moneyUpdate.timestamp).toLocaleDateString(undefined, { day: '2-digit', month: '2-digit' })
|
||||
const earnTime = new Date(moneyUpdate.timestamp).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' })
|
||||
const verb = moneyUpdate.amount > 0 ? "Gagné" : "Dépensé"
|
||||
const verb = moneyUpdate.amount >= 0 ? "Gagné" : "Dépensé"
|
||||
return <Text>
|
||||
{verb} {moneyUpdate.amount} <FontAwesome6 name='coins' /> le {earnDate} à {earnTime}
|
||||
</Text>
|
||||
|
@ -5,7 +5,7 @@ export interface MoneyUpdate {
|
||||
id: number
|
||||
playerId: number
|
||||
amount: number
|
||||
reason: 'START' | 'NEW_RUN' | 'BUY_TRAIN' | 'WIN_CHALLENGE'
|
||||
reason: 'START' | 'NEW_RUN' | 'BUY_TRAIN' | 'CHALLENGE'
|
||||
timestamp: number
|
||||
runId: number | null
|
||||
actionId: number | null
|
||||
@ -24,7 +24,7 @@ export interface MoneyUpdatePayload {
|
||||
id: number
|
||||
playerId: number
|
||||
amount: number
|
||||
reason: 'START' | 'NEW_RUN' | 'BUY_TRAIN' | 'WIN_CHALLENGE'
|
||||
reason: 'START' | 'NEW_RUN' | 'BUY_TRAIN' | 'CHALLENGE'
|
||||
timestamp: string
|
||||
runId: number | null
|
||||
actionId: number | null
|
||||
|
Reference in New Issue
Block a user