diff --git a/CHANGELOG.md b/CHANGELOG.md index 907adf30..71c18bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Support for `localeSwitcher`. + +## [2.18.0] - 2019-05-25 ## [2.17.0] - 2019-04-29 +### Added +- Added CSS Override class to header row background. ### Added - Allow `drawer` block on `header-row`. diff --git a/README.md b/README.md index 48d5c01b..b3bc3f55 100644 --- a/README.md +++ b/README.md @@ -107,18 +107,18 @@ Note that every `header` implementation must append all required blocks within i Through the Storefront, you can change the headers's behavior and interface. However, you also can make in your theme app, as Store theme does. -| Prop name | Type | Description | Default value | -| ---------------------- | --------- | ------------------------------------------------- | ------------------------------------------------------------------------ | -| `leanWhen` | `String` | Cases in which the menu is in lean mode | 'a^' | -| `linkUrl` | `String` | Address opened when the user clicks the logo | '/' | -| `logoUrl` | `String` | URL of the logo image | N/A | -| `logoTitle` | `String` | Alt text for the logo | N/A | -| `logoSize` | `Object` | Sizes of logo in desktop and mobile | `desktop: { width: 132, height: 40 }, mobile: { width: 90, height: 40 }` | -| `showSearchBar` | `Boolean` | Sets whether the search bar is visible or not | true | -| `showLogin` | `Boolean` | Sets whether the login button is displayed or not | true | -| `iconClasses` | `String` | Classes for icons | 'c-on-base' | -| `labelClasses` | `String` | Classes for labels | 'c-on-base' | -| `collapsibleAnimation` | `Object` | Collapsible animation controlling | [Collapsible Animation](#collapsible-animation) | +| Prop name | Type | Description | Default value | +| ---------------------- | --------- | ---------------------------------------------------- | ------------------------------------------------------------------------ | +| `leanWhen` | `String` | Cases in which the menu is in lean mode | 'a^' | +| `linkUrl` | `String` | Address opened when the user clicks the logo | '/' | +| `logoUrl` | `String` | URL of the logo image | N/A | +| `logoTitle` | `String` | Alt text for the logo | N/A | +| `logoSize` | `Object` | Sizes of logo in desktop and mobile | `desktop: { width: 132, height: 40 }, mobile: { width: 90, height: 40 }` | +| `showSearchBar` | `Boolean` | Sets whether the search bar is visible or not | true | +| `showLogin` | `Boolean` | Sets whether the login button is displayed or not | true | +| `iconClasses` | `String` | Classes for icons | 'c-on-base' | +| `labelClasses` | `String` | Classes for labels | 'c-on-base' | +| `collapsibleAnimation` | `Object` | Collapsible animation controlling | [Collapsible Animation](#collapsible-animation) | ##### Collapsible Animation diff --git a/manifest.json b/manifest.json index e32a94c9..2ecd2bf3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "vendor": "vtex", "name": "store-header", - "version": "2.17.0", + "version": "2.18.0", "title": "VTEX Store Header", "defaultLocale": "pt-BR", "description": "The VTEX Store Header component", @@ -28,6 +28,7 @@ "vtex.store-components": "3.x", "vtex.store-icons": "0.x", "vtex.rich-text": "0.x", - "vtex.store-drawer": "0.x" + "vtex.store-drawer": "0.x", + "vtex.locale-switcher": "0.x" } } diff --git a/messages/context.json b/messages/context.json index 5ef69e20..910038e9 100644 --- a/messages/context.json +++ b/messages/context.json @@ -6,6 +6,7 @@ "admin/editor.header.link.url": "admin/editor.header.link.url", "admin/editor.header.show.searchbar.title": "admin/editor.header.show.searchbar.title", "admin/editor.header.show.login.title": "admin/editor.header.show.login.title", + "admin/editor.header.show.localeswitcher.title": "admin/editor.header.show.localeswitcher.title", "store/header.search-placeholder": "store/header.search-placeholder", "store/header.search-emptyPlaceholder": "store/header.search-emptyPlaceholder", "store/header.topMenu.minicart.icon.label": "store/header.topMenu.minicart.icon.label", diff --git a/messages/en.json b/messages/en.json index 375b9ad3..9067452d 100644 --- a/messages/en.json +++ b/messages/en.json @@ -6,6 +6,7 @@ "admin/editor.header.link.url": "Logo link", "admin/editor.header.show.searchbar.title": "Show SearchBar", "admin/editor.header.show.login.title": "Show Login", + "admin/editor.header.show.localeswitcher.title": "Show Locale Switcher", "store/header.search-placeholder": "Search for products, brands...", "store/header.search-emptyPlaceholder": "No matches found", "store/header.topMenu.minicart.icon.label": "My Cart", diff --git a/messages/es.json b/messages/es.json index 6374a1ea..9dd2eb71 100644 --- a/messages/es.json +++ b/messages/es.json @@ -5,6 +5,7 @@ "admin/editor.header.logo.image": "Imagen del logotipo", "admin/editor.header.link.url": "Link del logotipo", "admin/editor.header.show.searchbar.title": "Mostrar Busca", + "admin/editor.header.show.localeswitcher.title": "Mostrar selector de localidade", "admin/editor.header.show.login.title": "Mostrar Login", "store/header.search-placeholder": "Búsqueda por productos, marcas...", "store/header.search-emptyPlaceholder": "Ningún resultado encontrado", diff --git a/messages/pt.json b/messages/pt.json index 7752486d..e4213b10 100644 --- a/messages/pt.json +++ b/messages/pt.json @@ -6,6 +6,7 @@ "admin/editor.header.link.url": "Link da Logo", "admin/editor.header.show.searchbar.title": "Mostrar Busca", "admin/editor.header.show.login.title": "Mostrar Login", + "admin/editor.header.show.localeswitcher.title": "Mostrar seletor de localidade", "store/header.search-placeholder": "Busque por produtos, marcas...", "store/header.search-emptyPlaceholder": "Nenhum resultado encontrado", "store/header.topMenu.minicart.icon.label": "Meu Carrinho", diff --git a/react/__tests__/__snapshots__/Header.test.js.snap b/react/__tests__/__snapshots__/Header.test.js.snap index 8640d205..75854922 100644 --- a/react/__tests__/__snapshots__/Header.test.js.snap +++ b/react/__tests__/__snapshots__/Header.test.js.snap @@ -47,6 +47,11 @@ exports[`Header Component should match snapshot mobile with leanmode 1`] = ` +
+ locale-switcher +
@@ -145,6 +150,11 @@ exports[`Header Component should match snapshot mobile without leanmode 1`] = `
+
+ locale-switcher +
@@ -241,6 +251,11 @@ exports[`Header Component should match snapshot with leanmode 1`] = `
+
+ locale-switcher +
@@ -339,6 +354,11 @@ exports[`Header Component should match snapshot without leanmode 1`] = `
+
+ locale-switcher +
diff --git a/react/components/Row.css b/react/components/Row.css index a5c04107..392df4ff 100644 --- a/react/components/Row.css +++ b/react/components/Row.css @@ -1 +1,3 @@ -.headerRow {} \ No newline at end of file +.headerRow {} +.headerRowBackground {} +.headerRowContainer {} \ No newline at end of file diff --git a/react/components/Row.tsx b/react/components/Row.tsx index c5b9a614..9f8357f9 100644 --- a/react/components/Row.tsx +++ b/react/components/Row.tsx @@ -19,14 +19,14 @@ const Row: FunctionComponent = ({ inverted, blockClass, }) => { - const content =
{children}
+ const content =
{children}
return (
)} + +