-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ch/design tweak test #459
Ch/design tweak test #459
Conversation
</aside> | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you tracked the current section as component state? It could default to 0
. Instead of manually assigning the class, you could make line 45 read like:
className={section === this.state.current ? '-active' : ''}
Then you avoid needing to select the elements on initial render too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, I was able to use a state prop that already existed 👍🏼
@@ -57,9 +58,10 @@ export default class IndexPage extends React.Component { | |||
onIntersection = observed => { | |||
let entry = observed[0] | |||
let section = parseInt(entry.target.dataset.section) | |||
let isIntersecting = entry.intersectionRatio >= 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the 1.0
here the same threshold as observeOptions.threshold
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I will save that in a var
Codecov Report
@@ Coverage Diff @@
## master #459 +/- ##
===========================================
- Coverage 93.19% 73.68% -19.52%
===========================================
Files 29 44 +15
Lines 1029 1368 +339
Branches 197 255 +58
===========================================
+ Hits 959 1008 +49
- Misses 59 295 +236
- Partials 11 65 +54
Continue to review full report at Codecov.
|
…ange color as well
f5c06dc
to
94e8983
Compare
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
If yes, please describe the impact and migration path for existing applications:
Does this PR fulfill these requirements:
yarn pretty
has been runAdditional Information