diff --git a/spa/src/components/back-button.tsx b/spa/src/components/back-button.tsx new file mode 100644 index 0000000..d0e9529 --- /dev/null +++ b/spa/src/components/back-button.tsx @@ -0,0 +1,17 @@ +import { useRouter } from "@tanstack/react-router" +import { useTranslation } from "react-i18next" +import { ArrowLeft } from "lucide-react" + +export function BackButton() { + const { t } = useTranslation() + const router = useRouter() + + return ( + + ) +} diff --git a/spa/src/components/log-sheet.tsx b/spa/src/components/log-sheet.tsx index b9c6ae8..ad87e81 100644 --- a/spa/src/components/log-sheet.tsx +++ b/spa/src/components/log-sheet.tsx @@ -10,6 +10,7 @@ import type { MovieSelection } from "@/components/search-overlay" import { useLogReview } from "@/hooks/use-diary" import { toast } from "sonner" import { posterUrl } from "@/lib/api/client" +import { hapticMedium } from "@/lib/haptics" type LogSheetProps = { open: boolean @@ -48,6 +49,7 @@ export function LogSheet({ open, onOpenChange }: LogSheetProps) { }, { onSuccess: () => { + hapticMedium() toast.success(t("logReview.logged", { title: movie.title })) handleClose() }, diff --git a/spa/src/components/movie-card.tsx b/spa/src/components/movie-card.tsx index f991139..ed8ced5 100644 --- a/spa/src/components/movie-card.tsx +++ b/spa/src/components/movie-card.tsx @@ -10,9 +10,10 @@ type MovieCardProps = { comment?: string subtitle?: string variant?: "compact" | "full" + action?: React.ReactNode } -export function MovieCard({ movie, rating, comment, subtitle, variant = "full" }: MovieCardProps) { +export function MovieCard({ movie, rating, comment, subtitle, variant = "full", action }: MovieCardProps) { if (variant === "compact") { return ( @@ -41,6 +42,7 @@ export function MovieCard({ movie, rating, comment, subtitle, variant = "full" } {rating != null &&
} {comment &&

{comment}

} + {action &&
e.preventDefault()}>{action}
} diff --git a/spa/src/components/review-card.tsx b/spa/src/components/review-card.tsx index 8d91a05..0820d3d 100644 --- a/spa/src/components/review-card.tsx +++ b/spa/src/components/review-card.tsx @@ -1,5 +1,6 @@ import { Link } from "@tanstack/react-router" import { Globe } from "lucide-react" +import { timeAgo } from "@/lib/date" import { StarDisplay } from "@/components/star-display" import { Card, CardContent } from "@/components/ui/card" import { posterUrl } from "@/lib/api/client" @@ -32,7 +33,7 @@ export function ReviewCard({ movie, review, userName, userId, isFederated }: Rev )} {isFederated && } ยท - {review.watched_at.slice(0, 10)} + {timeAgo(review.watched_at)} )} diff --git a/spa/src/components/star-rating.tsx b/spa/src/components/star-rating.tsx index 97bbc13..78439de 100644 --- a/spa/src/components/star-rating.tsx +++ b/spa/src/components/star-rating.tsx @@ -1,5 +1,6 @@ import { Star } from "lucide-react" import { cn } from "@/lib/utils" +import { hapticLight } from "@/lib/haptics" type StarRatingProps = { value: number @@ -16,7 +17,7 @@ export function StarRating({ value, onChange, size = "lg" }: StarRatingProps) {