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

Purchase Settings: Update manage-purchase__header styles for better wrapping #99319

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Refactor manage-purchase__* classes with flexbox
  • Loading branch information
jjchrisdiehl committed Feb 5, 2025
commit 1a7ae60ba380c9a67ebe50bc04c25e12d6c46ca4
16 changes: 8 additions & 8 deletions client/me/purchases/manage-purchase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ class ManagePurchase extends Component<
<Card className={ classes }>
<header className="manage-purchase__header">
{ this.renderPurchaseIcon() }
<div>
<div className="manage-purchase__header-content">
<h2 className="manage-purchase__title">{ this.getProductDisplayName() }</h2>
<div className="manage-purchase__description">
{ isHundredYearDomain
Expand Down Expand Up @@ -1331,6 +1331,13 @@ class ManagePurchase extends Component<
) }
</div>
</div>
{ isProductOwner && ! purchase.isLocked && (
<div className="manage-purchase__renew-upgrade-buttons">
{ preventRenewal && this.renderSelectNewButton() }
{ this.renderUpgradeButton( preventRenewal ) }
{ ! preventRenewal && this.renderRenewButton() }
</div>
) }
</header>
{ this.renderPurchaseDescription() }
{ ! isPartnerPurchase( purchase ) && (
Expand All @@ -1344,13 +1351,6 @@ class ManagePurchase extends Component<
}
/>
) }
{ isProductOwner && ! purchase.isLocked && (
<div className="manage-purchase__renew-upgrade-buttons">
{ preventRenewal && this.renderSelectNewButton() }
{ this.renderUpgradeButton( preventRenewal ) }
{ ! preventRenewal && this.renderRenewButton() }
</div>
) }
</Card>
{ ! isPartnerPurchase( purchase ) && (
<PurchasePlanDetails
Expand Down
30 changes: 14 additions & 16 deletions client/me/purchases/manage-purchase/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@
.manage-purchase__header,
.manage-purchase__content {
padding: 16px 24px;
word-wrap: break-word;
overflow-wrap: break-word;

@include breakpoint-deprecated( "<660px" ) {
padding: 16px;
overflow-wrap: break-word;
flex-direction: column;
}
}
Expand All @@ -138,9 +139,14 @@
}

.manage-purchase__header {
overflow: auto;
border-bottom: 2px solid var(--color-accent);
display: flex;
gap: .75rem;

&-content {
flex: 1 1 auto;
min-width: 0;
}

.is-personal & {
border-bottom: 2px solid var(--color-plan-personal);
Expand All @@ -160,10 +166,8 @@
}

.manage-purchase__plan-icon {
margin: 0 12px 0 0;
max-width: 56px;
width: 56px;
float: left;

.gridicon {
box-sizing: border-box;
Expand Down Expand Up @@ -202,7 +206,6 @@

@include breakpoint-deprecated( ">660px" ) {
font-size: $font-title-small;
padding-right: 100px;
}
}

Expand Down Expand Up @@ -395,21 +398,16 @@
}

.manage-purchase__renew-upgrade-buttons {
display: none;
display: flex; /* Ensures button expands */
flex-shrink: 0;

@include breakpoint-deprecated( ">660px" ) {
display: initial;
position: absolute;
right: 24px;
top: 16px;
align-self: flex-start;
margin-inline-start: auto;

> a,
> button {
margin-inline-end: 8px;

&:last-child {
margin-inline-end: initial;
}
flex-grow: 1; /* Ensures button expands based on its text */
white-space: nowrap;
}
}
}
Expand Down