-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gatsby-admin): Move
isOfficalPackage
& GatsbyMonogram
to own …
…components (#27921)
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from "react" | ||
|
||
function Monogram(): JSX.Element { | ||
return ( | ||
<svg | ||
fill="currentColor" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 1200 1200" | ||
focusable="false" | ||
height="1em" | ||
width="1em" | ||
> | ||
<path d="M600 0C268.6 0 0 268.6 0 600s268.6 600 600 600 600-268.6 600-600S931.4 0 600 0zM266.6 933.3C176.1 842.8 131 724.6 129.6 606L594 1070.4c-118.6-1.4-236.8-46.5-327.4-137.1zm437.7 126.1L140.6 495.7c47.5-210.1 235-367.1 459.4-367.1 156.9 0 295.5 77 381.2 194.9L915.6 379C845.8 279.5 730.5 214.3 600 214.3c-167.7 0-310.3 107.7-363.3 257.5l491.6 491.6c123.4-43.7 218-148.2 247.6-277.6H771.4V600h300c0 224.5-157 411.9-367.1 459.4z" /> | ||
</svg> | ||
) | ||
} | ||
|
||
export default Monogram |
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,13 @@ | ||
// Checks whether the package from an Algolia NPM search hit is an official Gatsby package | ||
export default function isOfficialPackage(pkg: Record<string, any>): boolean { | ||
return ( | ||
pkg.repository && | ||
!pkg.name.startsWith(`@`) && | ||
// if the repo url is the Gatsby monorepo | ||
(pkg.repository.url === `https://github.com/gatsbyjs/gatsby` || | ||
// or the repo url is a specific package in the monorepo | ||
pkg.repository.url.startsWith( | ||
`https://github.com/gatsbyjs/gatsby/tree/master/packages/` | ||
)) | ||
) | ||
} |