-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replace
PRSocialCard
component with GitHub OpenGraph image (#889)
Fixes #883
- Loading branch information
Showing
6 changed files
with
60 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { generateGhOgImage } from "lib/utils/github"; | ||
import Image from "next/image"; | ||
import InvalidImage from "img/404 Image.svg"; | ||
import { useEffect, useState } from "react"; | ||
|
||
interface GhOpenGraphImgProps { | ||
githubLink: string; | ||
} | ||
|
||
const GhOpenGraphImg = ({ githubLink }: GhOpenGraphImgProps): JSX.Element => { | ||
const { isValid, url } = generateGhOgImage(githubLink); | ||
|
||
return ( | ||
<> | ||
{url && ( | ||
<picture> | ||
<img src={isValid ? url : InvalidImage} alt={isValid ? "github og image" : "invalid url image"} /> | ||
</picture> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default GhOpenGraphImg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 0 additions & 101 deletions
101
components/molecules/PullRequestHighlightCard/pull-request-highlight-card.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters