Closed github-learning-lab[bot] closed 4 years ago
:x::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::x::x:
:x: Request failed with status code 404 :white_check_mark: First test - Code compilation :white_check_mark: Your store must contain header full and header layouts desktop and mobile :white_check_mark: Desktop's header rows must be correctly stated :white_check_mark: Mobile's header rows must be correctly stated :white_check_mark: Your store must contain Desktop's Header Rows :white_check_mark: Your store must contain Mobile's Header Rows :white_check_mark: Your store must contain login, logo and rich-text :white_check_mark: Your store must contain correct login props :white_check_mark: Your store must contain correct logo props :white_check_mark: Your store must contain correct rich-text props :white_check_mark: Your store must contain the correct Search row on mobile mode :white_check_mark: Your store must contain the correct main row on mobile mode :white_check_mark: Your store must contain the correct main row on desktop mode :white_check_mark: Your store must contain the correct main row on desktop mode :x: Cannot read property 'replace' of undefined :x: Cannot read property 'replace' of undefined
:white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark::white_check_mark:
:white_check_mark: Getting files :white_check_mark: First test - Code compilation :white_check_mark: Your store must contain header full and header layouts desktop and mobile :white_check_mark: Desktop's header rows must be correctly stated :white_check_mark: Mobile's header rows must be correctly stated :white_check_mark: Your store must contain Desktop's Header Rows :white_check_mark: Your store must contain Mobile's Header Rows :white_check_mark: Your store must contain login, logo and rich-text :white_check_mark: Your store must contain correct login props :white_check_mark: Your store must contain correct logo props :white_check_mark: Your store must contain correct rich-text props :white_check_mark: Your store must contain the correct Search row on mobile mode :white_check_mark: Your store must contain the correct main row on mobile mode :white_check_mark: Your store must contain the correct main row on desktop mode :white_check_mark: Your store must contain the correct main row on desktop mode :white_check_mark: Search SVG should be correctly placed on iconpack :white_check_mark: Cart SVG should be correctly placed on iconpack
Header
:sparkles: Branch: header
Introduction
In this step, we'll learn how to configure the store's first component: the Header.
The Header plays a very important role on the store's main page, being responsible for housing other blocks that are crucial to user browsing, such as the search bar and the menu.
Desktop Header:
Mobile Header:
Configuring the Header
The Header block is responsivo, meaning that it can be configured to adapt to different devices, be it desktop or mobile.
Below, we can see an implementation example:
Activity
We will now configure a Header for your store's main page from scratch, with a notification and search bar, logo, cart and login. We will not configure the menu for now, since we'll look at it in depth during our next activity.
To implement a Header containing all these blocks, we'll start out from the code mentioned above and thus be able to build a responsive header, adaptable to desktop and mobile users alike.
Unlike the behavior found in other blocks, the Header doesn't need to be declared in one your theme's templates, since it will rendered on every store page anyway. In this exercise, we will declare the
header
block in theheader.jsonc
file, which must be created in thestore/blocks
folder.Thereafter, declare the following block:
header-row#main
, giving it the following children:logo
,header-spacer
,search-bar
,minicart
andlogin
;header-row#main
block, declare theinverted
,sticky
andfullWidth
props with the following values:true
,true
andfalse
, respectively;"header-row#notification"
): the Rich Text;After completing step 8, the new search bar and cart icon should be rendered on your store page as follows:
:information_source: Remember to access the header documentation if you have any questions during the activity.
If you're still unsure as to how to send your answers, click here.