Skip to content

Commit

Permalink
Merge pull request #191 from Web-Dev-Path/chore/mobile-view
Browse files Browse the repository at this point in the history
Fix Who We Are section on mobile
  • Loading branch information
Satoshi-Sh authored Aug 24, 2023
2 parents d4464ad + 6cf80e7 commit ea1862a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Lower the file names of GitHub.svg, LikedIn.svg, and YouTube.svg.
- Fixed Google Analytics 4 Integration
- Fixed CHANGELOG.md inconsistency
- Fixed Who We Are section on mobile.
2 changes: 1 addition & 1 deletion components/containers/RevealContentContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useIntersect } from '@/hooks/useIntersect';
import S from './styles';

const RevealContentContainer = ({ children }) => {
const [ref, entry] = useIntersect({ threshold: 0.15 });
const [ref, entry] = useIntersect({});
const [firstLoad, setFirstLoad] = useState(true);
const [hiddenStyle, setHiddenStyle] = useState(true);

Expand Down
6 changes: 5 additions & 1 deletion hooks/useIntersect.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { useState, useEffect, useRef } from 'react';

export const useIntersect = ({ root = null, rootMargin, threshold = 0 }) => {
export const useIntersect = ({ root = null, rootMargin }) => {
const [entry, setEntry] = useState({});
const [node, setNode] = useState(null);

let observer = useRef(null);
const threshold = Array.from(
{ length: 20 },
(_, index) => 0.05 + index * 0.05
);

useEffect(() => {
observer = new window.IntersectionObserver(
Expand Down

0 comments on commit ea1862a

Please sign in to comment.