From 0689a5827f4201741453944f1de1fe99a81d81d4 Mon Sep 17 00:00:00 2001
From: ManInDark <61268856+ManInDark@users.noreply.github.com>
Date: Tue, 2 Sep 2025 22:35:36 +0200
Subject: [PATCH] fix: replace return null with empty tags
---
app/debug/layout.tsx | 2 +-
app/settings/page.tsx | 2 +-
components/HabitItem.tsx | 4 ++--
components/PermissionError.tsx | 2 +-
components/PomodoroTimer.tsx | 2 +-
components/TodayEarnedCoins.tsx | 2 +-
components/WishlistItem.tsx | 4 ++--
components/ui/chart.tsx | 10 +++++-----
hooks/useCoins.tsx | 16 ++++++++--------
9 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/app/debug/layout.tsx b/app/debug/layout.tsx
index 6c943d0..43e6e75 100644
--- a/app/debug/layout.tsx
+++ b/app/debug/layout.tsx
@@ -1,7 +1,7 @@
import { ReactNode } from "react";
export default function Debug({children}: {children: ReactNode}) {
- if (process.env.NODE_ENV !== 'development') return null
+ if (process.env.NODE_ENV !== 'development') return <>>
return (
{children}
diff --git a/app/settings/page.tsx b/app/settings/page.tsx
index 219e51c..a299b83 100644
--- a/app/settings/page.tsx
+++ b/app/settings/page.tsx
@@ -38,7 +38,7 @@ export default function SettingsPage() {
// handleDeleteAccount function removed
- if (!settings) return null
+ if (!settings) return <>>
return (
<>
diff --git a/components/HabitItem.tsx b/components/HabitItem.tsx
index 240e35b..c9f1bfd 100644
--- a/components/HabitItem.tsx
+++ b/components/HabitItem.tsx
@@ -24,13 +24,13 @@ interface HabitItemProps {
}
const renderUserAvatars = (habit: Habit, currentUser: User | null, usersData: { users: User[] }) => {
- if (!habit.userIds || habit.userIds.length <= 1) return null;
+ if (!habit.userIds || habit.userIds.length <= 1) return <>>;
return (
{habit.userIds?.filter((u) => u !== currentUser?.id).map(userId => {
const user = usersData.users.find(u => u.id === userId)
- if (!user) return null
+ if (!user) return <>>;
return (
diff --git a/components/PermissionError.tsx b/components/PermissionError.tsx
index a1bc83a..737c98a 100644
--- a/components/PermissionError.tsx
+++ b/components/PermissionError.tsx
@@ -8,7 +8,7 @@ export default async function PermissionError() {
// If everything is fine, render nothing
if (permissionResult.success) {
- return null
+ return <>>
}
// Get error message
diff --git a/components/PomodoroTimer.tsx b/components/PomodoroTimer.tsx
index 0289bae..e05eab5 100644
--- a/components/PomodoroTimer.tsx
+++ b/components/PomodoroTimer.tsx
@@ -177,7 +177,7 @@ export default function PomodoroTimer() {
const progress = (timeLeft / currentTimerRef.current.duration) * 100
- if (!show) return null
+ if (!show) return <>>
return (
diff --git a/components/TodayEarnedCoins.tsx b/components/TodayEarnedCoins.tsx
index 3609897..4ad5db5 100644
--- a/components/TodayEarnedCoins.tsx
+++ b/components/TodayEarnedCoins.tsx
@@ -9,7 +9,7 @@ export default function TodayEarnedCoins({ longFormat }: { longFormat?: boolean
const [settings] = useAtom(settingsAtom)
const { coinsEarnedToday } = useCoins()
- if (coinsEarnedToday <= 0) return null
+ if (coinsEarnedToday <= 0) return <>>;
return (
diff --git a/components/WishlistItem.tsx b/components/WishlistItem.tsx
index 0911e35..176f273 100644
--- a/components/WishlistItem.tsx
+++ b/components/WishlistItem.tsx
@@ -29,13 +29,13 @@ interface WishlistItemProps {
}
const renderUserAvatars = (item: WishlistItemType, currentUser: User | null, usersData: { users: User[] }) => {
- if (!item.userIds || item.userIds.length <= 1) return null;
+ if (!item.userIds || item.userIds.length <= 1) return <>>;
return (
{item.userIds?.filter((u) => u !== currentUser?.id).map(userId => {
const user = usersData.users.find(u => u.id === userId)
- if (!user) return null
+ if (!user) return <>>;
return (
diff --git a/components/ui/chart.tsx b/components/ui/chart.tsx
index 32dc873..e091329 100644
--- a/components/ui/chart.tsx
+++ b/components/ui/chart.tsx
@@ -73,7 +73,7 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
)
if (!colorConfig.length) {
- return null
+ return <>>;
}
return (
@@ -135,7 +135,7 @@ const ChartTooltipContent = React.forwardRef<
const tooltipLabel = React.useMemo(() => {
if (hideLabel || !payload?.length) {
- return null
+ return <>>;
}
const [item] = payload
@@ -155,7 +155,7 @@ const ChartTooltipContent = React.forwardRef<
}
if (!value) {
- return null
+ return <>>;
}
return {value}
@@ -170,7 +170,7 @@ const ChartTooltipContent = React.forwardRef<
])
if (!active || !payload?.length) {
- return null
+ return <>>;
}
const nestLabel = payload.length === 1 && indicator !== "dot"
@@ -273,7 +273,7 @@ const ChartLegendContent = React.forwardRef<
const { config } = useChart()
if (!payload?.length) {
- return null
+ return <>>;
}
return (
diff --git a/hooks/useCoins.tsx b/hooks/useCoins.tsx
index 332da80..019004a 100644
--- a/hooks/useCoins.tsx
+++ b/hooks/useCoins.tsx
@@ -90,20 +90,20 @@ export function useCoins(options?: { selectedUser?: string }) {
]);
const add = async (amount: number, description: string, note?: string) => {
- if (!handlePermissionCheck(currentUser, 'coins', 'write', tCommon)) return null
+ if (!handlePermissionCheck(currentUser, 'coins', 'write', tCommon)) return <>>;
if (isNaN(amount) || amount <= 0) {
toast({
title: t("invalidAmountTitle"),
description: t("invalidAmountDescription")
})
- return null
+ return <>>;
}
if (amount > MAX_COIN_LIMIT) {
toast({
title: t("invalidAmountTitle"),
description: t("maxAmountExceededDescription", { max: MAX_COIN_LIMIT })
})
- return null
+ return <>>;
}
const data = await addCoins({
@@ -119,21 +119,21 @@ export function useCoins(options?: { selectedUser?: string }) {
}
const remove = async (amount: number, description: string, note?: string) => {
- if (!handlePermissionCheck(currentUser, 'coins', 'write', tCommon)) return null
+ if (!handlePermissionCheck(currentUser, 'coins', 'write', tCommon)) return <>>;
const numAmount = Math.abs(amount)
if (isNaN(numAmount) || numAmount <= 0) {
toast({
title: t("invalidAmountTitle"),
description: t("invalidAmountDescription")
})
- return null
+ return <>>;
}
if (numAmount > MAX_COIN_LIMIT) {
toast({
title: t("invalidAmountTitle"),
description: t("maxAmountExceededDescription", { max: MAX_COIN_LIMIT })
})
- return null
+ return <>>;
}
const data = await removeCoins({
@@ -149,14 +149,14 @@ export function useCoins(options?: { selectedUser?: string }) {
}
const updateNote = async (transactionId: string, note: string) => {
- if (!handlePermissionCheck(currentUser, 'coins', 'write', tCommon)) return null
+ if (!handlePermissionCheck(currentUser, 'coins', 'write', tCommon)) return <>>;
const transaction = coins.transactions.find(t => t.id === transactionId)
if (!transaction) {
toast({
title: tCommon("errorTitle"),
description: t("transactionNotFoundDescription")
})
- return null
+ return <>>;
}
const updatedTransaction = {