Skip to content

Commit

Permalink
fix: added support for Customization for PaymentMethodHeaderText
Browse files Browse the repository at this point in the history
  • Loading branch information
ArushKapoorJuspay committed Apr 10, 2024
1 parent ce71d4b commit 7bb4544
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/BrutalTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let brutal = {
fontWeightMedium: "700",
fontWeightBold: "800",
fontLineHeight: "",
fontSize2Xl: "24px",
fontSizeXl: "16px",
fontSizeLg: "14px",
fontSizeSm: "12px",
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/CardTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
7 changes: 7 additions & 0 deletions src/CharcoalTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let charcoal = {
fontWeightMedium: "600",
fontWeightBold: "700",
fontLineHeight: "",
fontSize2Xl: "24px",
fontSizeXl: "16px",
fontSizeLg: "14px",
fontSizeSm: "12px",
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/DefaultTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let default = {
fontWeightMedium: "600",
fontWeightBold: "700",
fontLineHeight: "",
fontSize2Xl: "24px",
fontSizeXl: "16px",
fontSizeLg: "14px",
fontSizeSm: "12px",
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/MidnightTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let midnight = {
fontWeightMedium: "600",
fontWeightBold: "700",
fontLineHeight: "",
fontSize2Xl: "24px",
fontSizeXl: "16px",
fontSizeLg: "14px",
fontSizeSm: "12px",
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions src/NoTheme.res
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open CardThemeType

let nakedValues = {
let noThemeValues = {
fontFamily: "",
fontSizeBase: "1rem",
colorPrimary: "",
Expand All @@ -17,6 +17,7 @@ let nakedValues = {
fontWeightMedium: "",
fontWeightBold: "",
fontLineHeight: "",
fontSize2Xl: "",
fontSizeXl: "",
fontSizeLg: "",
fontSizeSm: "",
Expand Down Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/SoftTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ let soft = {
fontWeightMedium: "600",
fontWeightBold: "700",
fontLineHeight: "",
fontSize2Xl: "24px",
fontSizeXl: "16px",
fontSizeLg: "14px",
fontSizeSm: "12px",
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Types/CardThemeType.res
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type themeClass = {
fontWeightMedium: string,
fontWeightBold: string,
fontLineHeight: string,
fontSize2Xl: string,
fontSizeXl: string,
fontSizeLg: string,
fontSizeSm: string,
Expand Down

0 comments on commit 7bb4544

Please sign in to comment.