diff --git a/.gitignore b/.gitignore index 5460f1c3..5f60c17d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ coverage # Vercel .vercel +# Typescript +*.tsbuildinfo + # Build Outputs .next/ out/ diff --git a/apps/app/next-env.d.ts b/apps/app/next-env.d.ts index 40c3d680..1b3be084 100644 --- a/apps/app/next-env.d.ts +++ b/apps/app/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/apps/app/src/app/(private-routes)/dashboard/_utils/transformRentals.tsx b/apps/app/src/app/(private-routes)/dashboard/_utils/transformRentals.tsx index fdf6f5c4..a47d4f63 100644 --- a/apps/app/src/app/(private-routes)/dashboard/_utils/transformRentals.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/_utils/transformRentals.tsx @@ -6,7 +6,6 @@ import useLocalStorage from '@/hooks/useLocalStorage'; import { RentalDataGrid } from '@/types/rentalDataGrid'; import { formatTime } from '@/utils/dateTime'; -// eslint-disable-next-line import/prefer-default-export export const transformRentals = (rows: Rentals[], userId: string, filterCategory?: RentalType): RentalDataGrid[] => rows.map( ({ diff --git a/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/EnableDegenDialogContent.tsx b/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/EnableDegenDialogContent.tsx index bc5a3a6b..1ad81aae 100644 --- a/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/EnableDegenDialogContent.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/EnableDegenDialogContent.tsx @@ -25,7 +25,7 @@ interface Props { onSuccess?: () => void; } -const EnableDisableDegenDialogContent = ({ degen, isEnabled = false, onClose, onSuccess }: Props): JSX.Element => { +const EnableDisableDegenDialogContent = ({ degen, isEnabled = false, onClose, onSuccess }: Props): React.ReactNode => { const { authToken } = useAuth(); const [agreement, setAgreement] = useState(false); const handleButtonClick = async () => { diff --git a/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameDegenDialogContent.tsx b/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameDegenDialogContent.tsx index e261e4c9..673d9586 100644 --- a/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameDegenDialogContent.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameDegenDialogContent.tsx @@ -33,7 +33,7 @@ interface Props { onSuccess?: () => void; } -const RenameDegenDialogContent = ({ degen, onSuccess }: Props): JSX.Element => { +const RenameDegenDialogContent = ({ degen, onSuccess }: Props): React.ReactNode => { const { tx, writeContracts } = useNetworkContext(); const { tokensBalances } = useTokensBalances(); const [input, setInput] = useState(''); diff --git a/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameStepper.tsx b/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameStepper.tsx index b62691e5..f773dce3 100644 --- a/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameStepper.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/degens/_dialogs/RenameStepper.tsx @@ -120,7 +120,7 @@ function RenameStepper({ insufficientAllowance: boolean; renameSuccess: boolean; insufficientBalance: boolean; -}): JSX.Element { +}): React.ReactNode { const [activeStep, setActiveStep] = useState(0); const steps = getSteps(); diff --git a/apps/app/src/app/(private-routes)/dashboard/degens/page.tsx b/apps/app/src/app/(private-routes)/dashboard/degens/page.tsx index 452b8b84..e4c8c4e7 100644 --- a/apps/app/src/app/(private-routes)/dashboard/degens/page.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/degens/page.tsx @@ -47,7 +47,7 @@ const DegenCard = dynamic(() => import('@/components/cards/DegenCard'), { // Needs to be divisible by 2, 3, or 4 const DEGENS_PER_PAGE = 12; -const DashboardDegensPage = (): JSX.Element => { +const DashboardDegensPage = (): React.ReactNode => { const { authToken } = useAuth(); const { isConnected } = useAccount(); const [isDrawerOpen, setIsDrawerOpen] = useState(true); diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/ProfileImageDialog.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/ProfileImageDialog.tsx index 1b7ec5f0..bdf2d3d0 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/ProfileImageDialog.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/ProfileImageDialog.tsx @@ -128,7 +128,7 @@ type ProfileImageDialogProps = { avatarFee?: number; }; -const ProfileImageDialog = ({ degens, onChangeAvatar, avatarFee }: ProfileImageDialogProps): JSX.Element => { +const ProfileImageDialog = ({ degens, onChangeAvatar, avatarFee }: ProfileImageDialogProps): React.ReactNode => { const [degensInternal, setDegensInternal] = useState([]); const theme = useTheme(); diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/index.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/index.tsx index e181697b..427a9607 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/index.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_ImageProfile/index.tsx @@ -16,7 +16,7 @@ interface ImageProfileProps { avatarFee?: number; } -const ImageProfile = ({ degens, avatar, avatarFee }: ImageProfileProps): JSX.Element => { +const ImageProfile = ({ degens, avatar, avatarFee }: ImageProfileProps): React.ReactNode => { const { isLoadingDegens } = useGamerProfileContext(); const [degenSelected, setDegenSelected] = useState(''); diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/BottomInfo.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/BottomInfo.tsx index ac49dce5..7cabeaff 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/BottomInfo.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/BottomInfo.tsx @@ -14,7 +14,7 @@ interface BottomInfoProps { crypto_winter: ProfileMiniGame | undefined; } -const BottomInfo = ({ nifty_smashers, wen_game, crypto_winter }: BottomInfoProps): JSX.Element => { +const BottomInfo = ({ nifty_smashers, wen_game, crypto_winter }: BottomInfoProps): React.ReactNode => { const { isLoadingProfile } = useGamerProfileContext(); return ( diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameDialog.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameDialog.tsx index b8c04e4d..37c50c18 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameDialog.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameDialog.tsx @@ -7,7 +7,7 @@ import ChangeProfileNameForm from './ChangeProfileNameForm'; interface ChangeProfileNameDialogProps { handleUpdateNewName: (newName: string) => void; } -const ChangeProfileNameDialog = ({ handleUpdateNewName }: ChangeProfileNameDialogProps): JSX.Element => { +const ChangeProfileNameDialog = ({ handleUpdateNewName }: ChangeProfileNameDialogProps): React.ReactNode => { const theme = useTheme(); return ( diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameForm.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameForm.tsx index ba89f6f5..af073b35 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameForm.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ChangeProfileNameForm.tsx @@ -25,7 +25,7 @@ const validationSchema = yup.object({ name: yup.string().required(), }); -const ChangeProfileNameForm = ({ updateNewName }: ChangeProfileNameFormProps): JSX.Element => { +const ChangeProfileNameForm = ({ updateNewName }: ChangeProfileNameFormProps): React.ReactNode => { const [isLoadingRename, setLoadingRename] = useState(false); const { fee, loadingFee } = useProfileRenameFee(); const [, setIsOpen] = useContext(DialogContext); diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/Item.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/Item.tsx index 628e4280..38038407 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/Item.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/Item.tsx @@ -7,7 +7,7 @@ interface ItemProps { isLoading?: boolean; } -const Item = ({ label, value, isDisable = false, isLoading = true }: ItemProps): JSX.Element => ( +const Item = ({ label, value, isDisable = false, isLoading = true }: ItemProps): React.ReactNode => ( (isDisable ? theme.palette.grey[400] : 'white') }}>{label}: {isLoading ? ( diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/LeftInfo.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/LeftInfo.tsx index 782910e0..f5b87b2a 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/LeftInfo.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/LeftInfo.tsx @@ -12,7 +12,7 @@ interface LeftInfoProps { data: ProfileTotal | ProfileNiftySmsher | undefined; } -const LeftInfo = ({ data }: LeftInfoProps): JSX.Element => { +const LeftInfo = ({ data }: LeftInfoProps): React.ReactNode => { const leftDataMapper: { label: string; value: string | number | undefined; diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/MiniGameContent.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/MiniGameContent.tsx index 62411ccd..d8dfa8e4 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/MiniGameContent.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/MiniGameContent.tsx @@ -10,7 +10,7 @@ interface MiniGameContentProps { data: ProfileMiniGame | undefined; } -const MiniGameContent = ({ data }: MiniGameContentProps): JSX.Element => { +const MiniGameContent = ({ data }: MiniGameContentProps): React.ReactNode => { const leftDataMapper: { label: string; value: string | number | undefined; diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ProgressGamer.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ProgressGamer.tsx index 8143c27f..842b62c1 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ProgressGamer.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/ProgressGamer.tsx @@ -9,7 +9,7 @@ interface ProgressGamerProps { size?: 'sm' | 'md'; } -const ProgressGamer = ({ data, size = 'md' }: ProgressGamerProps): JSX.Element => { +const ProgressGamer = ({ data, size = 'md' }: ProgressGamerProps): React.ReactNode => { const theme = useTheme(); return ( { +const RightInfo = ({ comicCount, degenCount, itemCount, keyCount, rentalCount }: RightInfoProps): React.ReactNode => { const { isLoadingDegens, isLoadingComics, isLoadingItems } = useGamerProfileContext(); const rightDataMapper: { label: string; diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/TopInfo.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/TopInfo.tsx index ccf02fdf..59fa3294 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/TopInfo.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/_Stats/TopInfo.tsx @@ -17,7 +17,7 @@ interface TopInfoProps { walletAddress: string; } -const TopInfo = ({ profile, walletAddress }: TopInfoProps): JSX.Element => { +const TopInfo = ({ profile, walletAddress }: TopInfoProps): React.ReactNode => { const [profileName, setProfileName] = useState('Unknown'); const { isLoadingProfile } = useGamerProfileContext(); const [, copy] = useCopyToClipboard(); diff --git a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/page.tsx b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/page.tsx index dabecffd..29be2a34 100644 --- a/apps/app/src/app/(private-routes)/dashboard/gamer-profile/page.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/gamer-profile/page.tsx @@ -32,7 +32,7 @@ const defaultValue: { isLoadingComics: true, }; -const GamerProfile = (): JSX.Element => { +const GamerProfile = (): React.ReactNode => { const { profile, error, loadingProfile } = useGamerProfile(); const { address } = useAccount(); const { avatarsAndFee } = useProfileAvatarFee(); diff --git a/apps/app/src/app/(private-routes)/dashboard/items/page.tsx b/apps/app/src/app/(private-routes)/dashboard/items/page.tsx index 92e3673c..1604b563 100644 --- a/apps/app/src/app/(private-routes)/dashboard/items/page.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/items/page.tsx @@ -22,7 +22,7 @@ import WearableSubItemCard from '@/components/cards/WearableSubItemCard'; import ItemDetail from '@/components/cards/ItemDetail'; import ViewItemDialog from '@/components/dialog/ViewItemDialog'; -const DashboardComicsPage = (): JSX.Element => { +const DashboardComicsPage = (): React.ReactNode => { const [selectedComic, setSelectedComic] = useState(null); const [selectedItem, setSelectedItem] = useState(null); const [selectedSubIndex, setSelectedSubIndex] = useState(-1); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/MyComics.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/MyComics.tsx index ed4f495a..241332cb 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/MyComics.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/MyComics.tsx @@ -14,7 +14,7 @@ import useNFTsBalances from '@/hooks/balances/useNFTsBalances'; import ComicPlaceholder from '@/components/cards/Skeleton/ComicPlaceholder'; import { COMICS_PURCHASE_URL } from '@/constants/url'; -const MyComics = (): JSX.Element => { +const MyComics = (): React.ReactNode => { const [selectedComic, setSelectedComic] = useState(null); const router = useRouter(); const { comicsBalances, loadingComics } = useNFTsBalances(); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/MyDegens.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/MyDegens.tsx index fd85cadf..9de2318d 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/MyDegens.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/MyDegens.tsx @@ -39,7 +39,7 @@ const BoxDegenStyles = { }, }; -const MyDegens = (): JSX.Element => { +const MyDegens = (): React.ReactNode => { const { authToken } = useAuth(); const [selectedDegen, setSelectedDegen] = useState(); const [isRenameDegenModalOpen, setIsRenameDegenModalOpen] = useState(false); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/MyItems.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/MyItems.tsx index e283ad18..aea462bd 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/MyItems.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/MyItems.tsx @@ -10,7 +10,7 @@ import EmptyState from '@/components/EmptyState'; import ComicPlaceholder from '@/components/cards/Skeleton/ComicPlaceholder'; import { ITEM_PURCHASE_URL } from '@/constants/url'; -const MyItems = (): JSX.Element => { +const MyItems = (): React.ReactNode => { const router = useRouter(); const { itemsBalances, loadingItems } = useNFTsBalances(); const filteredItems = useMemo(() => itemsBalances.filter(item => item.balance && item.balance > 0), [itemsBalances]); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/MyStats.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/MyStats.tsx index 847fd6e8..6cff0306 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/MyStats.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/MyStats.tsx @@ -9,7 +9,7 @@ import GamerProfileContext from '@/contexts/GamerProfileContext'; import LeftInfo from '../gamer-profile/_Stats/LeftInfo'; import type { Profile } from '@/types/account'; -const MyStats = ({ profile }: { profile?: Profile }): JSX.Element => { +const MyStats = ({ profile }: { profile?: Profile }): React.ReactNode => { return ( diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/ArcadeBalance.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/ArcadeBalance.tsx index 675a3675..cfa845ed 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/ArcadeBalance.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/ArcadeBalance.tsx @@ -12,7 +12,7 @@ import useTokensBalances from '@/hooks/balances/useTokensBalances'; import BuyArcadeTokensDialog from '@/components/dialog/BuyArcadeTokensDialog'; import TokenInfoCard from '@/components/cards/TokenInfoCard'; -const ArcadeBalance = (): JSX.Element => { +const ArcadeBalance = (): React.ReactNode => { const theme = useTheme(); const router = useRouter(); const { tokensBalances, loadingArcadeBal, refetchArcadeBal } = useTokensBalances(); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/DegenBalance.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/DegenBalance.tsx index ee68eeed..0c37a3b3 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/DegenBalance.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/DegenBalance.tsx @@ -9,7 +9,7 @@ import HoverDataCard from '@/components/cards/HoverDataCard'; import useClaimNFTL from '@/hooks/writeContracts/useClaimNFTL'; import useNetworkContext from '@/hooks/useNetworkContext'; -const DegenBalance = (): JSX.Element => { +const DegenBalance = (): React.ReactNode => { const theme = useTheme(); const { isConnected } = useNetworkContext(); const { balance, claimCallback, loading } = useClaimNFTL(); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/TitleSection.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/TitleSection.tsx index c8cc6876..03bf515b 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/TitleSection.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/TitleSection.tsx @@ -6,7 +6,7 @@ import { formatNumberToDisplay } from '@/utils/numbers'; import useTokensBalances from '@/hooks/balances/useTokensBalances'; import SectionTitle from '@/components/sections/SectionTitle'; -const TitleSection = (): JSX.Element => { +const TitleSection = (): React.ReactNode => { const { loadingNFTLBal, tokensBalances } = useTokensBalances(); return ( { +const WalletBalances = (): React.ReactNode => { const theme = useTheme(); const { loadingNFTLBal, tokensBalances } = useTokensBalances(); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/index.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/index.tsx index 9aed9c9c..8e56bf25 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/index.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/_MyNFTL/index.tsx @@ -9,7 +9,7 @@ import GameBalance from './GameBalance'; import TitleSection from './TitleSection'; import WalletBalances from './WalletBalances'; -const MyNFTL = (): JSX.Element => ( +const MyNFTL = (): React.ReactNode => ( diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/RentalsTableSimple.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/RentalsTableSimple.tsx index 2da42911..f39da22f 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/RentalsTableSimple.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/RentalsTableSimple.tsx @@ -12,7 +12,7 @@ interface RentalsTableSimpleProps { columns: ColumnType[]; } -const RentalsTableSimple = ({ rentals, columns }: RentalsTableSimpleProps): JSX.Element => { +const RentalsTableSimple = ({ rentals, columns }: RentalsTableSimpleProps): React.ReactNode => { const { palette } = useTheme(); return ( diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/index.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/index.tsx index f643d816..7e84d48f 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/index.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/_MyRentals/index.tsx @@ -62,7 +62,7 @@ const columns: ColumnType[] = [ interface MyRentalsProps { rentals: Rentals[]; } -const MyRentals: FC = ({ rentals }): JSX.Element => { +const MyRentals: FC = ({ rentals }): React.ReactNode => { const { profile } = usePlayerProfile(); const rows = transformRentals(rentals, profile?.id || ''); diff --git a/apps/app/src/app/(private-routes)/dashboard/overview/page.tsx b/apps/app/src/app/(private-routes)/dashboard/overview/page.tsx index 76912c9e..38f022e8 100644 --- a/apps/app/src/app/(private-routes)/dashboard/overview/page.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/overview/page.tsx @@ -15,7 +15,7 @@ import MyItems from './MyItems'; import MyNFTL from './_MyNFTL'; import MyStats from './MyStats'; -const DashboardOverview = (): JSX.Element => { +const DashboardOverview = (): React.ReactNode => { // const { authToken } = useAuth(); // const headers = { authorizationToken: authToken || '' }; // const { data } = useFetch(ALL_RENTAL_API_URL, { diff --git a/apps/app/src/app/(private-routes)/dashboard/page.tsx b/apps/app/src/app/(private-routes)/dashboard/page.tsx index c862a953..70183e28 100644 --- a/apps/app/src/app/(private-routes)/dashboard/page.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/page.tsx @@ -1,5 +1,5 @@ import Overview from './overview/page'; -const DashboardOverviewPage = (): JSX.Element => ; +const DashboardOverviewPage = (): React.ReactNode => ; export default DashboardOverviewPage; diff --git a/apps/app/src/app/(private-routes)/dashboard/rentals/ChangeNicknameDialog.tsx b/apps/app/src/app/(private-routes)/dashboard/rentals/ChangeNicknameDialog.tsx index 542a4d8f..7191cff8 100644 --- a/apps/app/src/app/(private-routes)/dashboard/rentals/ChangeNicknameDialog.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/rentals/ChangeNicknameDialog.tsx @@ -26,7 +26,7 @@ const validationSchema = yup.object({ isCheckedTerm: yup.bool().oneOf([true]), }); -const ChangeNicknameDialog = ({ rental, updateNickname }: Props): JSX.Element => { +const ChangeNicknameDialog = ({ rental, updateNickname }: Props): React.ReactNode => { const { authToken } = useAuth(); const [nicknames, setNicknames] = useLocalStorage<{ [address: string]: string; diff --git a/apps/app/src/app/(private-routes)/dashboard/rentals/MyRentalsDataGrid.tsx b/apps/app/src/app/(private-routes)/dashboard/rentals/MyRentalsDataGrid.tsx index 10d6f487..cbc52753 100644 --- a/apps/app/src/app/(private-routes)/dashboard/rentals/MyRentalsDataGrid.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/rentals/MyRentalsDataGrid.tsx @@ -32,7 +32,13 @@ interface Props { updateRentalName: (name: string, id: string) => void; } -const MyRentalsDataGrid = ({ rows, loading, category, onTerminateRental, updateRentalName }: Props): JSX.Element => { +const MyRentalsDataGrid = ({ + rows, + loading, + category, + onTerminateRental, + updateRentalName, +}: Props): React.ReactNode => { // const [pageSize, setPageSize] = useState(10); const [selectedRowForEditing, setSelectedRowForEditing] = useState(); const [isNicknameModalOpen, setIsNicknameModalOpen] = useState(false); diff --git a/apps/app/src/app/(private-routes)/dashboard/rentals/RenameRentalDialogContent.tsx b/apps/app/src/app/(private-routes)/dashboard/rentals/RenameRentalDialogContent.tsx index ddd0290c..44da95fc 100644 --- a/apps/app/src/app/(private-routes)/dashboard/rentals/RenameRentalDialogContent.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/rentals/RenameRentalDialogContent.tsx @@ -42,7 +42,7 @@ const validationSchema = yup }) .required(); -const RenameRentalDialogContent = ({ rental, updateRentalName }: Props): JSX.Element => { +const RenameRentalDialogContent = ({ rental, updateRentalName }: Props): React.ReactNode => { const { authToken } = useAuth(); const dispatch = useDispatch(); const [isLoadingRename, setLoadingRename] = useState(false); diff --git a/apps/app/src/app/(private-routes)/dashboard/rentals/SearchRental.tsx b/apps/app/src/app/(private-routes)/dashboard/rentals/SearchRental.tsx index f05155b0..b32160c3 100644 --- a/apps/app/src/app/(private-routes)/dashboard/rentals/SearchRental.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/rentals/SearchRental.tsx @@ -8,8 +8,8 @@ interface Props { placeholder?: string; } -const SearchRental = ({ handleSearch, placeholder }: Props): JSX.Element => { - const inputEl: any = useRef(); +const SearchRental = ({ handleSearch, placeholder }: Props): React.ReactNode => { + const inputEl: any = useRef(null); let typingTimer: NodeJS.Timeout | undefined; useEffect(() => { diff --git a/apps/app/src/app/(private-routes)/dashboard/rentals/page.tsx b/apps/app/src/app/(private-routes)/dashboard/rentals/page.tsx index a4895454..74ae8f6b 100644 --- a/apps/app/src/app/(private-routes)/dashboard/rentals/page.tsx +++ b/apps/app/src/app/(private-routes)/dashboard/rentals/page.tsx @@ -21,7 +21,7 @@ import { getUniqueListBy } from '@/utils/array'; import useTeminateRental from '@/hooks/useTeminateRental'; import useAuth from '@/hooks/useAuth'; -const DashboardRentalPage = (): JSX.Element => { +const DashboardRentalPage = (): React.ReactNode => { const { authToken } = useAuth(); const headers = { authorizationToken: authToken || '' }; const [rentals, setRentals] = useState([]); diff --git a/apps/app/src/app/(public-routes)/degens/[id]/page.tsx b/apps/app/src/app/(public-routes)/degens/[id]/page.tsx index d16af1f0..be7800b1 100644 --- a/apps/app/src/app/(public-routes)/degens/[id]/page.tsx +++ b/apps/app/src/app/(public-routes)/degens/[id]/page.tsx @@ -13,7 +13,7 @@ import ViewTraitsContentDialog from '@/components/dialog/DegenDialog/ViewTraitsC import type { Degen, GetDegenResponse } from '@/types/degens'; import { useCharacterSearch } from '@/hooks/useGraphQL'; -const DegenTraitsDetailsPage = ({ params }: { params: { id: string } }): JSX.Element => { +const DegenTraitsDetailsPage = ({ params }: { params: { id: string } }): React.ReactNode => { const tokenId = params.id; const [openDialog, setOpenDialog] = useState(false); const [degenDetail, setDegenDetail] = useState(); diff --git a/apps/app/src/app/(public-routes)/degens/page.tsx b/apps/app/src/app/(public-routes)/degens/page.tsx index 565ac429..ce72695d 100644 --- a/apps/app/src/app/(public-routes)/degens/page.tsx +++ b/apps/app/src/app/(public-routes)/degens/page.tsx @@ -41,7 +41,7 @@ const DegenCard = dynamic(() => import('@/components/cards/DegenCard'), { // Needs to be divisible by 2, 3, or 4 const DEGENS_PER_PAGE = 12; -const AllDegensPage = (): JSX.Element => { +const AllDegensPage = (): React.ReactNode => { const { address } = useNetworkContext(); const [degens, setDegens] = useState([]); const [isDrawerOpen, setIsDrawerOpen] = useState(true); diff --git a/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/helpers.ts b/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/helpers.ts index 01dba60d..f47e9bd7 100644 --- a/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/helpers.ts +++ b/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/helpers.ts @@ -1,5 +1,3 @@ -/* eslint-disable import/prefer-default-export */ - export type TraitArray = [ [Tribe: 'Tribe', trait: number], [SkinColor: 'Skin Color', trait: number], diff --git a/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/index.tsx b/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/index.tsx index 5fdc2869..02c32bf4 100644 --- a/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/index.tsx +++ b/apps/app/src/app/(public-routes)/mint-o-matic/_CharacterCreator/index.tsx @@ -107,7 +107,7 @@ type MintEvent = CustomEvent<{ const CharacterCreator = memo( ({ isLoaded, isPortrait, onMintCharacter, setLoaded, setProgress, unityContext }: CharacterCreatorProps) => { - const removedTraitsCallback = useRef void)>(); + const removedTraitsCallback = useRef void)>(null); const [width, setWidth] = useState(DEFAULT_WIDTH); const [height, setHeight] = useState(DEFAULT_HEIGHT); const [refreshKey, setRefreshKey] = useState(0); diff --git a/apps/app/src/app/(public-routes)/verification/page.tsx b/apps/app/src/app/(public-routes)/verification/page.tsx index f211ada3..095d4801 100644 --- a/apps/app/src/app/(public-routes)/verification/page.tsx +++ b/apps/app/src/app/(public-routes)/verification/page.tsx @@ -7,7 +7,7 @@ import useSignAuthMsg from '@/hooks/useSignAuthMsg'; import useAuth from '@/hooks/useAuth'; import type { UUID_Token, Nonce } from '@/types/auth'; -const GameVerification = (): JSX.Element => { +const GameVerification = (): React.ReactNode => { const searchParams = useSearchParams(); const token = searchParams.get('token') as UUID_Token | undefined; const nonce = searchParams.get('nonce') as Nonce | undefined; diff --git a/apps/app/src/app/_layout/_CollapsibleSidebarLayout/index.tsx b/apps/app/src/app/_layout/_CollapsibleSidebarLayout/index.tsx index d7d11fa0..24751610 100644 --- a/apps/app/src/app/_layout/_CollapsibleSidebarLayout/index.tsx +++ b/apps/app/src/app/_layout/_CollapsibleSidebarLayout/index.tsx @@ -17,7 +17,7 @@ const CollapsibleSidebarLayout = ({ renderMain, isDrawerOpen, setIsDrawerOpen, -}: Props): JSX.Element => { +}: Props): React.ReactNode => { const theme = useTheme(); const matchDownSm = useMediaQuery(theme.breakpoints.down('md')); const matchUpMd = useMediaQuery(theme.breakpoints.up('md')); diff --git a/apps/app/src/app/_layout/_MainLayout/_Header/AddNFTLToMetamask.tsx b/apps/app/src/app/_layout/_MainLayout/_Header/AddNFTLToMetamask.tsx index daa66999..aabbd581 100644 --- a/apps/app/src/app/_layout/_MainLayout/_Header/AddNFTLToMetamask.tsx +++ b/apps/app/src/app/_layout/_MainLayout/_Header/AddNFTLToMetamask.tsx @@ -3,7 +3,7 @@ import Button from '@mui/material/Button'; import useNetworkContext from '@/hooks/useNetworkContext'; import useImportNFTLToWallet from '@/hooks/useImportNFTLToWallet'; -const AddNFTLToMetamask = (): JSX.Element | null => { +const AddNFTLToMetamask = (): React.ReactNode | null => { const { isConnected } = useNetworkContext(); const { handleImportNFTLToWallet } = useImportNFTLToWallet(); diff --git a/apps/app/src/app/_layout/_MainLayout/_Sidebar/_MenuList/_NavItem/index.tsx b/apps/app/src/app/_layout/_MainLayout/_Sidebar/_MenuList/_NavItem/index.tsx index 7925a18f..81290f35 100644 --- a/apps/app/src/app/_layout/_MainLayout/_Sidebar/_MenuList/_NavItem/index.tsx +++ b/apps/app/src/app/_layout/_MainLayout/_Sidebar/_MenuList/_NavItem/index.tsx @@ -30,7 +30,7 @@ const NavItem = ({ item, level }: NavItemProps) => { const dispatch = useDispatch(); const { openItem } = useSelector(state => state.menu); - const Icon = item?.icon! as (props: IconProps) => JSX.Element; + const Icon = item?.icon as (props: IconProps) => React.ReactNode | undefined; const itemIcon = item?.icon ? ( ) : ( diff --git a/apps/app/src/app/_layout/_MainLayout/index.tsx b/apps/app/src/app/_layout/_MainLayout/index.tsx index 05d9fef6..091e494b 100644 --- a/apps/app/src/app/_layout/_MainLayout/index.tsx +++ b/apps/app/src/app/_layout/_MainLayout/index.tsx @@ -20,7 +20,6 @@ import { alpha } from '@mui/system'; // React Toastify import { ToastContainer } from 'react-toastify'; -import 'react-toastify/dist/ReactToastify.css'; // project imports import navigation from '@/constants/menu-items'; diff --git a/apps/app/src/components/Definitions.tsx b/apps/app/src/components/Definitions.tsx index f7f0d5d0..1fbed1e0 100644 --- a/apps/app/src/components/Definitions.tsx +++ b/apps/app/src/components/Definitions.tsx @@ -1,4 +1,4 @@ -const Definitions = (): JSX.Element => ( +const Definitions = (): React.ReactNode => ( <>

Interpretation and Definitions

Interpretation

diff --git a/apps/app/src/components/Preloader/index.tsx b/apps/app/src/components/Preloader/index.tsx index cf492177..b14d1d1d 100644 --- a/apps/app/src/components/Preloader/index.tsx +++ b/apps/app/src/components/Preloader/index.tsx @@ -76,7 +76,13 @@ export function Preloader({ ); } -export default function PreloaderWithProgress({ ready, progress }: { ready: boolean; progress: number }): JSX.Element { +export default function PreloaderWithProgress({ + ready, + progress, +}: { + ready: boolean; + progress: number; +}): React.ReactNode { const [percent, setPercent] = useState(progress); const { milliseconds, start, stop } = useStopwatch({ interval: 100 }); diff --git a/apps/app/src/components/cards/DegenCard/DegenImage.tsx b/apps/app/src/components/cards/DegenCard/DegenImage.tsx index 2242f14e..8d2070d6 100644 --- a/apps/app/src/components/cards/DegenCard/DegenImage.tsx +++ b/apps/app/src/components/cards/DegenCard/DegenImage.tsx @@ -5,7 +5,7 @@ const IMAGE_HEIGHT = 320; const DegenImage = memo(({ tokenId, sx }: { tokenId: string | number; sx?: SxProps<{}> }) => { const imageURL = `/img/degens/nfts/${tokenId}`; - // @ts-ignore + // @ts-expect-error Property 'height' does not exist on type 'CSSPseudoSelectorProps<{}>' const imageHeight = sx?.height ?? IMAGE_HEIGHT; let setting: any = { height: imageHeight, diff --git a/apps/app/src/components/dialog/BridgeButtonDialog/BridgeForm.tsx b/apps/app/src/components/dialog/BridgeButtonDialog/BridgeForm.tsx index c49f8cf3..2ddff577 100644 --- a/apps/app/src/components/dialog/BridgeButtonDialog/BridgeForm.tsx +++ b/apps/app/src/components/dialog/BridgeButtonDialog/BridgeForm.tsx @@ -39,7 +39,7 @@ type IFormInput = { amountSelected: number; amountInput: string; isCheckedTerm: const AMOUNT_SELECTS: number[] = [25, 50, 75, 100]; -export const BridgeForm = ({ balance, onBridgeSuccess }: BridgeFormProps): JSX.Element => { +export const BridgeForm = ({ balance, onBridgeSuccess }: BridgeFormProps): React.ReactNode => { const { agreementAccepted, setAgreementAccepted } = useLocalStorageContext(); const { address, writeContracts } = useNetworkContext(); const { imxChainId } = useIMXContext(); diff --git a/apps/app/src/components/dialog/BridgeButtonDialog/BridgeSuccess.tsx b/apps/app/src/components/dialog/BridgeButtonDialog/BridgeSuccess.tsx index 80195a17..315fe524 100644 --- a/apps/app/src/components/dialog/BridgeButtonDialog/BridgeSuccess.tsx +++ b/apps/app/src/components/dialog/BridgeButtonDialog/BridgeSuccess.tsx @@ -24,7 +24,7 @@ const IconButtonStyle = styled(IconButton)(({ theme }) => ({ type BridgeSuccessProps = { successDialogOpen: boolean; setSuccessDialogOpen: Dispatch> }; -const BridgeSuccess = ({ successDialogOpen, setSuccessDialogOpen }: BridgeSuccessProps): JSX.Element => { +const BridgeSuccess = ({ successDialogOpen, setSuccessDialogOpen }: BridgeSuccessProps): React.ReactNode => { const { address } = useNetworkContext(); const { refreshNFTLBalance } = useTokensBalances(); diff --git a/apps/app/src/components/dialog/DegenDialog/RentStepper.tsx b/apps/app/src/components/dialog/DegenDialog/RentStepper.tsx index 3993128a..272773c9 100644 --- a/apps/app/src/components/dialog/DegenDialog/RentStepper.tsx +++ b/apps/app/src/components/dialog/DegenDialog/RentStepper.tsx @@ -81,7 +81,7 @@ export default function RentStepper({ }: { rentSuccess: boolean; checkBalance: boolean; -}): JSX.Element { +}): React.ReactNode { const [activeStep, setActiveStep] = useState(0); useEffect(() => { diff --git a/apps/app/src/components/dialog/DialogActions.tsx b/apps/app/src/components/dialog/DialogActions.tsx index 189cbad7..e97946ae 100644 --- a/apps/app/src/components/dialog/DialogActions.tsx +++ b/apps/app/src/components/dialog/DialogActions.tsx @@ -14,8 +14,8 @@ const IconButtonStyle = styled(IconButton)(({ theme }) => ({ const DialogActionComp = ({ children, isOpen }: DialogAction) => { const [, setIsOpen] = useContext(DialogContext); - return cloneElement(children, { - onClick: callAll(() => setIsOpen(isOpen || false), children.props.onClick), + return cloneElement(children as React.ReactElement, { + onClick: callAll(() => setIsOpen(isOpen || false), (children as React.ReactElement).props.onClick), }); }; diff --git a/apps/app/src/components/dialog/DialogContent.tsx b/apps/app/src/components/dialog/DialogContent.tsx index 70358a52..c2256a73 100644 --- a/apps/app/src/components/dialog/DialogContent.tsx +++ b/apps/app/src/components/dialog/DialogContent.tsx @@ -11,7 +11,7 @@ const DialogContentBase = (props: DialogProps) => { return setIsOpen(false)} open={isOpen} />; }; -const DialogContent = ({ dialogTitle, children, ...props }: DialogProps): JSX.Element => ( +const DialogContent = ({ dialogTitle, children, ...props }: DialogProps): React.ReactNode => ( {dialogTitle} diff --git a/apps/app/src/components/dialog/DownloadGameDialog.tsx b/apps/app/src/components/dialog/DownloadGameDialog.tsx index 69419858..8d4f58aa 100644 --- a/apps/app/src/components/dialog/DownloadGameDialog.tsx +++ b/apps/app/src/components/dialog/DownloadGameDialog.tsx @@ -5,7 +5,7 @@ import { GetApp } from '@mui/icons-material'; import { Dialog, DialogTrigger, DialogContent } from '@/components/dialog'; import useVersion from '@/hooks/useVersion'; -export const Downloader = (): JSX.Element => { +export const Downloader = (): React.ReactNode => { const { isWindows, isMacOs, downloadURL, version, message } = useVersion(); return ( diff --git a/apps/app/src/components/dialog/ViewComicDialog.tsx b/apps/app/src/components/dialog/ViewComicDialog.tsx index c03b576e..fbb8f017 100644 --- a/apps/app/src/components/dialog/ViewComicDialog.tsx +++ b/apps/app/src/components/dialog/ViewComicDialog.tsx @@ -9,7 +9,7 @@ export interface ViewComicDialogProps { onClose: () => void; } -const ViewComicDialog = ({ comic, open, onClose }: ViewComicDialogProps): JSX.Element => { +const ViewComicDialog = ({ comic, open, onClose }: ViewComicDialogProps): React.ReactNode => { const theme = useTheme(); const fullScreen = useMediaQuery(theme.breakpoints.down('md')); diff --git a/apps/app/src/components/dialog/ViewItemDialog.tsx b/apps/app/src/components/dialog/ViewItemDialog.tsx index e250147b..7a8c0c16 100644 --- a/apps/app/src/components/dialog/ViewItemDialog.tsx +++ b/apps/app/src/components/dialog/ViewItemDialog.tsx @@ -10,7 +10,7 @@ export interface ViewItemDialogProps { onClose: () => void; } -const ViewItemDialog = ({ item, subIndex, open, onClose }: ViewItemDialogProps): JSX.Element => { +const ViewItemDialog = ({ item, subIndex, open, onClose }: ViewItemDialogProps): React.ReactNode => { const theme = useTheme(); const fullScreen = useMediaQuery(theme.breakpoints.down('md')); diff --git a/apps/app/src/components/dialog/WhitelistDialog.tsx b/apps/app/src/components/dialog/WhitelistDialog.tsx index 1a9b09b5..b594eeb9 100644 --- a/apps/app/src/components/dialog/WhitelistDialog.tsx +++ b/apps/app/src/components/dialog/WhitelistDialog.tsx @@ -57,7 +57,7 @@ const StyledDialog = styled(Dialog)(() => ({ }, })); -export const WhitelistModal = (): JSX.Element => { +export const WhitelistModal = (): React.ReactNode => { const [email, setEmail] = useState(''); const handleChangeEmail = (e: React.ChangeEvent) => { diff --git a/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawForm.tsx b/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawForm.tsx index 6b7cf54a..beeb725c 100644 --- a/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawForm.tsx +++ b/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawForm.tsx @@ -18,7 +18,7 @@ import { DialogContext } from '@/components/dialog'; type WithdrawFormProps = { balance: number; onWithdrawSuccess: () => void }; type IFormInput = { withdrawal: string }; -const WithdrawForm = ({ balance, onWithdrawSuccess }: WithdrawFormProps): JSX.Element => { +const WithdrawForm = ({ balance, onWithdrawSuccess }: WithdrawFormProps): React.ReactNode => { const { imxChainId } = useIMXContext(); const isConnectedToIMX = useConnectedToIMXCheck(); const { switchChain } = useSwitchChain(); diff --git a/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawSuccess.tsx b/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawSuccess.tsx index 3d74313f..34d367e4 100644 --- a/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawSuccess.tsx +++ b/apps/app/src/components/dialog/WithdrawButtonDialog/WithdrawSuccess.tsx @@ -12,7 +12,7 @@ const IconButtonStyle = styled(IconButton)(({ theme }) => ({ type WithdrawSuccessProps = { successDialogOpen: boolean; setSuccessDialogOpen: Dispatch> }; -const WithdrawSuccess = ({ successDialogOpen, setSuccessDialogOpen }: WithdrawSuccessProps): JSX.Element => { +const WithdrawSuccess = ({ successDialogOpen, setSuccessDialogOpen }: WithdrawSuccessProps): React.ReactNode => { const { refreshNFTLBalance } = useTokensBalances(); const handleClose = () => { diff --git a/apps/app/src/components/extended/Breadcrumbs.tsx b/apps/app/src/components/extended/Breadcrumbs.tsx index a5d88ee4..cde99a2f 100644 --- a/apps/app/src/components/extended/Breadcrumbs.tsx +++ b/apps/app/src/components/extended/Breadcrumbs.tsx @@ -102,7 +102,7 @@ const Breadcrumbs = ({ }; // item separator - const SeparatorIcon = separator! as (props: IconProps) => JSX.Element; + const SeparatorIcon = separator! as (props: IconProps) => React.ReactNode; const separatorIcon = separator ? ( ) : ( diff --git a/apps/app/src/components/extended/DegensFilter/FilterAccordion.tsx b/apps/app/src/components/extended/DegensFilter/FilterAccordion.tsx index 46edf818..d10ec7f9 100644 --- a/apps/app/src/components/extended/DegensFilter/FilterAccordion.tsx +++ b/apps/app/src/components/extended/DegensFilter/FilterAccordion.tsx @@ -9,7 +9,7 @@ interface Props { length?: number; } -const FilterAccordion = ({ summary, children, expanded = true, length = 0 }: Props): JSX.Element => { +const FilterAccordion = ({ summary, children, expanded = true, length = 0 }: Props): React.ReactNode => { return ( { label?: string; } -const FilterRangeSlider = ({ value, unit, ...props }: Props): JSX.Element => ( +const FilterRangeSlider = ({ value, unit, ...props }: Props): React.ReactNode => ( {`${(value[0] as number).toLocaleString()} - ${(value[1] as number).toLocaleString()} ${ diff --git a/apps/app/src/components/extended/DegensFilter/index.tsx b/apps/app/src/components/extended/DegensFilter/index.tsx index 4ce6d4cb..38be46fb 100644 --- a/apps/app/src/components/extended/DegensFilter/index.tsx +++ b/apps/app/src/components/extended/DegensFilter/index.tsx @@ -68,7 +68,12 @@ interface DegensFilterProps { searchTerm?: string; } -const DegensFilter = ({ onFilter, defaultFilterValues, isDegenOwner, searchTerm }: DegensFilterProps): JSX.Element => { +const DegensFilter = ({ + onFilter, + defaultFilterValues, + isDegenOwner, + searchTerm, +}: DegensFilterProps): React.ReactNode => { const theme = useTheme(); const mountedRef = useRef(false); const router = useRouter(); diff --git a/apps/app/src/components/extended/SortButton/index.tsx b/apps/app/src/components/extended/SortButton/index.tsx index cb574b22..1d0e2818 100644 --- a/apps/app/src/components/extended/SortButton/index.tsx +++ b/apps/app/src/components/extended/SortButton/index.tsx @@ -19,7 +19,7 @@ const SortButton = ({ defaultSelectedItemValue = null, // label = 'Sort by: ', handleSort, -}: Props): JSX.Element => { +}: Props): React.ReactNode => { if (!Children.only(children)) console.error('SortButton only accepts one child'); const [selectedSort, setSelectedSort] = useState(defaultSelectedItemValue || sortOptions[0]?.value); @@ -43,11 +43,11 @@ const SortButton = ({ }; const Button = cloneElement( - children as React.ReactElement, + children as React.ReactElement, { - ...children?.props, + ...(children?.props || {}), ref: buttonRef, - onClick: callAll(handleOpenSortMenu as FunctionType, children?.props?.onClick), + onClick: callAll(handleOpenSortMenu as FunctionType, (children.props as any)?.onClick), }, sortLabel.length > 0 && sortLabel[0]?.label, ); diff --git a/apps/app/src/components/leaderboards/CustomModal.tsx b/apps/app/src/components/leaderboards/CustomModal.tsx index 8c906b58..ef2e3ac6 100644 --- a/apps/app/src/components/leaderboards/CustomModal.tsx +++ b/apps/app/src/components/leaderboards/CustomModal.tsx @@ -57,11 +57,11 @@ const style = (theme: Theme) => ({ }, }); interface ModalProps { - ModalIcon: JSX.Element; - child: JSX.Element; + ModalIcon: React.ReactNode; + child: React.ReactNode; flag?: string; } -const CustomModal = (props: ModalProps): JSX.Element | null => { +const CustomModal = (props: ModalProps): React.ReactNode | null => { const { ModalIcon, child, flag } = props; const [open, setOpen] = useState(false); const handleOpen = () => setOpen(true); diff --git a/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTable.tsx b/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTable.tsx index 860a2fba..de69433d 100644 --- a/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTable.tsx +++ b/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTable.tsx @@ -31,7 +31,7 @@ export default function EnhancedTable({ selectedGame, selectedTable, selectedTimeFilter, -}: TableProps): JSX.Element | null { +}: TableProps): React.ReactNode | null { const [count, setCount] = useState(0); const [paginationModel, setPaginationModel] = useState({ pageSize: 50, diff --git a/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTableHead.tsx b/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTableHead.tsx index cee6b375..c6ab5cb8 100644 --- a/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTableHead.tsx +++ b/apps/app/src/components/leaderboards/EnhancedTable/EnhancedTableHead.tsx @@ -5,7 +5,7 @@ import TableRow from '@mui/material/TableRow'; import type { EnhancedTableProps } from '@/types/leaderboard'; import { Typography } from '@mui/material'; -export default function EnhancedTableHead(props: EnhancedTableProps): JSX.Element | null { +export default function EnhancedTableHead(props: EnhancedTableProps): React.ReactNode | null { const { rows, handleCheckYourRank } = props; return ( diff --git a/apps/app/src/components/leaderboards/TopModal.tsx b/apps/app/src/components/leaderboards/TopModal.tsx index ec7a81c8..133b5c65 100644 --- a/apps/app/src/components/leaderboards/TopModal.tsx +++ b/apps/app/src/components/leaderboards/TopModal.tsx @@ -117,7 +117,7 @@ interface TableModalProps { myRank?: number; } -const TableModal = ({ selectedGame, flag, selectedTimeFilter, myRank }: TableModalProps): JSX.Element | null => { +const TableModal = ({ selectedGame, flag, selectedTimeFilter, myRank }: TableModalProps): React.ReactNode | null => { // let d = new Date(), // t = d.toDateString().split(' '); @@ -301,10 +301,16 @@ const TableModal = ({ selectedGame, flag, selectedTimeFilter, myRank }: TableMod }; interface TopModalProps extends TableModalProps { - ModalIcon: JSX.Element; + ModalIcon: React.ReactNode; } -const TopModal = ({ ModalIcon, selectedGame, flag, selectedTimeFilter, myRank }: TopModalProps): JSX.Element | null => { +const TopModal = ({ + ModalIcon, + selectedGame, + flag, + selectedTimeFilter, + myRank, +}: TopModalProps): React.ReactNode | null => { return ( ({ }, })); -export default function LeaderBoards(): JSX.Element { +export default function LeaderBoards(): React.ReactNode { const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); diff --git a/apps/app/src/components/sections/SectionSlider.tsx b/apps/app/src/components/sections/SectionSlider.tsx index 218c436f..179fc244 100644 --- a/apps/app/src/components/sections/SectionSlider.tsx +++ b/apps/app/src/components/sections/SectionSlider.tsx @@ -32,7 +32,7 @@ const SectionSlider = ({ isSlider = true, variant = 'h2', styles, -}: PropsWithChildren): JSX.Element => { +}: PropsWithChildren): React.ReactNode => { const refSlider = useRef(null); const settings = { dots: false, diff --git a/apps/app/src/components/wrapper/Authentication.tsx b/apps/app/src/components/wrapper/Authentication.tsx index 83a3c9a7..06108e41 100644 --- a/apps/app/src/components/wrapper/Authentication.tsx +++ b/apps/app/src/components/wrapper/Authentication.tsx @@ -1,7 +1,7 @@ import { Button, Typography, Container } from '@mui/material'; import useAuth from '@/hooks/useAuth'; -const ProfileVerification = (): JSX.Element => { +const ProfileVerification = (): React.ReactNode => { const { isConnected, handleConnectWallet } = useAuth(); return ( @@ -14,8 +14,8 @@ const ProfileVerification = (): JSX.Element => { ); }; -export default function withVerification(Component: (props: any) => JSX.Element) { - const WrappedComponent = (props: any): JSX.Element | null => { +export default function withVerification(Component: (props: any) => React.ReactNode) { + const WrappedComponent = (props: any): React.ReactNode | null => { const { isLoggedIn } = useAuth(); return isLoggedIn ? : ; }; diff --git a/apps/app/src/components/wrapper/GameWithAuth.tsx b/apps/app/src/components/wrapper/GameWithAuth.tsx index 78633ad1..0ce22305 100644 --- a/apps/app/src/components/wrapper/GameWithAuth.tsx +++ b/apps/app/src/components/wrapper/GameWithAuth.tsx @@ -33,7 +33,7 @@ const Game = ({ unityContext, arcadeTokenRequired = false }: GameProps) => { const { address } = useAccount(); const { tokensBalances, loadingArcadeBal, refetchArcadeBal } = useTokensBalances(); const authMsg = `true,${address || '0x0'},Vitalik,${authToken}`; - const authCallback = useRef void)>(); + const authCallback = useRef void)>(null); const [isLoaded, setLoaded] = useState(false); const [progress, setProgress] = useState(0); diff --git a/apps/app/src/components/wrapper/Loadable.tsx b/apps/app/src/components/wrapper/Loadable.tsx index 8268949c..286de993 100644 --- a/apps/app/src/components/wrapper/Loadable.tsx +++ b/apps/app/src/components/wrapper/Loadable.tsx @@ -26,7 +26,7 @@ const Loader = () => ( interface LoaderProps extends LinearProgressProps {} -const Loadable = (Component: LazyExoticComponent<() => JSX.Element>) => { +const Loadable = (Component: LazyExoticComponent<() => React.ReactNode>) => { const LoadableComponent = (props: LoaderProps) => ( }> diff --git a/apps/app/src/contexts/IMXContext.tsx b/apps/app/src/contexts/IMXContext.tsx index 4284d298..4071d412 100644 --- a/apps/app/src/contexts/IMXContext.tsx +++ b/apps/app/src/contexts/IMXContext.tsx @@ -30,7 +30,7 @@ const CONTEXT_INITIAL_STATE: Context = { const IMXContext = createContext(CONTEXT_INITIAL_STATE); -export const IMXProvider = ({ children }: PropsWithChildren): JSX.Element => { +export const IMXProvider = ({ children }: PropsWithChildren): React.ReactNode => { // IMX Passport instance converted to an ethers.js Provider const passportProvider = useImxProvider(); const passportNetwork = getNetwork(); diff --git a/apps/app/src/contexts/NFTsBalanceContext.tsx b/apps/app/src/contexts/NFTsBalanceContext.tsx index 3d3e4784..961b08ea 100644 --- a/apps/app/src/contexts/NFTsBalanceContext.tsx +++ b/apps/app/src/contexts/NFTsBalanceContext.tsx @@ -42,7 +42,7 @@ const CONTEXT_INITIAL_STATE: NFTsBalanceContext = { const NFTsBalanceContext = createContext(CONTEXT_INITIAL_STATE); -export const NFTsBalanceProvider = ({ children }: PropsWithChildren): JSX.Element => { +export const NFTsBalanceProvider = ({ children }: PropsWithChildren): React.ReactNode => { const firstRenderRef = useRef(true); const { isLoggedIn } = useAuth(); diff --git a/apps/app/src/contexts/NetworkContext.tsx b/apps/app/src/contexts/NetworkContext.tsx index d9c1d262..fb037163 100644 --- a/apps/app/src/contexts/NetworkContext.tsx +++ b/apps/app/src/contexts/NetworkContext.tsx @@ -36,7 +36,7 @@ const CONTEXT_INITIAL_STATE: NetworkContext = { const NetworkContext = createContext(CONTEXT_INITIAL_STATE); -export const NetworkProvider = ({ children }: PropsWithChildren): JSX.Element => { +export const NetworkProvider = ({ children }: PropsWithChildren): React.ReactNode => { const chainId = TARGET_NETWORK?.chainId || 1; // mainnet | sepolia | hardhat const { address, chain, isConnected } = useAccount(); diff --git a/apps/app/src/contexts/TokensBalanceContext.tsx b/apps/app/src/contexts/TokensBalanceContext.tsx index 5479da6c..0c2f1ef1 100644 --- a/apps/app/src/contexts/TokensBalanceContext.tsx +++ b/apps/app/src/contexts/TokensBalanceContext.tsx @@ -38,7 +38,7 @@ const CONTEXT_INITIAL_STATE: TokensBalanceContext = { const TokensBalanceContext = createContext(CONTEXT_INITIAL_STATE); -export const TokensBalanceProvider = ({ children }: PropsWithChildren): JSX.Element => { +export const TokensBalanceProvider = ({ children }: PropsWithChildren): React.ReactNode => { const { degenTokenIndices: degens, loadingDegens } = useNFTsBalances(); const firstRenderRef = useRef(true); const { isLoggedIn } = useAuth(); diff --git a/apps/app/src/hooks/useFetch.ts b/apps/app/src/hooks/useFetch.ts index b249d5d4..9f6894c8 100644 --- a/apps/app/src/hooks/useFetch.ts +++ b/apps/app/src/hooks/useFetch.ts @@ -13,7 +13,7 @@ type Cache = { [url: string]: T }; // discriminated union type type Action = { type: 'loading' } | { type: 'fetched'; payload: T } | { type: 'error'; payload: Error }; -const initialState = { +const initialState: State = { loading: undefined, error: undefined, data: undefined, @@ -23,11 +23,11 @@ const initialState = { function fetchReducer(state: State, action: Action): State { switch (action.type) { case 'loading': - return { ...initialState, loading: true }; + return { ...initialState, loading: true } as State; case 'fetched': - return { ...initialState, loading: false, data: action.payload }; + return { ...initialState, loading: false, data: action.payload } as State; case 'error': - return { ...initialState, loading: false, error: action.payload }; + return { ...initialState, loading: false, error: action.payload } as State; default: return state; } diff --git a/apps/app/src/store/ReduxProvider.tsx b/apps/app/src/store/ReduxProvider.tsx index 3cb0b8ff..b3298bc0 100644 --- a/apps/app/src/store/ReduxProvider.tsx +++ b/apps/app/src/store/ReduxProvider.tsx @@ -8,8 +8,8 @@ import type { Persistor } from 'redux-persist/es/types'; import { makeStore, AppStore } from './store'; export function ReduxProvider({ children }: PropsWithChildren) { - const storeRef = useRef(); - const persistorRef = useRef(); + const storeRef = useRef(undefined); + const persistorRef = useRef(undefined); if (!storeRef.current) { // Create the store instance the first time this renders diff --git a/apps/app/src/types/equip.ts b/apps/app/src/types/equip.ts index 3d0116f2..11c8a066 100644 --- a/apps/app/src/types/equip.ts +++ b/apps/app/src/types/equip.ts @@ -1,6 +1,6 @@ export interface EquipItemSlot { name: string; - empty: JSX.Element; - filled?: JSX.Element; - filledArr?: JSX.Element[]; + empty: React.ReactNode; + filled?: React.ReactNode; + filledArr?: React.ReactNode[]; } diff --git a/apps/app/src/types/index.ts b/apps/app/src/types/index.ts index 3c782c55..28cfc05d 100644 --- a/apps/app/src/types/index.ts +++ b/apps/app/src/types/index.ts @@ -43,7 +43,7 @@ export type OverrideIcon = }) | React.ComponentClass | FunctionComponent>> - | ((props: IconProps) => JSX.Element); + | ((props: IconProps) => React.ReactNode); export interface EnhancedTableHeadProps extends TableCellProps { onSelectAllClick: (e: React.ChangeEvent) => void; diff --git a/apps/app/tsconfig.json b/apps/app/tsconfig.json index 487ae0ee..77ab1aa2 100644 --- a/apps/app/tsconfig.json +++ b/apps/app/tsconfig.json @@ -1,8 +1,9 @@ { "extends": "@nl/typescript-config/nextjs.json", "compilerOptions": { - "paths": { "@/*": ["./src/*"] } + "paths": { "@/*": ["./src/*"] }, + "plugins": [{ "name": "next" }] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", "next.config.js", ".next/types/**/*.ts"], "exclude": ["node_modules"] } diff --git a/apps/docs/docusaurus.config.ts b/apps/docs/docusaurus.config.ts index 14bddbbd..d6cccb5f 100644 --- a/apps/docs/docusaurus.config.ts +++ b/apps/docs/docusaurus.config.ts @@ -16,39 +16,40 @@ const config: Config = { markdown: { mermaid: true }, themes: ['@docusaurus/theme-mermaid'], - // i18n: { - // defaultLocale: 'en', - // locales: [ - // 'af', - // 'ar', - // 'cs', - // 'da', - // 'nl', - // 'en', - // 'fi', - // 'fr', - // 'de', - // 'el', - // 'he', - // 'hu', - // 'id', - // 'it', - // 'ja', - // 'ko', - // 'no', - // 'pl', - // 'pt-BR', - // 'ro', - // 'ru', - // 'sr', - // 'es-ES', - // 'sv-SE', - // 'tr', - // 'uk', - // 'vi', - // 'zh-CN', - // ], - // }, + i18n: { + defaultLocale: 'en', + locales: ['en'], + // locales: [ + // 'af', + // 'ar', + // 'cs', + // 'da', + // 'nl', + // 'en', + // 'fi', + // 'fr', + // 'de', + // 'el', + // 'he', + // 'hu', + // 'id', + // 'it', + // 'ja', + // 'ko', + // 'no', + // 'pl', + // 'pt-BR', + // 'ro', + // 'ru', + // 'sr', + // 'es-ES', + // 'sv-SE', + // 'tr', + // 'uk', + // 'vi', + // 'zh-CN', + // ], + }, presets: [ [ diff --git a/apps/docs/src/components/HomepageFeatures/index.tsx b/apps/docs/src/components/HomepageFeatures/index.tsx index d9d9cfbe..592823a1 100644 --- a/apps/docs/src/components/HomepageFeatures/index.tsx +++ b/apps/docs/src/components/HomepageFeatures/index.tsx @@ -80,7 +80,7 @@ function Feature(feature: FeatureItem) { ); } -export default function HomepageFeatures(): JSX.Element { +export default function HomepageFeatures(): React.ReactNode { return (
diff --git a/apps/docs/src/components/HomepageGuides/index.tsx b/apps/docs/src/components/HomepageGuides/index.tsx index b52cdd37..8ec17c25 100644 --- a/apps/docs/src/components/HomepageGuides/index.tsx +++ b/apps/docs/src/components/HomepageGuides/index.tsx @@ -141,7 +141,7 @@ function QuickLink({ title, to }: GuideLink) { ); } -export default function HomepageGuides(): JSX.Element { +export default function HomepageGuides(): React.ReactNode { return (
diff --git a/apps/docs/src/pages/index.tsx b/apps/docs/src/pages/index.tsx index 1c0d3aa8..6ea74ead 100644 --- a/apps/docs/src/pages/index.tsx +++ b/apps/docs/src/pages/index.tsx @@ -13,7 +13,7 @@ const Container = styled.main` margin: 0 auto; `; -export default function Home(): JSX.Element { +export default function Home(): React.ReactNode { const { siteConfig } = useDocusaurusContext(); return ( diff --git a/apps/smashers/next-env.d.ts b/apps/smashers/next-env.d.ts index a4a7b3f5..52e831b4 100644 --- a/apps/smashers/next-env.d.ts +++ b/apps/smashers/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. diff --git a/apps/smashers/src/components/AnimatedWrapper/index.tsx b/apps/smashers/src/components/AnimatedWrapper/index.tsx index 119905c8..758b1b4c 100644 --- a/apps/smashers/src/components/AnimatedWrapper/index.tsx +++ b/apps/smashers/src/components/AnimatedWrapper/index.tsx @@ -22,7 +22,7 @@ const AnimatedWrapper = ({ parallaxDirection?: string; transitionAmount?: string; }) => { - const ref: any = useRef(); + const ref = useRef(new HTMLDivElement()); const onScreen: boolean = useOnScreen(ref, immediate ? '0px' : '-100px'); useEffect(() => { diff --git a/apps/smashers/src/components/TrailerModal.tsx b/apps/smashers/src/components/TrailerModal.tsx index dd633739..7b00da17 100644 --- a/apps/smashers/src/components/TrailerModal.tsx +++ b/apps/smashers/src/components/TrailerModal.tsx @@ -21,7 +21,7 @@ const ModalContent = ({ modalIframe }: { modalIframe: RefObject(null); + const modalIframe = useRef(new HTMLIFrameElement()); const openModal = useCallback(() => setVisible(true), []); diff --git a/apps/smashers/src/components/UnityModal/Preloader.tsx b/apps/smashers/src/components/UnityModal/Preloader.tsx index c49b73dd..c7242770 100644 --- a/apps/smashers/src/components/UnityModal/Preloader.tsx +++ b/apps/smashers/src/components/UnityModal/Preloader.tsx @@ -27,7 +27,7 @@ const PreloaderSVG = () => ( ); -export default function Preloader({ ready, progress }: { ready: boolean; progress: number }): JSX.Element { +export default function Preloader({ ready, progress }: { ready: boolean; progress: number }): React.ReactNode { const loadingPercentage = Math.round(progress * 100); const [percent, setPercent] = useState(loadingPercentage); const { milliseconds, start, stop } = useStopwatch({ interval: 100 }); diff --git a/apps/smashers/src/hooks/useUnityEventHandlers.ts b/apps/smashers/src/hooks/useUnityEventHandlers.ts index 43f086e6..8693d9ee 100644 --- a/apps/smashers/src/hooks/useUnityEventHandlers.ts +++ b/apps/smashers/src/hooks/useUnityEventHandlers.ts @@ -9,7 +9,7 @@ type HookProps = { const useUnityEventHandlers = ({ address, authToken, addEventListener, removeEventListener }: HookProps) => { const authMsg = `true,${address || '0x0'},Vitalik,${authToken}`; - const authCallback = useRef void)>(); + const authCallback = useRef void)>(null); useEffect(() => { if (address.length && authCallback.current) { @@ -19,7 +19,6 @@ const useUnityEventHandlers = ({ address, authToken, addEventListener, removeEve const startAuthentication = useCallback( (e: CustomEvent<{ callback: (auth: string) => void }>) => { - // eslint-disable-next-line no-console console.log('Authenticating:', authMsg); e.detail.callback(authMsg); authCallback.current = e.detail.callback; @@ -30,7 +29,7 @@ const useUnityEventHandlers = ({ address, authToken, addEventListener, removeEve const getConfiguration = useCallback((e: CustomEvent<{ callback: (network: string) => void }>) => { const networkName = process.env.NEXT_PUBLIC_VERCEL_ENV === 'production' ? 'mainnet' : 'sepolia'; const version = process.env.NEXT_PUBLIC_SUBGRAPH_VERSION; - // eslint-disable-next-line no-console + console.log('getConfiguration', `${networkName},${version ?? ''}`); setTimeout(() => e.detail.callback(`${networkName},${version ?? ''}`), 1000); }, []); diff --git a/apps/smashers/src/lib/playfab/components/Auth/index.tsx b/apps/smashers/src/lib/playfab/components/Auth/index.tsx index 46cee568..41aba961 100644 --- a/apps/smashers/src/lib/playfab/components/Auth/index.tsx +++ b/apps/smashers/src/lib/playfab/components/Auth/index.tsx @@ -60,13 +60,13 @@ function Auth({ view = 'sign_in', redirectTo, onlyThirdPartyProviders = false, -}: Props): JSX.Element | null { +}: Props): React.ReactNode | null { const [authView, setAuthView] = useState(view); const [defaultEmail, setDefaultEmail] = useState(''); const [defaultPassword, setDefaultPassword] = useState(''); const verticalSocialLayout = socialLayout === 'vertical' ? true : false; - let containerClasses = [AuthStyles['sbui-auth']]; + const containerClasses = [AuthStyles['sbui-auth']]; if (className) containerClasses.push(className); const Container = (props: any) => ( @@ -160,7 +160,6 @@ function SocialAuth({ {providers.map(provider => { - // @ts-ignore const AuthIcon = SocialIcons[provider]; return (
diff --git a/apps/smashers/src/lib/playfab/sdk/PlayFab.ts b/apps/smashers/src/lib/playfab/sdk/PlayFab.ts index 6d69b889..04f51c48 100644 --- a/apps/smashers/src/lib/playfab/sdk/PlayFab.ts +++ b/apps/smashers/src/lib/playfab/sdk/PlayFab.ts @@ -50,7 +50,7 @@ export function MakeRequest( const getParams = settings.requestGetParams; if (getParams != null) { let firstParam = true; - for (let key in getParams) { + for (const key in getParams) { if (firstParam) { urlArr.push('?'); firstParam = false; diff --git a/apps/smashers/src/lib/playfab/sdk/typings/PlayFab.d.ts b/apps/smashers/src/lib/playfab/sdk/typings/PlayFab.d.ts index 296d19eb..dcc1843a 100644 --- a/apps/smashers/src/lib/playfab/sdk/typings/PlayFab.d.ts +++ b/apps/smashers/src/lib/playfab/sdk/typings/PlayFab.d.ts @@ -1,4 +1,4 @@ -declare module PlayFabModule { +declare namespace PlayFabModule { export interface IPlayFab { sdk_version: string; buildIdentifier: string; diff --git a/apps/smashers/src/lib/playfab/sdk/typings/PlayFabAdmin.d.ts b/apps/smashers/src/lib/playfab/sdk/typings/PlayFabAdmin.d.ts index 9537ea34..6d3523c8 100644 --- a/apps/smashers/src/lib/playfab/sdk/typings/PlayFabAdmin.d.ts +++ b/apps/smashers/src/lib/playfab/sdk/typings/PlayFabAdmin.d.ts @@ -1,4 +1,4 @@ -declare module PlayFabAdminModule { +declare namespace PlayFabAdminModule { export interface IPlayFabAdmin { settings: PlayFabModule.IPlayFabSettings; // Abort an ongoing task instance. @@ -723,7 +723,7 @@ declare module PlayFabAdminModule { } } -declare module PlayFabAdminModels { +declare namespace PlayFabAdminModels { export interface AbortTaskInstanceRequest extends PlayFabModule.IPlayFabRequestCommon { // The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). CustomTags?: { [key: string]: string | null }; diff --git a/apps/smashers/src/lib/playfab/sdk/typings/PlayFabClient.d.ts b/apps/smashers/src/lib/playfab/sdk/typings/PlayFabClient.d.ts index fa93aa83..5e26ecb4 100644 --- a/apps/smashers/src/lib/playfab/sdk/typings/PlayFabClient.d.ts +++ b/apps/smashers/src/lib/playfab/sdk/typings/PlayFabClient.d.ts @@ -1,4 +1,4 @@ -declare module PlayFabClientModule { +declare namespace PlayFabClientModule { export interface IPlayFabClient { settings: PlayFabModule.IPlayFabSettings; IsClientLoggedIn(): boolean; @@ -1135,7 +1135,7 @@ declare module PlayFabClientModule { } } -declare module PlayFabClientModels { +declare namespace PlayFabClientModels { export interface AcceptTradeRequest extends PlayFabModule.IPlayFabRequestCommon { // Items from the accepting player's inventory in exchange for the offered items in the trade. In the case of a gift, this // will be null. diff --git a/apps/smashers/src/lib/playfab/sdk/typings/PlayFabCloudScript.d.ts b/apps/smashers/src/lib/playfab/sdk/typings/PlayFabCloudScript.d.ts index 3d5500a4..ed65c28a 100644 --- a/apps/smashers/src/lib/playfab/sdk/typings/PlayFabCloudScript.d.ts +++ b/apps/smashers/src/lib/playfab/sdk/typings/PlayFabCloudScript.d.ts @@ -1,4 +1,4 @@ -declare module PlayFabCloudScriptModule { +declare namespace PlayFabCloudScriptModule { export interface IPlayFabCloudScript { settings: PlayFabModule.IPlayFabSettings; // Cloud Script is one of PlayFab's most versatile features. It allows client code to request execution of any kind of @@ -85,7 +85,7 @@ declare module PlayFabCloudScriptModule { } } -declare module PlayFabCloudScriptModels { +declare namespace PlayFabCloudScriptModels { export interface AdCampaignAttributionModel { // UTC time stamp of attribution AttributedAt: string; diff --git a/apps/smashers/src/pages/api/auth/[...nextauth].ts b/apps/smashers/src/pages/api/auth/[...nextauth].ts index c0b8a35e..009dc87a 100644 --- a/apps/smashers/src/pages/api/auth/[...nextauth].ts +++ b/apps/smashers/src/pages/api/auth/[...nextauth].ts @@ -29,14 +29,14 @@ const options = { name: 'next-auth.pkce.code_verifier', options: { httpOnly: true, - sameSite: 'none' as 'none', + sameSite: 'none' as const, path: '/', secure: true, }, }, }, callbacks: { - // @ts-ignore + // @ts-expect-error implicit any async jwt({ token, account }) { // Persist the OAuth access_token to the token right after signin if (account) { @@ -45,14 +45,14 @@ const options = { } return token; }, - // @ts-ignore + // @ts-expect-error implicit any async session({ session, token }) { // Send properties to the client, like an access_token from a provider. session.accessToken = token.accessToken; session.provider = token.provider; return session; }, - // @ts-ignore + // @ts-expect-error implicit any async signIn(params) { console.log('===== signIn Callback =====', params); return true; diff --git a/apps/smashers/tsconfig.json b/apps/smashers/tsconfig.json index 487ae0ee..77ab1aa2 100644 --- a/apps/smashers/tsconfig.json +++ b/apps/smashers/tsconfig.json @@ -1,8 +1,9 @@ { "extends": "@nl/typescript-config/nextjs.json", "compilerOptions": { - "paths": { "@/*": ["./src/*"] } + "paths": { "@/*": ["./src/*"] }, + "plugins": [{ "name": "next" }] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", "next.config.js", ".next/types/**/*.ts"], "exclude": ["node_modules"] } diff --git a/apps/template/app/layout.tsx b/apps/template/app/layout.tsx index 8145a526..3e0ee691 100644 --- a/apps/template/app/layout.tsx +++ b/apps/template/app/layout.tsx @@ -10,7 +10,7 @@ export const metadata: Metadata = { description: 'Generated by create turbo', }; -export default function RootLayout({ children }: PropsWithChildren): JSX.Element { +export default function RootLayout({ children }: PropsWithChildren): React.ReactNode { return ( {children} diff --git a/apps/template/app/page.tsx b/apps/template/app/page.tsx index 4b8678de..282a5531 100644 --- a/apps/template/app/page.tsx +++ b/apps/template/app/page.tsx @@ -2,7 +2,7 @@ import Image from 'next/image'; import { BaseCard, BaseButton, Code } from '@nl/ui/base'; import styles from './page.module.css'; -function Gradient({ conic, className, small }: { small?: boolean; conic?: boolean; className?: string }): JSX.Element { +function Gradient({ conic, className, small }: { small?: boolean; conic?: boolean; className?: string }): React.ReactNode { return (
diff --git a/apps/template/next-env.d.ts b/apps/template/next-env.d.ts index 4f11a03d..1b3be084 100644 --- a/apps/template/next-env.d.ts +++ b/apps/template/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/apps/template/tsconfig.json b/apps/template/tsconfig.json index 9e50341c..77ab1aa2 100644 --- a/apps/template/tsconfig.json +++ b/apps/template/tsconfig.json @@ -1,5 +1,9 @@ { "extends": "@nl/typescript-config/nextjs.json", - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "compilerOptions": { + "paths": { "@/*": ["./src/*"] }, + "plugins": [{ "name": "next" }] + }, + "include": ["**/*.ts", "**/*.tsx", "next-env.d.ts", "next.config.js", ".next/types/**/*.ts"], "exclude": ["node_modules"] } diff --git a/apps/web/next-env.d.ts b/apps/web/next-env.d.ts index 40c3d680..1b3be084 100644 --- a/apps/web/next-env.d.ts +++ b/apps/web/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/apps/web/src/app/(main)/disclaimer/page.tsx b/apps/web/src/app/(main)/disclaimer/page.tsx index 6f78f866..68442f3f 100644 --- a/apps/web/src/app/(main)/disclaimer/page.tsx +++ b/apps/web/src/app/(main)/disclaimer/page.tsx @@ -1,4 +1,4 @@ -import type { NextPage, Metadata } from 'next'; +import type { NextPage } from 'next'; import { Container } from '@mui/material'; import Definitions from '@/components/Definitions'; import AnimatedWrapper from '@/components/AnimatedWrapper'; diff --git a/apps/web/src/app/(main)/overview/page.tsx b/apps/web/src/app/(main)/overview/page.tsx index a407dfa2..56f129b8 100644 --- a/apps/web/src/app/(main)/overview/page.tsx +++ b/apps/web/src/app/(main)/overview/page.tsx @@ -65,6 +65,7 @@ const Overview: NextPage = () => {
+ {/* eslint-disable no-constant-binary-expression */} {false && (
diff --git a/apps/web/src/app/(special-routes)/gltf/[tokenId]/components/ModelView.tsx b/apps/web/src/app/(special-routes)/gltf/[tokenId]/components/ModelView.tsx index c1f58877..0699713a 100644 --- a/apps/web/src/app/(special-routes)/gltf/[tokenId]/components/ModelView.tsx +++ b/apps/web/src/app/(special-routes)/gltf/[tokenId]/components/ModelView.tsx @@ -36,13 +36,19 @@ type ModelViewerProps = { src: string; style: React.CSSProperties; }; -declare global { - namespace JSX { - interface IntrinsicElements { - 'model-viewer': React.DetailedHTMLProps, HTMLElement> & ModelViewerProps; - } - } -} + +// declare global { +// export namespace JSX { +// interface IntrinsicElements { +// 'model-viewer': React.DetailedHTMLProps, HTMLElement> & ModelViewerProps; +// } +// } +// } + +const ModelViewer: React.FC = props => { + // @ts-expect-error - model-viewer known attribute + return ; +}; export default function ModelView({ source }: { source: SRC }) { const params = useParams(); @@ -73,7 +79,7 @@ export default function ModelView({ source }: { source: SRC }) {
) : null} - + {/* eslint-disable react/no-unknown-property */}