From 00d097f643821401257f8d2a8e5a6d368b320a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Wed, 20 Dec 2023 12:01:31 +0100 Subject: [PATCH] Fixes prettier --- front/components/V2/SongCardInfo.tsx | 21 ++++++++++----------- front/models/Song.ts | 9 +++++++-- front/models/SongHistory.ts | 7 ++++--- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/front/components/V2/SongCardInfo.tsx b/front/components/V2/SongCardInfo.tsx index d08a9cb..38b42b2 100644 --- a/front/components/V2/SongCardInfo.tsx +++ b/front/components/V2/SongCardInfo.tsx @@ -22,17 +22,16 @@ const SongCardInfo = (props: SongCardInfoProps) => { width: isPhone ? 160 : 200, }; - -const Scores = [ - { - icon: 'time', - score: props.song.lastScore ?? '?', - }, - { - icon: 'trophy', - score: props.song.bestScore ?? '?', - }, -]; + const Scores = [ + { + icon: 'time', + score: props.song.lastScore ?? '?', + }, + { + icon: 'trophy', + score: props.song.bestScore ?? '?', + }, + ]; return ( ({ info, playDate })) - .sort((a, b) => yup.date().cast(a.playDate)!.getTime() - yup.date().cast(b.playDate)!.getTime()) + .sort( + (a, b) => + yup.date().cast(a.playDate)!.getTime() - + yup.date().cast(b.playDate)!.getTime() + ) .at(0)?.info.score ?? null, })); diff --git a/front/models/SongHistory.ts b/front/models/SongHistory.ts index 5858165..00d4f32 100644 --- a/front/models/SongHistory.ts +++ b/front/models/SongHistory.ts @@ -27,10 +27,11 @@ export const SongHistoryItemWithoutSongValidator = yup }) .concat(ModelValidator); -export const SongHistoryItemValidator = SongHistoryItemWithoutSongValidator - .concat(yup.object({ +export const SongHistoryItemValidator = SongHistoryItemWithoutSongValidator.concat( + yup.object({ song: yup.lazy(() => SongValidator.default(undefined)).optional(), - })); + }) +); export type SongHistoryItem = yup.InferType;