From e49d8f3313b4a727e7cdde7e0f1eb97e4536fee9 Mon Sep 17 00:00:00 2001 From: Mike Allanson Date: Fri, 5 Jan 2018 20:51:31 +0000 Subject: [PATCH] Add search form to site header --- www/src/components/navigation.js | 24 +++++---- www/src/components/search-form.js | 90 +++++++++++++++++++++++++++++++ www/src/html.js | 2 + www/static/search.svg | 4 ++ 4 files changed, 110 insertions(+), 10 deletions(-) create mode 100644 www/src/components/search-form.js create mode 100644 www/static/search.svg diff --git a/www/src/components/navigation.js b/www/src/components/navigation.js index 1b9acf8ef3867..8526453d65285 100644 --- a/www/src/components/navigation.js +++ b/www/src/components/navigation.js @@ -3,6 +3,7 @@ import Link from "gatsby-link" import GithubIcon from "react-icons/lib/go/mark-github" import TwitterIcon from "react-icons/lib/fa/twitter" +import SearchForm from '../components/search-form' import DiscordIcon from "../components/discord" import logo from "../gatsby-negative.svg" import typography, { rhythm, scale } from "../utils/typography" @@ -117,8 +118,9 @@ export default ({ pathname }) => { {

Gatsby @@ -150,10 +152,13 @@ export default ({ pathname }) => { css={{ display: `none`, [presets.Tablet]: { - display: `block`, + display: `flex`, margin: 0, padding: 0, listStyle: `none`, + flexGrow: 1, + overflowX: `auto`, + maskImage: `linear-gradient(to right, transparent, white 20px, white 90%, transparent)`, }, }} > @@ -165,12 +170,11 @@ export default ({ pathname }) => {
+ {!isHomepage && } + + + ) : null + } +} + +SearchForm.propTypes = { + styles: PropTypes.object, +} + +export default SearchForm diff --git a/www/src/html.js b/www/src/html.js index 752f6ce65e626..8b4bc465bd974 100644 --- a/www/src/html.js +++ b/www/src/html.js @@ -72,6 +72,8 @@ export default class HTML extends React.Component { href={`/safari-pinned-tab.svg`} color="#5bbad5" /> + + {css} diff --git a/www/static/search.svg b/www/static/search.svg new file mode 100644 index 0000000000000..b9faa8c07133e --- /dev/null +++ b/www/static/search.svg @@ -0,0 +1,4 @@ + + + +