Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions app/(app)/articles/_client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Children, Fragment, useEffect } from "react";
import { Fragment, useEffect } from "react";
import { TagIcon } from "@heroicons/react/20/solid";
import ArticlePreview from "@/components/ArticlePreview/ArticlePreview";
import ArticleLoading from "@/components/ArticlePreview/ArticleLoading";
Expand Down Expand Up @@ -105,11 +105,7 @@ const ArticlesPage = () => {
</div>
)}
{status === "pending" &&
Children.toArray(
Array.from({ length: 7 }, () => {
return <ArticleLoading />;
}),
)}
Array.from({ length: 7 }, (_, i) => <ArticleLoading key={i} />)}
{status === "success" &&
data.pages.map((page) => {
return (
Expand Down
8 changes: 2 additions & 6 deletions app/(app)/notifications/_client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { Children, Fragment, useEffect } from "react";
import { Fragment, useEffect } from "react";
import { useInView } from "react-intersection-observer";
import { CheckCircleIcon } from "@heroicons/react/20/solid";
import { Temporal } from "@js-temporal/polyfill";
Expand Down Expand Up @@ -91,11 +91,7 @@ const Notifications = () => {
<div>Something went wrong... Please refresh your page.</div>
)}
{status === "pending" &&
Children.toArray(
Array.from({ length: 7 }, () => {
return <Placeholder />;
}),
)}
Array.from({ length: 7 }, (_, i) => <Placeholder key={i} />)}
{status !== "pending" && noNotifications && (
<p className="text-lg font-semibold text-neutral-900 dark:text-neutral-50">
No new notifications. ✅{" "}
Expand Down
7 changes: 1 addition & 6 deletions app/(app)/saved/_client.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { Children } from "react";
import ArticlePreview from "@/components/ArticlePreview/ArticlePreview";
import { api } from "@/server/trpc/react";
import PageHeading from "@/components/PageHeading/PageHeading";
Expand Down Expand Up @@ -33,11 +32,7 @@ const SavedPosts = () => {
<PageHeading>Saved items</PageHeading>
<div>
{bookmarkStatus === "pending" &&
Children.toArray(
Array.from({ length: 7 }, () => {
return <ArticleLoading />;
}),
)}
Array.from({ length: 7 }, (_, i) => <ArticleLoading key={i} />)}
{bookmarkStatus === "error" && (
<p className="py-4 font-medium">
Something went wrong fetching your saved posts... Refresh the page.
Expand Down
10 changes: 4 additions & 6 deletions components/SideBar/SideBarSavedPosts.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { api } from "@/server/trpc/react";
import React, { Children } from "react";
import React from "react";

import SideBarSavedArticlePreview from "./SideBarSavedArticlePreview";
import Link from "next/link";
Expand All @@ -22,11 +22,9 @@ export default React.memo(function SideBarSavedPosts() {
</h3>
<div className="w-full">
{bookmarkStatus === "pending" &&
Children.toArray(
Array.from({ length: howManySavedToShow }, () => {
return <LoadingSkeleton />;
}),
)}
Array.from({ length: howManySavedToShow }, (_, i) => (
<LoadingSkeleton key={i} />
))}
{bookmarkStatus === "error" && (
<p className="py-4 font-medium">
Something went wrong fetching your saved posts... Refresh the page.
Expand Down
9 changes: 3 additions & 6 deletions components/TrendingPosts/TrendingPostsLoading.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { Children } from "react";
import ArticleLoading from "@/components/ArticlePreview/ArticleLoading";

function LoadingTrendingPosts() {
return (
<div>
{Children.toArray(
Array.from({ length: 5 }, () => {
return <ArticleLoading />;
}),
)}
{Array.from({ length: 5 }, (_, i) => (
<ArticleLoading key={i} />
))}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const REMOTE_PATTERNS = [
}));

const config = {
// Exclude jsdom and isomorphic-dompurify from bundling to fix ESM/CJS compatibility
serverExternalPackages: ["jsdom", "isomorphic-dompurify"],
// Turbopack configuration for SVGR (replaces webpack config)
turbopack: {
rules: {
Expand Down
Loading