Skip to content

The open alternative to Salesforce, designed for AI.

fix(billing): wrap modal action buttons in flex slots instead of a child selector (#26136)

Etiennecd4911338e3f
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx
index c55d4ee6b7c..6ed5f8d23c9 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx
@@ -41,10 +41,10 @@ const StyledModalActions = styled.div`
display: flex;
gap: ${themeCssVariables.spacing[2]};
margin-top: ${themeCssVariables.spacing[6]};
+`;
- > div {
- flex: 1;
- }
+const StyledActionSlot = styled.div`
+ flex: 1;
`;
export const SettingsAdminWorkspaceCreditGrantModal = ({
@@ -209,18 +209,22 @@ export const SettingsAdminWorkspaceCreditGrantModal = ({
</StyledFields>
<StyledModalActions>
- <Button
- onClick={handleClose}
- fullWidth
- variant="outline"
- >{t`Cancel`}</Button>
- <Button
- onClick={handleSubmit}
- disabled={!isAmountValid || loading}
- fullWidth
- variant="solid"
- color="accent"
- >{t`Grant`}</Button>
+ <StyledActionSlot>
+ <Button
+ onClick={handleClose}
+ fullWidth
+ variant="outline"
+ >{t`Cancel`}</Button>
+ </StyledActionSlot>
+ <StyledActionSlot>
+ <Button
+ onClick={handleSubmit}
+ fullWidth
+ disabled={!isAmountValid || loading}
+ variant="solid"
+ color="accent"
+ >{t`Grant`}</Button>
+ </StyledActionSlot>
</StyledModalActions>
</ModalStatefulWrapper>
);
diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx
index 1d39060b833..7675e891397 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx
@@ -172,10 +172,10 @@ const StyledModalActions = styled.div`
display: flex;
gap: ${themeCssVariables.spacing[2]};
margin-top: ${themeCssVariables.spacing[6]};
+`;
- > div {
- flex: 1;
- }
+const StyledActionSlot = styled.div`
+ flex: 1;
`;
const PackageSummaryLabelText = ({ label }: { label: string }) => (
@@ -403,18 +403,22 @@ export const ResourceCreditPackagePickerModal = ({
</StyledPackageDetails>
</StyledPackageCard>
<StyledModalActions>
- <Button
- onClick={onCancel}
- fullWidth
- variant="outline"
- >{t`Cancel`}</Button>
- <Button
- onClick={onConfirm}
- fullWidth
- disabled={isConfirmDisabled}
- variant="solid"
- color="accent"
- >{t`Confirm`}</Button>
+ <StyledActionSlot>
+ <Button
+ onClick={onCancel}
+ fullWidth
+ variant="outline"
+ >{t`Cancel`}</Button>
+ </StyledActionSlot>
+ <StyledActionSlot>
+ <Button
+ onClick={onConfirm}
+ fullWidth
+ disabled={isConfirmDisabled}
+ variant="solid"
+ color="accent"
+ >{t`Confirm`}</Button>
+ </StyledActionSlot>
</StyledModalActions>
</ModalStatefulWrapper>
);