Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move queries that find related posts into a subcomponent #168

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ import {
} from "@chakra-ui/react";
import { CreditCardIcon } from "@heroicons/react/solid";
import Link from "next/link";
import React from "react";
import HeaderUserInfo from "./HeaderUserInfo";
import { SearchBar } from "./SearchBar";

export interface HeaderProps {
minimalContent?: boolean;
}

const SearchBarMemo = React.memo(SearchBar);

const Header: React.FC<HeaderProps> = ({
minimalContent = false,
children,
}) => {

return (
<Box as="header" backgroundColor="secondaryBackground" boxShadow="md">
<Container py={{ base: 5, md: 8 }} maxWidth="container.lg">
Expand Down Expand Up @@ -61,7 +65,7 @@ const Header: React.FC<HeaderProps> = ({
)}
{!minimalContent && (
<Box gridArea="search">
<SearchBar openOnFocus={true} overlay={true} />
<SearchBarMemo openOnFocus={true} overlay={true} />
</Box>
)}
<Box gridArea="account" textAlign="right">
Expand Down