Skip to content

Commit

Permalink
Merge 4538d57 into 71b938a
Browse files Browse the repository at this point in the history
  • Loading branch information
lbebber authored Jun 4, 2019
2 parents 71b938a + 4538d57 commit 22b3e65
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.20.0] - 2019-06-04
### Added
- `header-force-center` block, for forcing centering on header.

## [2.19.0] - 2019-05-28
### Added
- Support for `localeSwitcher`.
Expand Down
5 changes: 3 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"vendor": "vtex",
"name": "store-header",
"version": "2.19.0",
"version": "2.20.0",
"title": "VTEX Store Header",
"defaultLocale": "pt-BR",
"description": "The VTEX Store Header component",
Expand Down Expand Up @@ -30,5 +30,6 @@
"vtex.rich-text": "0.x",
"vtex.store-drawer": "0.x",
"vtex.locale-switcher": "0.x"
}
},
"$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"eslint-config-vtex-react": "^4.0.0",
"prettier": "^1.16.4",
"typescript": "^3.4.1"
},
"dependencies": {
"@vtex/css-handles": "^1.1.0"
}
}
19 changes: 19 additions & 0 deletions react/ForceCenter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react'
import { generateBlockClass } from '@vtex/css-handles'
import styles from './components/ForceCenter.css'

const ForceCenter = ({ children, blockClass }) => (
<div
className={generateBlockClass(
`${generateBlockClass(
styles.forceCenter,
blockClass
)} absolute left-0 right-0 flex justify-center z-1`
)}
style={{ pointerEvents: 'none' }}
>
<div style={{ pointerEvents: 'all' }}>{children}</div>
</div>
)

export default ForceCenter
1 change: 1 addition & 0 deletions react/components/ForceCenter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.forceCenter {}
11 changes: 9 additions & 2 deletions react/components/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@ const Row: FunctionComponent<Props & BlockClass> = ({
inverted,
blockClass,
}) => {
const content = <div className={`${styles.headerRowContainer} w-100 flex items-center`}>{children}</div>
const content = (
<div className={`${styles.headerRowContainer} w-100 flex items-center`}>
{children}
</div>
)

return (
<StickyRow sticky={sticky}>
<div className={generateBlockClass(styles.headerRow, blockClass)}>
<div
className={classNames(
`${generateBlockClass(styles.headerRowBackground, blockClass)} w-100`,
`${generateBlockClass(
styles.headerRowBackground,
blockClass
)} w-100`,
inverted
? 'bg-base--inverted c-on-base--inverted'
: 'bg-base c-on-base'
Expand Down
8 changes: 7 additions & 1 deletion store/interfaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"user-address",
"header-spacer",
"rich-text",
"drawer"
"drawer",
"header-force-center"
],
"component": "Row",
"composition": "children"
Expand Down Expand Up @@ -103,5 +104,10 @@
},
"unstable--header-border": {
"component": "Border"
},
"header-force-center": {
"component": "ForceCenter",
"composition": "children",
"allowed": "*"
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
lodash.unescape "4.0.1"
semver "5.5.0"

"@vtex/css-handles@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@vtex/css-handles/-/css-handles-1.1.0.tgz#c49998230e7b1576bef4ea6125471137a54c6c86"
integrity sha512-GP5ONxBimQoKRIW8WjUCI5/HU13JdMTxPw1aoumWcDv3ycUu13IR8HzzIuTM+iFZE9ctvGZfVCq9FXqQ747yNw==

acorn-jsx@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e"
Expand Down

0 comments on commit 22b3e65

Please sign in to comment.