diff --git a/src/components/TopbarDesktop/TopbarDesktop.css b/src/components/TopbarDesktop/TopbarDesktop.css index 38e21f93..cfacbc58 100644 --- a/src/components/TopbarDesktop/TopbarDesktop.css +++ b/src/components/TopbarDesktop/TopbarDesktop.css @@ -10,7 +10,7 @@ display: flex; flex-direction: row; justify-content: space-between; - align-items: baseline; + align-items: flex-start; padding: 0 36px; /* fill */ @@ -32,7 +32,6 @@ /* logo */ .logoLink { - align-self: flex-start; flex-shrink: 0; display: flex; align-items: center; @@ -46,10 +45,8 @@ } /* Search */ -/* TODO This is placeholder, it needs Search component */ .searchLink { - min-width: 220px; - align-self: flex-start; + flex-grow: 1; height: 100%; margin-right: 24px; } @@ -60,15 +57,9 @@ color: var(--matterColor); } -/* Spacer */ -/* Extra space is gathered between search and createListingLink */ -.spacer { - flex-grow: 1; -} - /* Create listing (CTA for providers) */ .createListingLink { - align-self: flex-start; + flex-shrink: 0; height: 100%; margin-right: 24px; } @@ -81,7 +72,6 @@ /* Inbox */ .inboxLink { - align-self: flex-start; height: 100%; margin-right: 24px; } @@ -94,7 +84,6 @@ /* Profile menu */ .profileMenuLabel { - align-self: flex-start; flex-shrink: 0; display: flex; align-items: center; @@ -112,13 +101,13 @@ /* Authentication */ .signupLink { - align-self: flex-start; + flex-shrink: 0; height: 100%; margin-right: 24px; } .loginLink { - align-self: flex-start; + flex-shrink: 0; height: 100%; } diff --git a/src/components/TopbarDesktop/TopbarDesktop.example.js b/src/components/TopbarDesktop/TopbarDesktop.example.js index f6357ec8..5d0c8d16 100644 --- a/src/components/TopbarDesktop/TopbarDesktop.example.js +++ b/src/components/TopbarDesktop/TopbarDesktop.example.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { fakeIntl } from '../../util/test-data'; import TopbarDesktop from './TopbarDesktop'; @@ -9,6 +10,9 @@ export const AuthenticatedDesktopTopbar = { isAuthenticated: true, currentUserHasListings: true, name: 'John Doe', + onSearchSubmit: values => { + console.log('submit search:', values); + }, intl: fakeIntl, onLogout: noop, }, diff --git a/src/components/TopbarDesktop/TopbarDesktop.js b/src/components/TopbarDesktop/TopbarDesktop.js index 7eacb3d8..fc6edcec 100644 --- a/src/components/TopbarDesktop/TopbarDesktop.js +++ b/src/components/TopbarDesktop/TopbarDesktop.js @@ -1,5 +1,5 @@ import React, { PropTypes } from 'react'; -import { FormattedMessage, intlShape, injectIntl } from 'react-intl'; +import { FormattedMessage, intlShape } from 'react-intl'; import classNames from 'classnames'; import { Avatar, @@ -10,6 +10,7 @@ import { MenuItem, NamedLink, } from '../../components'; +import { TopbarSearchForm } from '../../containers'; import logo from './images/saunatime-logo.png'; import css from './TopbarDesktop.css'; @@ -24,16 +25,20 @@ const TopbarDesktop = props => { intl, isAuthenticated, onLogout, + onSearchSubmit, + initialSearchFormValues, } = props; const rootClass = rootClassName || css.root; const classes = classNames(rootClass, className); - // TODO This is just a placeholder const search = ( -
-