Skip to content

Commit

Permalink
Merge 1acad0b into bcd99c2
Browse files Browse the repository at this point in the history
  • Loading branch information
thalytafabrine committed May 27, 2019
2 parents bcd99c2 + 1acad0b commit 7cd3339
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ 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

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions messages/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 20 additions & 0 deletions react/__tests__/__snapshots__/Header.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ exports[`Header Component should match snapshot mobile with leanmode 1`] = `
</div>
</div>
</div>
<div
class="extension-point-mock"
>
locale-switcher
</div>
<div
class="topMenuIcons flex justify-end flex-grow-1 flex-grow-0-ns items-center order-1-s ml-auto-s order-2-ns"
>
Expand Down Expand Up @@ -145,6 +150,11 @@ exports[`Header Component should match snapshot mobile without leanmode 1`] = `
</div>
</div>
</div>
<div
class="extension-point-mock"
>
locale-switcher
</div>
<div
class="topMenuIcons flex justify-end flex-grow-1 flex-grow-0-ns items-center order-1-s ml-auto-s order-2-ns"
>
Expand Down Expand Up @@ -241,6 +251,11 @@ exports[`Header Component should match snapshot with leanmode 1`] = `
</div>
</div>
</div>
<div
class="extension-point-mock"
>
locale-switcher
</div>
<div
class="topMenuIcons flex justify-end flex-grow-1 flex-grow-0-ns items-center order-1-s ml-auto-s order-2-ns"
>
Expand Down Expand Up @@ -339,6 +354,11 @@ exports[`Header Component should match snapshot without leanmode 1`] = `
</div>
</div>
</div>
<div
class="extension-point-mock"
>
locale-switcher
</div>
<div
class="topMenuIcons flex justify-end flex-grow-1 flex-grow-0-ns items-center order-1-s ml-auto-s order-2-ns"
>
Expand Down
2 changes: 2 additions & 0 deletions react/legacy/components/FixedContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ const FixedContent = ({
<SearchBar mobile={mobile} />
</div>
)}

<ExtensionPoint id="locale-switcher"/>

<Actions
iconClasses={iconClasses}
Expand Down
5 changes: 4 additions & 1 deletion store/blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"minicart",
"login",
"category-menu",
"search-bar"
"search-bar",
"locale-switcher"
]
},
"header-layout.desktop": {
Expand All @@ -34,6 +35,7 @@
"children": [
"header-spacer",
"search-bar",
"locale-switcher",
"header-spacer",
"login",
"minicart"
Expand Down Expand Up @@ -66,6 +68,7 @@
"children": [
"logo",
"search-bar",
"locale-switcher",
"login",
"minicart"
]
Expand Down
3 changes: 3 additions & 0 deletions store/interfaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"login",
"category-menu",
"search-bar",
"locale-switcher",
"theme",
"user-address",
"menu",
Expand Down Expand Up @@ -47,6 +48,7 @@
"minicart",
"login",
"search-bar",
"locale-switcher",
"menu-link",
"category-menu",
"menu",
Expand Down Expand Up @@ -87,6 +89,7 @@
"minicart",
"login",
"search-bar",
"locale-switcher",
"menu-link",
"category-menu",
"menu",
Expand Down

0 comments on commit 7cd3339

Please sign in to comment.