Skip to content

Commit

Permalink
Merge cdc0b03 into 85a2c83
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisermann committed Jan 24, 2020
2 parents 85a2c83 + cdc0b03 commit d49dc95
Show file tree
Hide file tree
Showing 15 changed files with 782 additions and 300 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
legacy
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "vtex",
"env": {
"node": true
}
}
7 changes: 1 addition & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"eslintIntegration": true
}
"@vtex/prettier-config"
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ You can check if others are passing through similar issues [here](https://github

## Contributing

Check it out [how to contribute](https://github.com/vtex-apps/awesome-io#contributing) with this project.
Check it out [how to contribute](https://github.com/vtex-apps/awesome-io#contributing) with this project.

## Tests

Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"private": true,
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-vtex-react": "^4.0.0",
"prettier": "^1.16.4",
"typescript": "^3.4.1"
"scripts": {
"lint": "eslint --ext js,jsx,ts,tsx .",
"format": "prettier --write \"**/*.{ts,js,json}\""
},
"dependencies": {
"@vtex/css-handles": "^1.1.0"
"devDependencies": {
"@vtex/prettier-config": "^0.0.1",
"eslint": "^6.8.0",
"eslint-config-vtex-react": "^5.1.0",
"prettier": "^1.19.1",
"react": "^16.12.0",
"typescript": "^3.7.5"
}
}
4 changes: 1 addition & 3 deletions react/ForceCenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const ForceCenter = ({ children }) => {

return (
<div
className={`${
handles.forceCenter
} absolute left-0 right-0 flex justify-center z-1`}
className={`${handles.forceCenter} absolute left-0 right-0 flex justify-center z-1`}
style={{ pointerEvents: 'none' }}
>
<div
Expand Down
1 change: 1 addition & 0 deletions react/__tests__/Header.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import { render } from '@vtex/test-tools/react'
import { useRuntime } from 'vtex.render-runtime'

import Header from '../legacy/index'

describe('Header Component', () => {
Expand Down
1 change: 1 addition & 0 deletions react/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FunctionComponent } from 'react'

import StickyRows from './StickyRows'

const Layout: FunctionComponent = ({ children }) => {
Expand Down
2 changes: 2 additions & 0 deletions react/components/StickyRows.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React, { FunctionComponent } from 'react'

import useCumulativeHeightState from '../hooks/useCumulativeHeightState'

const RowContext = React.createContext<{
onResize(height: number): void
offset: number
}>({
// eslint-disable-next-line @typescript-eslint/no-empty-function
onResize: () => {},
offset: 0,
})
Expand Down
2 changes: 1 addition & 1 deletion react/hooks/useCumulativeHeightState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const useCumulativeHeightState = () => {
const getAccumulatedHeight = (index: number) => {
const sortedIndices = Object.keys(state)
.map(key => parseInt(key, 10))
.sort()
.sort((a, b) => a - b)

const indices = sortedIndices.slice(0, sortedIndices.indexOf(index))

Expand Down
1 change: 1 addition & 0 deletions react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Suspense } from 'react'
import { useChildBlock, NoSSR } from 'vtex.render-runtime'

import CustomHeader from './components/CustomHeader'

const LegacyHeader = React.lazy(() => import('./legacy'))

const Header = props => {
Expand Down
16 changes: 8 additions & 8 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "2.25.0",
"name": "vtex.header",
"description": "A Header Component.",
"license": "ISC",
Expand All @@ -9,6 +10,12 @@
"gen:coveralls": "yarn test:coverage && cat ./coverage/lcov.info | coveralls",
"lint": "tsc --noEmit && eslint --ext ts,tsx ."
},
"devDependencies": {
"@types/classnames": "^2.2.7",
"@vtex/test-tools": "^0.1.3",
"apollo-client": "^2.5.1",
"coveralls": "^3.0.3"
},
"dependencies": {
"@types/react-resize-detector": "^3.1.1",
"@vtex/css-handles": "^1.1.3",
Expand All @@ -26,12 +33,5 @@
},
"vtexScriptsOverride": {
"srcPath": "."
},
"devDependencies": {
"@types/classnames": "^2.2.7",
"@vtex/test-tools": "^0.1.3",
"apollo-client": "^2.5.1",
"coveralls": "^3.0.3"
},
"version": "2.25.0"
}
}
1 change: 1 addition & 0 deletions react/testUtils/test-utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import * as reactTestingLibrary from 'react-testing-library'
import { IntlProvider } from 'react-intl'

import defaultStrings from '../../messages/en.json'

const customRender = (node, options) => {
Expand Down
5 changes: 1 addition & 4 deletions react/typings/css.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
declare module '*.css' {
const css: any
export default css
}
declare module '*.css'
Loading

0 comments on commit d49dc95

Please sign in to comment.