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

Chore/yoext 940/eliminate warnings #3365

Merged
merged 16 commits into from
Dec 15, 2023

Conversation

yushih
Copy link
Collaborator

@yushih yushih commented Dec 11, 2023

Many warnings are due to block elements nested inside <p>. So replace<p> by <div>. Also add component="div" to <Typography> to avoid generating <p>.

@neuodev
Copy link
Contributor

neuodev commented Dec 11, 2023

[autoscirpt] Jira Ticket: Get rid of some console warnings

@Nebyt Nebyt requested a review from nistadev December 11, 2023 11:15
Copy link
Contributor

@nistadev nistadev left a comment

Choose a reason for hiding this comment

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

Overall looks good, nothing critical. I would use span instead of div on Typoghaphy components tho.

@@ -163,17 +163,17 @@ class NightlyForm extends Component<Props & InjectedLayoutProps, State> {
pl: '4px',
}}
>
<Typography component="li" variant="body1" lineHeight="24px">
<Typography component="div" component="li" variant="body1" lineHeight="24px">
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove component="div" since we have another component defined.

{intl.formatMessage(messages.warning1)}
</Typography>
<Typography component="li" variant="body1" lineHeight="24px">
<Typography component="div" component="li" variant="body1" lineHeight="24px">
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove component="div" since we have another component defined.

@@ -183,10 +183,10 @@ class NightlyForm extends Component<Props & InjectedLayoutProps, State> {
pl: '4px',
}}
>
<Typography component="li" variant="body1" lineHeight="24px">
<Typography component="div" component="li" variant="body1" lineHeight="24px">
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove component="div" since we have another component defined.

{intl.formatMessage(messages.recommendation1)}
</Typography>
<Typography component="li" variant="body1" lineHeight="24px">
<Typography component="div" component="li" variant="body1" lineHeight="24px">
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove component="div" since we have another component defined.

@@ -102,7 +102,7 @@ class SupportSettings extends Component<Props & InjectedProps> {
return (
<Box>
{isRevampLayout && (
<Typography component="h5" variant="h5" mb="24px" color="common.black" fontWeight={500}>
<Typography component="div" component="h5" variant="h5" mb="24px" color="common.black" fontWeight={500}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove component="div" since we have another component defined.

@@ -314,7 +314,7 @@ export default class TransactionRevamp extends Component<Props, State> {
|}) => Node = request => {
if (request.type === transactionTypes.INCOME) {
return (
<Typography as="span" fontSize="inherit">
<Typography component="div" as="span" fontSize="inherit">
Copy link
Contributor

Choose a reason for hiding this comment

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

Use rather component="div" or span.

@@ -176,7 +176,7 @@ class UtxoDetails extends Component<Props> {
light
linkType="address"
>
<Typography as="span" color="var(--yoroi-palette-gray-600)">
<Typography component="div" as="span" color="var(--yoroi-palette-gray-600)">
Copy link
Contributor

Choose a reason for hiding this comment

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

Use rather component="div" or span.

@@ -157,7 +157,7 @@ class CardanoUtxoDetails extends Component<Props> {
light
linkType="address"
>
<Typography as="span" color="#242838">
<Typography component="div" as="span" color="#242838">
Copy link
Contributor

Choose a reason for hiding this comment

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

Use rather component="div" or span.

@@ -116,7 +116,7 @@ export class RevampAnnouncementDialog extends Component<Props> {
}}
>
{[messages.update1, messages.update2, messages.update3].map(message => (
<Typography component="li" variant="body1" color="grayscale.900">
<Typography component="div" component="li" variant="body1" color="grayscale.900">
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove component="div" since we have another component defined.

@@ -130,7 +130,7 @@ export class RevampAnnouncementDialog extends Component<Props> {
}}
>
{[messages.update4, messages.update5, messages.update6].map(message => (
<Typography component="li" variant="body1" color="grayscale.900">
<Typography component="div" component="li" variant="body1" color="grayscale.900">
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove component="div" since we have another component defined.

@yushih
Copy link
Collaborator Author

yushih commented Dec 12, 2023

@nistadev I added component="div" instead of "span" to <Typography that originally were rendered as <p> because <p> is a block element. If <p> is replaced by a <span> which is an inline element, the layout may be broken.

@yushih yushih requested a review from nistadev December 12, 2023 16:36
Nebyt
Nebyt previously approved these changes Dec 14, 2023
Copy link
Contributor

@Nebyt Nebyt left a comment

Choose a reason for hiding this comment

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

LGTM

…iminate-warnings

# Conflicts:
#	packages/yoroi-extension/app/components/wallet/send/WalletSendFormRevamp.js
#	packages/yoroi-extension/app/components/widgets/OpenInExplorer.js
#	packages/yoroi-extension/app/connector/components/signin/AddCollateralPage.js
#	packages/yoroi-extension/app/connector/components/signin/CardanoSignTxPage.js
#	packages/yoroi-extension/app/connector/components/signin/SignTxPage.js
#	packages/yoroi-extension/app/connector/components/signin/UtxoDetails.js
#	packages/yoroi-extension/app/connector/components/signin/cardano/ConnectionInfo.js
#	packages/yoroi-extension/app/connector/components/signin/cardano/SignTx.js
#	packages/yoroi-extension/app/connector/components/signin/cardano/SignTxSummary.js
Copy link
Contributor

@vsubhuman vsubhuman left a comment

Choose a reason for hiding this comment

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

/check

Copy link
Contributor

@vsubhuman vsubhuman left a comment

Choose a reason for hiding this comment

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

/check

Copy link
Contributor

@vsubhuman vsubhuman left a comment

Choose a reason for hiding this comment

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

/check

@sonarqube-yoroi
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vsubhuman vsubhuman merged commit 6f9f5a3 into develop Dec 15, 2023
3 checks passed
@vsubhuman vsubhuman deleted the chore/YOEXT-940/eliminate-warnings branch December 15, 2023 16:54
@vsubhuman vsubhuman mentioned this pull request Jan 22, 2024
24 tasks
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.

5 participants