Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] Support custom subscription button typography

r4khul300102074f8a
diff --git a/mobile/packages/ente_components/lib/components/buttons/button_component.dart b/mobile/packages/ente_components/lib/components/buttons/button_component.dart
index c45080220f..2bf86dc492 100644
--- a/mobile/packages/ente_components/lib/components/buttons/button_component.dart
+++ b/mobile/packages/ente_components/lib/components/buttons/button_component.dart
@@ -40,6 +40,7 @@ class ButtonComponent extends StatefulWidget {
this.shouldShowSuccessConfirmation = false,
this.progressStatus,
this.leading,
+ this.labelStyle,
this.dismissModalOnSuccess = false,
});
@@ -54,6 +55,7 @@ class ButtonComponent extends StatefulWidget {
final bool shouldShowSuccessConfirmation;
final ValueListenable<String>? progressStatus;
final Widget? leading;
+ final TextStyle? labelStyle;
// Only popup routes such as dialogs and sheets are dismissed.
final bool dismissModalOnSuccess;
@@ -240,9 +242,11 @@ class _ButtonComponentState extends State<ButtonComponent>
final underlined =
widget.variant == ButtonComponentVariant.link ||
widget.variant == ButtonComponentVariant.tertiaryCritical;
- final labelStyle = widget.density == ButtonComponentDensity.compact
- ? TextStyles.body
- : TextStyles.bodyBold;
+ final labelStyle =
+ widget.labelStyle ??
+ (widget.density == ButtonComponentDensity.compact
+ ? TextStyles.body
+ : TextStyles.bodyBold);
final label = Text(
widget.label,
overflow: TextOverflow.ellipsis,