Skip to content

Commit

Permalink
Have github button go to the pantry for /pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Feb 12, 2024
1 parent 309c15e commit 59f3b59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pkgx.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ function MyMasthead() {
const isxs = useMediaQuery(theme.breakpoints.down('md'));
const { pathname } = useLocation();

let gh = `https://github.com/pkgxdev/`
if (pathname.startsWith('/pkgs')) gh += 'pantry/'

const search = <InstantSearch searchClient={searchClient} indexName="pkgs">
<Search />
</InstantSearch>

const stuff = <>
<Button href='/pkgs/' color='inherit'>pkgs</Button>
<Discord />
<Stars href={`https://github.com/pkgxdev/`} hideCountIfMobile={true} />
<Stars href={gh} hideCountIfMobile={true} />
</>

console.log(/\/pkgs\/.+/.test(pathname), pathname)

return <Masthead>
{pathname.startsWith('/pkgs') && isxs ? null : stuff}
{pathname.startsWith('/pkgs') || !isxs ? search : undefined}
Expand Down

0 comments on commit 59f3b59

Please sign in to comment.