Skip to content

Commit

Permalink
Fix root pkgs page losing too much masthead links
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 11, 2024
1 parent 7f7b80a commit f8be794
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/pkgx.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
</React.StrictMode>,
);

import MenuIcon from '@mui/icons-material/Menu';

function MyMasthead() {
const theme = useTheme();
const isxs = useMediaQuery(theme.breakpoints.down('md'));
const { pathname } = useLocation();
const is_pkgs = pathname.startsWith('/pkgs');

const search = <InstantSearch searchClient={searchClient} indexName="pkgs">
<Search />
Expand All @@ -59,7 +56,7 @@ function MyMasthead() {
</>

return <Masthead>
{!is_pkgs && stuff}
{(is_pkgs || !isxs) && search}
{/\/pkgs\/.+/.test(pathname) || stuff}
{(pathname.startsWith('/pkgs') || !isxs) && search}
</Masthead>
}

0 comments on commit f8be794

Please sign in to comment.