From bdbd84acc2477938640e4fb1628d66345da5e333 Mon Sep 17 00:00:00 2001 From: ArushKapoorJuspay <121166031+ArushKapoorJuspay@users.noreply.github.com> Date: Wed, 10 Apr 2024 16:02:21 +0530 Subject: [PATCH] fix: added support for Customization for PaymentMethodHeaderText (#283) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/BrutalTheme.res | 7 +++++++ src/CardTheme.res | 1 + src/CharcoalTheme.res | 7 +++++++ src/DefaultTheme.res | 7 +++++++ src/MidnightTheme.res | 7 +++++++ src/NoTheme.res | 9 +++++---- src/SoftTheme.res | 7 +++++++ src/Types/CardThemeType.res | 1 + 8 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/BrutalTheme.res b/src/BrutalTheme.res index 2059bacfd..c0a8ee962 100644 --- a/src/BrutalTheme.res +++ b/src/BrutalTheme.res @@ -16,6 +16,7 @@ let brutal = { fontWeightMedium: "700", fontWeightBold: "800", fontLineHeight: "", + fontSize2Xl: "24px", fontSizeXl: "16px", fontSizeLg: "14px", fontSizeSm: "12px", @@ -173,6 +174,12 @@ let brutalRules = (theme: CardThemeType.themeClass) => "borderTopColor": "transparent !important", "borderLeftColor": "transparent !important", }, + ".PaymentMethodsHeaderLabel": { + "color": theme.colorText, + "fontSize": theme.fontSize2Xl, + "fontWeight": theme.fontWeightMedium, + "marginBottom": "1.5rem", + }, }->Identity.anyTypeToJson let default = brutal diff --git a/src/CardTheme.res b/src/CardTheme.res index 25245d06f..77294fe31 100644 --- a/src/CardTheme.res +++ b/src/CardTheme.res @@ -175,6 +175,7 @@ let getVariables = (str, dict, default, logger) => { ), fontWeightBold: getWarningString(json, "fontWeightBold", default.fontWeightBold, ~logger), fontLineHeight: getWarningString(json, "fontLineHeight", default.fontLineHeight, ~logger), + fontSize2Xl: getWarningString(json, "fontSize2Xl", default.fontSize2Xl, ~logger), fontSizeXl: getWarningString(json, "fontSizeXl", default.fontSizeXl, ~logger), fontSizeLg: getWarningString(json, "fontSizeLg", default.fontSizeLg, ~logger), fontSizeSm: getWarningString(json, "fontSizeSm", default.fontSizeSm, ~logger), diff --git a/src/CharcoalTheme.res b/src/CharcoalTheme.res index 172a0bb61..046db3d66 100644 --- a/src/CharcoalTheme.res +++ b/src/CharcoalTheme.res @@ -16,6 +16,7 @@ let charcoal = { fontWeightMedium: "600", fontWeightBold: "700", fontLineHeight: "", + fontSize2Xl: "24px", fontSizeXl: "16px", fontSizeLg: "14px", fontSizeSm: "12px", @@ -173,6 +174,12 @@ let charcoalRules = theme => "fontWeight": theme.fontWeightLight, "fontSize": theme.fontSizeLg, }, + ".PaymentMethodsHeaderLabel": { + "color": theme.colorText, + "fontSize": theme.fontSize2Xl, + "fontWeight": theme.fontWeightMedium, + "marginBottom": "1.5rem", + }, }->Identity.anyTypeToJson let default = charcoal diff --git a/src/DefaultTheme.res b/src/DefaultTheme.res index 791bf7070..fcc9dd0e0 100644 --- a/src/DefaultTheme.res +++ b/src/DefaultTheme.res @@ -16,6 +16,7 @@ let default = { fontWeightMedium: "600", fontWeightBold: "700", fontLineHeight: "", + fontSize2Xl: "24px", fontSizeXl: "16px", fontSizeLg: "14px", fontSizeSm: "12px", @@ -185,6 +186,12 @@ let defaultRules = theme => "fontWeight": theme.fontWeightLight, "fontSize": theme.fontSizeLg, }, + ".PaymentMethodsHeaderLabel": { + "color": theme.colorText, + "fontSize": theme.fontSize2Xl, + "fontWeight": theme.fontWeightMedium, + "marginBottom": "1.5rem", + }, }->Identity.anyTypeToJson let default = default diff --git a/src/MidnightTheme.res b/src/MidnightTheme.res index 6c897f34f..0a9a3cab5 100644 --- a/src/MidnightTheme.res +++ b/src/MidnightTheme.res @@ -16,6 +16,7 @@ let midnight = { fontWeightMedium: "600", fontWeightBold: "700", fontLineHeight: "", + fontSize2Xl: "24px", fontSizeXl: "16px", fontSizeLg: "14px", fontSizeSm: "12px", @@ -194,6 +195,12 @@ let midnightRules = theme => "fontWeight": theme.fontWeightLight, "fontSize": theme.fontSizeLg, }, + ".PaymentMethodsHeaderLabel": { + "color": theme.colorText, + "fontSize": theme.fontSize2Xl, + "fontWeight": theme.fontWeightMedium, + "marginBottom": "1.5rem", + }, }->Identity.anyTypeToJson let default = midnight diff --git a/src/NoTheme.res b/src/NoTheme.res index cc543b9c8..7b97da3c8 100644 --- a/src/NoTheme.res +++ b/src/NoTheme.res @@ -1,6 +1,6 @@ open CardThemeType -let nakedValues = { +let noThemeValues = { fontFamily: "", fontSizeBase: "1rem", colorPrimary: "", @@ -17,6 +17,7 @@ let nakedValues = { fontWeightMedium: "", fontWeightBold: "", fontLineHeight: "", + fontSize2Xl: "", fontSizeXl: "", fontSizeLg: "", fontSizeSm: "", @@ -49,7 +50,7 @@ let nakedValues = { buttonTextFontWeight: "500", } -let nakedValuesRules = _ => Dict.make()->JSON.Encode.object +let noThemeValuesRules = _ => Dict.make()->JSON.Encode.object -let default = nakedValues -let defaultRules = nakedValuesRules +let default = noThemeValues +let defaultRules = noThemeValuesRules diff --git a/src/SoftTheme.res b/src/SoftTheme.res index 4dc0e534a..8ddde7962 100644 --- a/src/SoftTheme.res +++ b/src/SoftTheme.res @@ -17,6 +17,7 @@ let soft = { fontWeightMedium: "600", fontWeightBold: "700", fontLineHeight: "", + fontSize2Xl: "24px", fontSizeXl: "16px", fontSizeLg: "14px", fontSizeSm: "12px", @@ -180,6 +181,12 @@ let softRules = theme => "fontWeight": theme.fontWeightLight, "fontSize": theme.fontSizeLg, }, + ".PaymentMethodsHeaderLabel": { + "color": theme.colorText, + "fontSize": theme.fontSize2Xl, + "fontWeight": theme.fontWeightMedium, + "marginBottom": "1.5rem", + }, }->Identity.anyTypeToJson let default = soft diff --git a/src/Types/CardThemeType.res b/src/Types/CardThemeType.res index 633a94650..7001fcba4 100644 --- a/src/Types/CardThemeType.res +++ b/src/Types/CardThemeType.res @@ -27,6 +27,7 @@ type themeClass = { fontWeightMedium: string, fontWeightBold: string, fontLineHeight: string, + fontSize2Xl: string, fontSizeXl: string, fontSizeLg: string, fontSizeSm: string,