Skip to content
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

Keep date visible on scrollytelling maps #424

Merged
merged 2 commits into from Jan 16, 2023

Conversation

danielfdsilva
Copy link
Collaborator

Ensures that the date remains visible by changing the scrollytelling block offset when the header is visible #376

@netlify
Copy link

netlify bot commented Jan 13, 2023

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 091609b
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/63c5255a99cdd4000819e10b
😎 Deploy Preview https://deploy-preview-424--veda-ui.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@aboydnw aboydnw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality-wise, looks good to me 👍

Copy link
Contributor

@nerik nerik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -37,6 +36,8 @@ import { MapLoading } from '$components/common/loading-skeleton';
import { HintedError } from '$utils/hinted-error';
import { formatSingleDate } from '$components/common/mapbox/utils';
import { convertProjectionToMapbox } from '$components/common/mapbox/projection-selector/utils';
import { useSlidingStickyHeaderProps } from '$components/common/layout-root';
import { HERO_TRANSITION_DURATION } from '$components/analysis/page-hero-analysis';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this const should not live under /analytics/ anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nerik Addressed :)

top: 4rem;
${({ topOffset }) => css`
top: ${topOffset}px;
height: calc(100vh - ${topOffset}px);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that the equivalent of the following?:

top: ${({ topOffset }) => topOffset}px;
height: calc(100vh - ${({ topOffset }) => topOffset}px);

Not saying it's any better, but the styled components doc makes it confusing to me

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Absolutely the same, but I prefer the other approach.
I like that within a styled-component the functions return css. In this way I could extract all that into a separate function if needed. For me this approach also makes it more readable.

@danielfdsilva danielfdsilva merged commit 44a0889 into main Jan 16, 2023
@danielfdsilva danielfdsilva deleted the feature/376-scrollytelling-date branch January 16, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants