Skip to content

Commit

Permalink
Merge 51ea08d into d06920e
Browse files Browse the repository at this point in the history
  • Loading branch information
lbebber committed Apr 8, 2020
2 parents d06920e + 51ea08d commit 9ab53dc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 53 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Footer is no longer sensitive to `__fold__`--it relies on partial hydration for performance instead.

## [2.20.0] - 2020-03-20
### Changed
Expand Down
10 changes: 0 additions & 10 deletions react/Footer.js
@@ -1,16 +1,10 @@
import React, { Suspense } from 'react'
import { ExtensionPoint, useChildBlock, NoSSR } from 'vtex.render-runtime'
import { useDevice } from 'vtex.device-detector'
import useFold from './hooks/useFold'

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

const Footer = props => {
/** This is a temporary fix--this behaviour is supposed
* to come from render-runtime delayed hydration in the
* future. */
const shouldRenderBelowTheFold = useFold()

const hasFooterDesktop = !!useChildBlock({
id: 'footer-layout.desktop',
})
Expand All @@ -20,10 +14,6 @@ const Footer = props => {

const { isMobile } = useDevice()

if (!shouldRenderBelowTheFold) {
return null
}

const hasFooterLayout = hasFooterDesktop || hasFooterMobile

if (!hasFooterLayout) {
Expand Down
43 changes: 0 additions & 43 deletions react/hooks/useFold.tsx

This file was deleted.

0 comments on commit 9ab53dc

Please sign in to comment.