-
Notifications
You must be signed in to change notification settings - Fork 21
fix(Logo): Fix layout shifts caused by logos (specially in navbar) #1520
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8565a46
WEB-2419: First refactor
Marcosld 96176f5
WEB-2419: Add comment about suspense wrapper
Marcosld d6fabe1
WEB-2419: Split logos in shell + svg to avoid layout shifts
Marcosld ffa1f62
WEB-2419: fix prettier
Marcosld fe82189
WEB-2419: Update screenshots
Marcosld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
+681 Bytes
(100%)
...shot-test-tsx-main-navigation-bar-inverse-with-large-menu-in-desktop-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+747 Bytes
(100%)
...sx-main-navigation-bar-with-large-menu-and-custom-content-in-desktop-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+735 Bytes
(100%)
...x-main-navigation-bar-with-large-menu-and-default-content-in-desktop-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import * as React from 'react'; | ||
| import * as styles from './logo.css'; | ||
| import {calcInlineVars} from './logo-common'; | ||
| import {applyCssVars} from './utils/css'; | ||
|
|
||
| import type {ByBreakpoint} from './utils/types'; | ||
| import type {LogoType} from './logo-common'; | ||
|
|
||
| type Props = { | ||
| size: ByBreakpoint<number>; | ||
| type: LogoType; | ||
| children: React.ReactNode; | ||
| }; | ||
|
|
||
| const BlauLogoShell = ({size, type, children}: Props): JSX.Element => { | ||
| const viewBox = type === 'imagotype' ? '0 0 138 72' : type === 'vertical' ? '0 0 73 72' : '0 0 72 72'; | ||
|
|
||
| return ( | ||
| <svg | ||
| className={styles.svg} | ||
| style={applyCssVars(calcInlineVars(size))} | ||
| viewBox={viewBox} | ||
| role="presentation" | ||
| > | ||
| {children} | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default BlauLogoShell; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import * as React from 'react'; | ||
| import * as styles from './logo.css'; | ||
| import {calcInlineVars} from './logo-common'; | ||
| import {applyCssVars} from './utils/css'; | ||
|
|
||
| import type {LogoType} from './logo-common'; | ||
| import type {ByBreakpoint} from './utils/types'; | ||
|
|
||
| type Props = { | ||
| size: ByBreakpoint<number>; | ||
| type: LogoType; | ||
| children: React.ReactNode; | ||
| }; | ||
|
|
||
| const EsimflagLogoShell = ({size, type, children}: Props): JSX.Element => { | ||
| const viewBox = type === 'imagotype' ? '0 0 195 72' : '0 0 72 72'; | ||
|
|
||
| return ( | ||
| <svg | ||
| className={styles.svg} | ||
| style={applyCssVars(calcInlineVars(size))} | ||
| viewBox={viewBox} | ||
| role="presentation" | ||
| > | ||
| {children} | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default EsimflagLogoShell; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import * as React from 'react'; | ||
| import * as styles from './logo.css'; | ||
| import {calcInlineVars} from './logo-common'; | ||
| import {applyCssVars} from './utils/css'; | ||
|
|
||
| import type {LogoType} from './logo-common'; | ||
| import type {ByBreakpoint} from './utils/types'; | ||
|
|
||
| type Props = { | ||
| size: ByBreakpoint<number>; | ||
| type: LogoType; | ||
| children: React.ReactNode; | ||
| }; | ||
|
|
||
| const MovistarNewLogoShell = ({size, type, children}: Props): JSX.Element => { | ||
| const viewBox = type === 'imagotype' ? '0 0 203 72' : '0 0 72 72'; | ||
|
|
||
| return ( | ||
| <svg | ||
| className={styles.svg} | ||
| style={applyCssVars(calcInlineVars(size))} | ||
| viewBox={viewBox} | ||
| role="presentation" | ||
| > | ||
| {children} | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default MovistarNewLogoShell; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
navbar buttons now have the correct hover color because there's no layout shift that causes the mouse to not be over the buttons.