Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added support for Customization for PaymentMethodHeaderText #283

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading