wip
This commit is contained in:
@@ -12,12 +12,12 @@ import {
|
||||
ChevronRight,
|
||||
Sparkles,
|
||||
} from 'lucide-react';
|
||||
import type { LeagueSummaryDTO } from '@gridpilot/racing/application/dto/LeagueSummaryDTO';
|
||||
import type { LeagueSummaryViewModel } from '@gridpilot/racing/application/presenters/IAllLeaguesWithCapacityAndScoringPresenter';
|
||||
import { getLeagueCoverClasses } from '@/lib/leagueCovers';
|
||||
import { getImageService } from '@/lib/di-container';
|
||||
|
||||
interface LeagueCardProps {
|
||||
league: LeagueSummaryDTO;
|
||||
league: LeagueSummaryViewModel;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ function getGameColor(gameId?: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
function isNewLeague(createdAt: Date): boolean {
|
||||
function isNewLeague(createdAt: string | Date): boolean {
|
||||
const oneWeekAgo = new Date();
|
||||
oneWeekAgo.setDate(oneWeekAgo.getDate() - 7);
|
||||
return new Date(createdAt) > oneWeekAgo;
|
||||
|
||||
@@ -251,7 +251,7 @@ export default function DriverProfileMockup() {
|
||||
|
||||
function AnimatedRating({ shouldReduceMotion, value }: { shouldReduceMotion: boolean; value: number }) {
|
||||
const count = useMotionValue(0);
|
||||
const rounded = useTransform(count, (v) => Math.round(v));
|
||||
const rounded = useTransform(count, (v: number) => Math.round(v));
|
||||
const spring = useSpring(count, { stiffness: 50, damping: 25 });
|
||||
|
||||
useEffect(() => {
|
||||
@@ -282,7 +282,7 @@ function AnimatedCounter({
|
||||
suffix?: string;
|
||||
}) {
|
||||
const count = useMotionValue(0);
|
||||
const rounded = useTransform(count, (v) => Math.round(v));
|
||||
const rounded = useTransform(count, (v: number) => Math.round(v));
|
||||
|
||||
useEffect(() => {
|
||||
if (shouldReduceMotion) {
|
||||
|
||||
@@ -146,7 +146,7 @@ function RatingFactor({
|
||||
}) {
|
||||
const progress = useMotionValue(0);
|
||||
const smoothProgress = useSpring(progress, { stiffness: 60, damping: 25 });
|
||||
const width = useTransform(smoothProgress, (v) => `${v}%`);
|
||||
const width = useTransform(smoothProgress, (v: number) => `${v}%`);
|
||||
|
||||
useEffect(() => {
|
||||
if (shouldReduceMotion) {
|
||||
@@ -187,7 +187,7 @@ function RatingFactor({
|
||||
|
||||
function AnimatedRating({ shouldReduceMotion }: { shouldReduceMotion: boolean }) {
|
||||
const count = useMotionValue(0);
|
||||
const rounded = useTransform(count, (v) => Math.round(v));
|
||||
const rounded = useTransform(count, (v: number) => Math.round(v));
|
||||
const spring = useSpring(count, { stiffness: 50, damping: 25 });
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user