diff --git a/.github/workflows/lighthouse_comment.yml b/.github/workflows/lighthouse_comment.yml index 403ac4e7..583fbe78 100644 --- a/.github/workflows/lighthouse_comment.yml +++ b/.github/workflows/lighthouse_comment.yml @@ -1,19 +1,19 @@ -name: Lighthouse – Comment +name: Lighthouse CI on: - workflow_run: - workflows: ["Lighthouse – Run"] - types: - - completed + pull_request: + branches: + - main permissions: issues: write - pull-requests: write jobs: comment: runs-on: ubuntu-latest - + permissions: + contents: read + pull-requests: write steps: - name: Download Lighthouse comment artifact uses: actions/download-artifact@v4 @@ -29,4 +29,4 @@ jobs: with: issue-number: ${{ github.event.pull_request.number }} body-path: lighthouse-comment.md - edit-mode: replace + edit-mode: replace \ No newline at end of file diff --git a/components/testimonials.tsx b/components/testimonials.tsx index b57e19bd..baab4ef7 100644 --- a/components/testimonials.tsx +++ b/components/testimonials.tsx @@ -1,9 +1,10 @@ import React from "react"; import { Marquee } from "./Marquee"; import Tweets from "../services/Tweets"; +import { useRouter } from "next/router"; const firstRow = Tweets.slice(0, Tweets.length / 2); const secondRow = Tweets.slice(Tweets.length / 2); - +import Image from "next/image"; const ReviewCard = ({ avatar, name, @@ -17,31 +18,29 @@ const ReviewCard = ({ id: string; content: string; }) => { - const fallbackAvatar = `https://ui-avatars.com/api/?name=${encodeURIComponent(name)}&background=random&size=64`; - const localPlaceholder = "/blog/avatars/avatar-placeholder.svg"; + const { basePath } = useRouter(); + const isExternal = /^(?:https?:)?\/\//i.test(avatar); + const proxiedAvatar = isExternal + ? `${basePath}/api/proxy-image?url=${encodeURIComponent(avatar)}` + : avatar; + return ( -
+
- {`${name}'s { - const img = e.target as HTMLImageElement; - if (img.src !== localPlaceholder) { - img.onerror = () => { img.src = localPlaceholder; }; - img.src = fallbackAvatar; - } - }} + width={32} + height={32} + alt={`${name}'s profile picture`} + src={proxiedAvatar} />
{name}
-

{id}

+

{id}

+
{content}
@@ -54,6 +53,7 @@ const TwitterTestimonials = () => {

What our community thinks

+
@@ -61,15 +61,18 @@ const TwitterTestimonials = () => { ))} + {secondRow.map((tweet) => ( ))} +
+
); }; -export default TwitterTestimonials; +export default TwitterTestimonials; \ No newline at end of file diff --git a/lint_utf8.txt b/lint_utf8.txt new file mode 100644 index 00000000..e69de29b