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

Sticky header #466

Merged
merged 7 commits into from Jun 9, 2023
Merged

Sticky header #466

merged 7 commits into from Jun 9, 2023

Conversation

buberdds
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented May 30, 2023

Deployed to Cloudflare Pages

Latest commit: 56fc8ccb72dc04ae3db3e9332bff8e8936ac8eee
Status:✅ Deploy successful!
Preview URL: https://319389f1.oasis-explorer.pages.dev

@csillag
Copy link
Contributor

csillag commented May 30, 2023

I tested this and it works great, but I'm a bit concerned by the fact that the composition of the components is different on desktop and mobile. (Ie. the search is included in PageLayou on desktop, but in Header on mobile.)

While I see why this might have been the most natural way to implement this now from a technical point of view, I am concerned that maintaining this in the future might be difficult and error prone, because there are too many variations.

Wouldn't it be possible to avoid this fundamental difference between desktop and mobile, somehow?

@lukaw3d lukaw3d added the p0 High priority label Jun 8, 2023
@@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next'

interface LogotypeProps {
color?: string
showText: boolean
showText?: true | false | undefined // If undefined: shows text on desktop
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need both the question mark and the undefined value? Seems a bit redundant...

Copy link
Member

Choose a reason for hiding this comment

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

Nope

Copy link
Member

Choose a reason for hiding this comment

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

This needs a different solution

  showText?: true | false | undefined // If undefined: shows text on desktop
  ...
export const Logotype: FC<LogotypeProps> = ({ color, showText = true }) => {
  ...
  const showTypography = showText ?? !isMobile

never results in ?? !isMobile executing

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we don't need the default value here: showText = true

Other than that, it should be fine....

@lukaw3d
Copy link
Member

lukaw3d commented Jun 9, 2023

Rebased and split commits

@csillag
Copy link
Contributor

csillag commented Jun 9, 2023

lukaw3d approved these changes 2 minutes ago

I think since @buberdds is not around ATM, we should just merge this, now that it's approved.

@lukaw3d lukaw3d merged commit cffc372 into master Jun 9, 2023
6 checks passed
@lukaw3d lukaw3d deleted the mz/sticky branch June 9, 2023 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0 High priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants