Skip to content

Remove GetFirefoxCallout as it totally breaks the layout and is absolutely not worth it. #13725

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/amo/components/GetFirefoxButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,6 @@ export const GetFirefoxButtonBase = ({
const buttonText = supportsRTAMO
? downloadTextForRTAMO
: i18n.gettext('Download Firefox');
let calloutText =
addon.type === ADDON_TYPE_STATIC_THEME
? i18n.gettext(`You'll need Firefox to use this theme`)
: i18n.gettext(`You'll need Firefox to use this extension`);
if (forIncompatibleAddon) {
calloutText =
addon.type === ADDON_TYPE_STATIC_THEME
? i18n.gettext('You need an updated version of Firefox for this theme')
: i18n.gettext(
'You need an updated version of Firefox for this extension',
);
}

const buttonContent = (
<Button
Expand All @@ -181,10 +169,6 @@ export const GetFirefoxButtonBase = ({

return (
<div className={makeClassName('GetFirefoxButton', className)}>
<div className="GetFirefoxButton-callout">
<div className="GetFirefoxButton-callout-icon" />
<div className="GetFirefoxButton-callout-text">{calloutText}</div>
</div>
{buttonContent}
</div>
);
Expand Down
57 changes: 8 additions & 49 deletions src/amo/components/GetFirefoxButton/styles.scss
Original file line number Diff line number Diff line change
@@ -1,57 +1,16 @@
@import '~amo/css/styles';

$callout-color: $yellow-50;

.GetFirefoxButton-button {
display: flex;
margin: auto;
white-space: nowrap;
width: 100%;
background: #ffe900;
// Button.tsx defines classes that override this color, so we need to use !important
color: black !important;

@include respond-to(medium) {
align-self: flex-end;
margin-bottom: 12px;
margin-top: 0;
width: fit-content;
@include respond-to(extraLarge) {
text-wrap: nowrap;
}
}

.GetFirefoxButton-callout {
background-color: $callout-color;
border: 1px solid $callout-color;
border-radius: 4px;
color: $grey-90;
display: flex;
justify-content: center;
margin: 16px 0;
padding: 10px;
position: relative;
text-align: center;
width: 100%;

@include respond-to(medium) {
margin: 16px auto;
width: fit-content;
}

&::before {
border: 0.8em solid transparent;
border-top: 10px solid $callout-color;
bottom: -20px;
content: '';
height: 0;
left: 45%;
position: absolute;
width: 0;
}
}

.GetFirefoxButton-callout-icon {
@include margin-end(4px);

background-image: url('../Notice/img/generic-info-mark.svg');
height: 16px;
margin: 2px 0 0;
min-width: 16px;
width: 16px;
text-wrap: wrap;
text-align: center;
padding: 12px 18px;
}
24 changes: 0 additions & 24 deletions src/amo/components/InstallButtonWrapper/styles.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
@import '~amo/css/styles';

.InstallButtonWrapper {
display: flex;
flex-direction: column;

.GetFirefoxButton {
display: flex;
flex-direction: column;

.GetFirefoxButton-button,
.GetFirefoxButton-callout {
max-width: 100%;
text-align: center;
white-space: initial;
width: 100%;
}

@include respond-to(extraLarge) {
.GetFirefoxButton-button {
white-space: nowrap;
}
}
}
}

.InstallButtonWrapper-download {
margin: 12px 0;

Expand Down
10 changes: 0 additions & 10 deletions src/blog-utils/StaticAddonCard/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,10 @@ $icon-size: 48px;
text-align: center;
width: 100%;

&,
.GetFirefoxButton-button,
.GetFirefoxButton-callout {
box-sizing: border-box;
}

.GetFirefoxButton-button {
margin-bottom: 0;
}

.GetFirefoxButton-callout {
margin-top: 0;
}

@include respond-to(medium) {
margin-top: 10px;
}
Expand Down
40 changes: 0 additions & 40 deletions tests/unit/amo/components/TestInstallButtonWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,46 +635,6 @@ describe(__filename, () => {
).toBeInTheDocument();
});

it('has the expected callout text for an extension', () => {
render();

expect(
screen.getByText(`You'll need Firefox to use this extension`),
).toBeInTheDocument();
});

it('has the expected callout text for an extension, which is incompatible', () => {
renderAsIncompatible();

expect(
screen.getByText(
'You need an updated version of Firefox for this extension',
),
).toBeInTheDocument();
});

it('has the expected callout text for a theme', () => {
addon.type = ADDON_TYPE_STATIC_THEME;

render();

expect(
screen.getByText(`You'll need Firefox to use this theme`),
).toBeInTheDocument();
});

it('has the expected callout text for a theme, which is incompatible', () => {
addon.type = ADDON_TYPE_STATIC_THEME;

renderAsIncompatible();

expect(
screen.getByText(
'You need an updated version of Firefox for this theme',
),
).toBeInTheDocument();
});

it('sends a tracking event when the button is clicked', async () => {
render();

Expand Down
1 change: 0 additions & 1 deletion tests/unit/blog-utils/test_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ describe(__filename, () => {
expect(html('.StaticAddonCard')).toHaveLength(1);
expect(html('.GetFirefoxButton')).toHaveLength(1);
expect(html('.GetFirefoxButton-button')).toHaveLength(1);
expect(html('.GetFirefoxButton-callout')).toHaveLength(1);
});

it('lets the caller catch and handle errors', async () => {
Expand Down