Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

large size => fullWidth

Manav Rathi0f1a6a29fef9
diff --git a/web/packages/new/photos/components/PlanSelector.tsx b/web/packages/new/photos/components/PlanSelector.tsx
index dc1e2da341..d9ea1377bc 100644
--- a/web/packages/new/photos/components/PlanSelector.tsx
+++ b/web/packages/new/photos/components/PlanSelector.tsx
@@ -1,3 +1,5 @@
+import type { ButtonishProps } from "@/base/components/mui";
+import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
import {
errorDialogAttributes,
genericRetriableErrorDialogAttributes,
@@ -548,7 +550,7 @@ const PlanRow: React.FC<PlanRowProps> = ({ plan, onPlanSelect, disabled }) => {
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
}}
- size="large"
+ fullWidth
onClick={handleClick}
>
<Box sx={{ textAlign: "right" }}>
@@ -682,10 +684,7 @@ function ManageSubscription({
{...{ onClose, subscription, hasAddOnBonus }}
/>
)}
- <ManageSubscriptionButton
- color="secondary"
- onClick={openFamilyPortal}
- >
+ <ManageSubscriptionButton onClick={openFamilyPortal}>
{t("manage_family")}
</ManageSubscriptionButton>
</Stack>
@@ -763,35 +762,30 @@ const StripeSubscriptionOptions: React.FC<StripeSubscriptionOptionsProps> = ({
return (
<>
{isSubscriptionCancelled(subscription) ? (
- <ManageSubscriptionButton
- color="secondary"
- onClick={confirmReactivation}
- >
+ <ManageSubscriptionButton onClick={confirmReactivation}>
{t("reactivate_subscription")}
</ManageSubscriptionButton>
) : (
- <ManageSubscriptionButton
- color="secondary"
- onClick={confirmCancel}
- >
+ <ManageSubscriptionButton onClick={confirmCancel}>
{t("cancel_subscription")}
</ManageSubscriptionButton>
)}
- <ManageSubscriptionButton
- color="secondary"
- onClick={handleManageClick}
- >
+ <ManageSubscriptionButton onClick={handleManageClick}>
{t("manage_payment_method")}
</ManageSubscriptionButton>
</>
);
};
-const ManageSubscriptionButton: React.FC<ButtonProps> = ({
- children,
- ...props
-}) => (
- <Button size="large" endIcon={<ChevronRightIcon />} {...props}>
- <FluidContainer>{children}</FluidContainer>
- </Button>
+const ManageSubscriptionButton: React.FC<
+ React.PropsWithChildren<ButtonishProps>
+> = ({ onClick, children }) => (
+ <FocusVisibleButton
+ fullWidth
+ color="secondary"
+ endIcon={<ChevronRightIcon />}
+ {...{ onClick }}
+ >
+ <Box sx={{ flex: 1, textAlign: "left" }}>{children}</Box>
+ </FocusVisibleButton>
);
diff --git a/web/packages/shared/themes/components.ts b/web/packages/shared/themes/components.ts
index 06a329004b..dfd7728dea 100644
--- a/web/packages/shared/themes/components.ts
+++ b/web/packages/shared/themes/components.ts
@@ -121,6 +121,9 @@ export const getComponents = (
variant: "contained",
},
styleOverrides: {
+ // We don't use the size prop for the MUI button, or rather it
+ // cannot be used, since we have fixed the paddings and font sizes
+ // unconditionally here (which are all that the size prop changes).
root: {
padding: "12px 16px",
borderRadius: "4px",