Skip to content

Commit dd1a773

Browse files
Merge pull request #251 from Web-Dev-Path/refactor/to-scss-RevealContentContainer
Refactor/to-scss-reveal-content-container
2 parents 5bf969a + e6e9f24 commit dd1a773

4 files changed

Lines changed: 21 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
164164
- SubmitButton
165165
- AuthorBio
166166
- BlogPostsContainer
167+
- RevealContentContainer
167168
- Updated ContactUsForm's checkbox wrapper from div to label to enhance its accessibility
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@use '@/styles/mixins' as *;
2+
3+
.sectionHidden {
4+
opacity: 0;
5+
transform: translateY(8rem);
6+
}
7+
8+
.revealContainerWrapper {
9+
@include transition(transform 1s, opacity 1s);
10+
}

components/containers/RevealContentContainer/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState } from 'react';
22
import { useIntersect } from '@/hooks/useIntersect';
3-
import S from './styles';
3+
import styles from './RevealContentContainer.module.scss';
44

55
const RevealContentContainer = ({ children }) => {
66
const [ref, entry] = useIntersect({});
@@ -15,9 +15,16 @@ const RevealContentContainer = ({ children }) => {
1515
}, [entry.isIntersecting]);
1616

1717
return (
18-
<S.RevealContainerWrapper ref={ref} $hiddenStyle={hiddenStyle}>
18+
<div
19+
ref={ref}
20+
className={
21+
hiddenStyle
22+
? `${styles.revealContainerWrapper} ${styles.sectionHidden}`
23+
: styles.revealContainerWrapper
24+
}
25+
>
1926
{children}
20-
</S.RevealContainerWrapper>
27+
</div>
2128
);
2229
};
2330

components/containers/RevealContentContainer/styles.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)