diff --git a/src/components/Button.res b/src/components/Button.res index b253d6243..bbd63883b 100644 --- a/src/components/Button.res +++ b/src/components/Button.res @@ -48,7 +48,7 @@ let useGetBgColor = ( ~isPhoneDropdown=false, (), ) => { - let config = React.useContext(ConfigContext.configContext) + let config = React.useContext(ThemeProvider.themeContext) let buttonConfig = config.globalUIConfig.button.backgroundColor switch buttonType { | Primary => @@ -193,7 +193,7 @@ let useGetTextColor = ( ~isPhoneDropdown=false, (), ) => { - let config = React.useContext(ConfigContext.configContext) + let config = React.useContext(ThemeProvider.themeContext) let textConfig = config.globalUIConfig.button.textColor switch buttonType { | Primary => diff --git a/src/components/ButtonGroupIp.res b/src/components/ButtonGroupIp.res index 9ba093cb6..c4c58179d 100644 --- a/src/components/ButtonGroupIp.res +++ b/src/components/ButtonGroupIp.res @@ -8,7 +8,7 @@ let make = ( ~isSeparate=false, ~buttonSize=?, ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let onChange = str => input.onChange(str->Identity.stringToFormReactEvent) let buttonState = {isDisabled ? Button.Disabled : Button.Normal} diff --git a/src/components/Calendar.res b/src/components/Calendar.res index 481c44dc7..e810efb39 100644 --- a/src/components/Calendar.res +++ b/src/components/Calendar.res @@ -50,7 +50,7 @@ module TableRow = { ~allowedDateRange: option=?, ) => { open LogicUtils - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let customTimezoneToISOString = TimeZoneHook.useCustomTimeZoneToIsoString() let highlight = cellHighlighter diff --git a/src/components/CustomCharts/FunnelChart.res b/src/components/CustomCharts/FunnelChart.res index 2ab2e3e6e..29f564fc8 100644 --- a/src/components/CustomCharts/FunnelChart.res +++ b/src/components/CustomCharts/FunnelChart.res @@ -8,7 +8,7 @@ let make = ( ~moduleName, ~description, ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let isMobileView = MatchMedia.useMobileChecker() let (size, widthClass, flexDirectionClass) = React.useMemo1(() => { isMobileView ? (0.16, "w-full", "flex-col") : (size, "w-1/2", "flex-row") diff --git a/src/components/CustomCharts/HighchartBarChart.res b/src/components/CustomCharts/HighchartBarChart.res index 72cc7e441..b764e6cde 100644 --- a/src/components/CustomCharts/HighchartBarChart.res +++ b/src/components/CustomCharts/HighchartBarChart.res @@ -13,7 +13,7 @@ module HighBarChart1D = { ~isHrizonatalBar: bool=true, ~selectedMetrics: LineChartUtils.metricsConfig, ) => { - let (theme, _setTheme) = React.useContext(ThemeProvider.themeContext) + let {theme} = React.useContext(ThemeProvider.themeContext) let gridLineColor = switch theme { | Light => "#2e2f39" | Dark => "#e6e6e6" diff --git a/src/components/CustomCharts/HighchartHorizontalBarChart.res b/src/components/CustomCharts/HighchartHorizontalBarChart.res index fe416eba4..7a8fe2574 100644 --- a/src/components/CustomCharts/HighchartHorizontalBarChart.res +++ b/src/components/CustomCharts/HighchartHorizontalBarChart.res @@ -64,7 +64,7 @@ let make = ( ~titleKey=?, ~selectedMetrics: LineChartUtils.metricsConfig, ) => { - let (theme, _setTheme) = React.useContext(ThemeProvider.themeContext) + let {theme} = React.useContext(ThemeProvider.themeContext) let barChartData = React.useMemo3(() => { LineChartUtils.chartDataMaker( diff --git a/src/components/CustomCharts/HighchartPieChart.res b/src/components/CustomCharts/HighchartPieChart.res index 91935c52a..600dd1b65 100644 --- a/src/components/CustomCharts/HighchartPieChart.res +++ b/src/components/CustomCharts/HighchartPieChart.res @@ -31,7 +31,7 @@ let make = ( ~titleKey=?, ~selectedMetrics: LineChartUtils.metricsConfig, ) => { - let (theme, _setTheme) = React.useContext(ThemeProvider.themeContext) + let {theme} = React.useContext(ThemeProvider.themeContext) let pieSeriesData = React.useMemo3(() => { LineChartUtils.chartDataMaker( ~filterNull=true, diff --git a/src/components/CustomCharts/HighchartTimeSeriesChart.res b/src/components/CustomCharts/HighchartTimeSeriesChart.res index 8cfe11729..b3c5d7435 100644 --- a/src/components/CustomCharts/HighchartTimeSeriesChart.res +++ b/src/components/CustomCharts/HighchartTimeSeriesChart.res @@ -60,7 +60,7 @@ module LineChart1D = { ~comparitionWidget=false, ~selectedTab: option>=?, ) => { - let (theme, _setTheme) = React.useContext(ThemeProvider.themeContext) + let {theme} = React.useContext(ThemeProvider.themeContext) let (_, setLegendState) = React.useState(_ => []) let isMobileView = MatchMedia.useMobileChecker() let (hideLegend, setHideLegend) = React.useState(_ => isMobileView) diff --git a/src/components/DynamicFilter.res b/src/components/DynamicFilter.res index 24baf8b15..874d75dad 100644 --- a/src/components/DynamicFilter.res +++ b/src/components/DynamicFilter.res @@ -165,7 +165,7 @@ let make = ( ~refreshFilters=true, ) => { open LogicUtils - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let localFilters = initialFilters->Array.filter(item => item.localFilter->Option.isSome) let remoteOptions = options->Array.filter(item => item.localFilter->Option.isNone) let defaultFilters = ""->JSON.Encode.string diff --git a/src/components/FilterSelectBox.res b/src/components/FilterSelectBox.res index 8eb6d70e7..ddcce8353 100644 --- a/src/components/FilterSelectBox.res +++ b/src/components/FilterSelectBox.res @@ -62,7 +62,7 @@ module ListItem = { ~textEllipsisForDropDownOptions=false, ~textColorClass="", ) => { - let {globalUIConfig: {font}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font}} = React.useContext(ThemeProvider.themeContext) let labelText = switch labelValue->String.length { | 0 => text | _ => labelValue @@ -461,7 +461,7 @@ module BaseSelect = { ~preservedAppliedOptions=[], ) => { let customSearchStyle = "bg-white p-2 border-b-2" - let {globalUIConfig: {font}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font}} = React.useContext(ThemeProvider.themeContext) let (searchString, setSearchString) = React.useState(() => "") let maxHeight = if maxHeight->String.includes("72") { "md:max-h-66.5" diff --git a/src/components/HSwitchSingleStatWidget.res b/src/components/HSwitchSingleStatWidget.res index db9b8a7d4..664a8ea6d 100644 --- a/src/components/HSwitchSingleStatWidget.res +++ b/src/components/HSwitchSingleStatWidget.res @@ -18,7 +18,7 @@ let make = ( ~isHomePage=false, ) => { open Identity - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (updateKey, setUpdateKey) = React.useState(_ => false) let sortedData = React.useMemo1(() => { diff --git a/src/components/HeadlessUISelectBox.res b/src/components/HeadlessUISelectBox.res index 9965fbf17..c9e022589 100644 --- a/src/components/HeadlessUISelectBox.res +++ b/src/components/HeadlessUISelectBox.res @@ -25,7 +25,7 @@ let make = ( ~textClass="text-sm", ~closeListOnClick=false, ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let dropdownPositionClass = switch dropdownPosition { | Left => "right-0" | _ => "left-0" diff --git a/src/components/MakeRuleFieldComponent.res b/src/components/MakeRuleFieldComponent.res index c111d96b9..1e093645a 100644 --- a/src/components/MakeRuleFieldComponent.res +++ b/src/components/MakeRuleFieldComponent.res @@ -42,7 +42,7 @@ module CompressedView = { @react.component let make = (~id, ~isFirst) => { open LogicUtils - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let conditionInput = ReactFinalForm.useField(id).input let displayForValue = value => diff --git a/src/components/NewCalendarTimeInput.res b/src/components/NewCalendarTimeInput.res index 0491f7220..6134303e8 100644 --- a/src/components/NewCalendarTimeInput.res +++ b/src/components/NewCalendarTimeInput.res @@ -89,7 +89,7 @@ let make = ( ~startTimeStr, ~endTimeStr, ) => { - let {globalUIConfig: {border: {borderColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {border: {borderColor}}} = React.useContext(ThemeProvider.themeContext) let todayDateTime = DayJs.getDayJs() let time = todayDateTime.format("hh:mm:ss a") diff --git a/src/components/SelectBox.res b/src/components/SelectBox.res index 6e02559fe..4b3b490f9 100644 --- a/src/components/SelectBox.res +++ b/src/components/SelectBox.res @@ -62,7 +62,7 @@ module ListItem = { ~textEllipsisForDropDownOptions=false, ~textColorClass="", ) => { - let {globalUIConfig: {font}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font}} = React.useContext(ThemeProvider.themeContext) let labelText = switch labelValue->String.length { | 0 => text | _ => labelValue @@ -461,7 +461,7 @@ module BaseSelect = { ~wrapBasis="", ~preservedAppliedOptions=[], ) => { - let {globalUIConfig: {font}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font}} = React.useContext(ThemeProvider.themeContext) let (searchString, setSearchString) = React.useState(() => "") let maxHeight = if maxHeight->String.includes("72") { "md:max-h-66.5" diff --git a/src/components/TableUtils.res b/src/components/TableUtils.res index b109698dc..32fe8b7fa 100644 --- a/src/components/TableUtils.res +++ b/src/components/TableUtils.res @@ -231,7 +231,7 @@ module LabelCell = { ~fontStyle="font-ibm-plex", ~showIcon=true, ) => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let isMobileView = MatchMedia.useMobileChecker() let bgOpacity = isMobileView ? "bg-opacity-12 dark:!bg-opacity-12" : "" let borderColor = switch labelColor { @@ -429,7 +429,7 @@ module MoneyCell = { module LinkCell = { @react.component let make = (~data, ~trimLength=?) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (showCopy, setShowCopy) = React.useState(() => false) let isMobileView = MatchMedia.useMobileChecker() @@ -579,7 +579,7 @@ module EllipsisText = { module TrimmedText = { @react.component let make = (~text, ~width, ~highlightText="", ~hideShowMore=false) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (show, setshow) = React.useState(_ => true) let breakWords = hideShowMore ? "" : "whitespace-nowrap text-ellipsis overflow-x-hidden" if text->String.length > 40 { diff --git a/src/components/form/TextInput.res b/src/components/form/TextInput.res index c4fc6236f..6bb3e97ff 100644 --- a/src/components/form/TextInput.res +++ b/src/components/form/TextInput.res @@ -39,7 +39,7 @@ let make = ( ~removeValidationCheck=false, ) => { let {globalUIConfig: {shadow: {shadowColor}, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let showPopUp = PopUpState.useShowPopUp() let isInValid = try { diff --git a/src/components/priority-logics/AddPLGateway.res b/src/components/priority-logics/AddPLGateway.res index 5f83d777a..0e81a6c53 100644 --- a/src/components/priority-logics/AddPLGateway.res +++ b/src/components/priority-logics/AddPLGateway.res @@ -3,7 +3,7 @@ type gateway = AdvancedRoutingTypes.volumeSplitConnectorSelectionData module GatewayView = { @react.component let make = (~gateways: array) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
{gateways ->Array.mapWithIndex((ruleGateway, index) => { diff --git a/src/context/ConfigContext.res b/src/context/ConfigContext.res deleted file mode 100644 index 33c0be01d..000000000 --- a/src/context/ConfigContext.res +++ /dev/null @@ -1,35 +0,0 @@ -type customUIConfig = { - globalUIConfig: UIConfig.t, - updateGlobalConfig: HyperSwitchConfigTypes.customStyle => unit, -} -let defaultGlobalConfig: HyperSwitchConfigTypes.customStyle = { - primaryColor: "#006DF9", - primaryHover: "#005ED6", - sidebar: "#242F48", -} - -let customUIConfig = { - globalUIConfig: UIConfig.defaultUIConfig, - updateGlobalConfig: _defaultGlobalConfig => (), -} - -let configContext = React.createContext(customUIConfig) - -module CustomUIConfig = { - let make = React.Context.provider(configContext) -} - -@react.component -let make = (~children) => { - let updateGlobalConfig = (customUIConfig: HyperSwitchConfigTypes.customStyle) => { - Window.appendStyle(customUIConfig) - } - - - children - -} diff --git a/src/context/ThemeProvider.res b/src/context/ThemeProvider.res index 0cbb0fe39..2780fdc43 100644 --- a/src/context/ThemeProvider.res +++ b/src/context/ThemeProvider.res @@ -2,18 +2,43 @@ type theme = Light | Dark let defaultSetter = (_: theme) => () -let themeContext = React.createContext((Light, defaultSetter)) - type themeType = LightTheme type x = {theme: string} +type customStyle = { + primaryColor: string, + primaryHover: string, + sidebar: string, +} + +type customUIConfig = { + globalUIConfig: UIConfig.t, + theme: theme, + themeSetter: theme => unit, + configCustomDomainTheme: JSON.t => unit, +} + +let defaultGlobalConfig: customStyle = { + primaryColor: "#006DF9", + primaryHover: "#005ED6", + sidebar: "#242F48", +} + +let themeContext = { + globalUIConfig: UIConfig.defaultUIConfig, + theme: Light, + themeSetter: defaultSetter, + configCustomDomainTheme: (_: JSON.t) => (), +} + +let themeContext = React.createContext(themeContext) + module Parent = { let make = React.Context.provider(themeContext) } - let useTheme = () => { - let (theme, _) = React.useContext(themeContext) + let {theme} = React.useContext(themeContext) theme } @@ -50,9 +75,25 @@ let make = (~children) => { | Dark => "dark" | Light => "" } + let configCustomDomainTheme = React.useCallback0((uiConfg: JSON.t) => { + open LogicUtils + let dict = uiConfg->getDictFromJsonObject->getDictfromDict("theme") + let {primaryColor, primaryHover, sidebar} = defaultGlobalConfig + let value: HyperSwitchConfigTypes.customStyle = { + primaryColor: dict->getString("primary_color", primaryColor), + primaryHover: dict->getString("primary_hover_color", primaryHover), + sidebar: dict->getString("sidebar_color", sidebar), + } + Window.appendStyle(value) + }) let value = React.useMemo2(() => { - (theme, setTheme) + { + globalUIConfig: UIConfig.defaultUIConfig, + theme, + themeSetter: setTheme, + configCustomDomainTheme, + } }, (theme, setTheme)) React.useEffect1(() => { diff --git a/src/entryPoints/AuthModule/AuthModuleHooks.res b/src/entryPoints/AuthModule/AuthModuleHooks.res index bf9d0fdf6..fda6a4bee 100644 --- a/src/entryPoints/AuthModule/AuthModuleHooks.res +++ b/src/entryPoints/AuthModule/AuthModuleHooks.res @@ -133,7 +133,7 @@ let useAuthMethods = (): authMethodProps => { let useNote = (authType, setAuthType, ()) => { open UIUtils open CommonAuthTypes - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let authId = HyperSwitchEntryUtils.getSessionData(~key="auth_id", ()) let {isMagicLinkEnabled, isPasswordEnabled} = useAuthMethods() diff --git a/src/entryPoints/AuthModule/Common/CommonAuth.res b/src/entryPoints/AuthModule/Common/CommonAuth.res index ed2e69e03..446440c1e 100644 --- a/src/entryPoints/AuthModule/Common/CommonAuth.res +++ b/src/entryPoints/AuthModule/Common/CommonAuth.res @@ -39,7 +39,7 @@ module Header = { @react.component let make = (~authType, ~setAuthType, ~email) => { open CommonAuthTypes - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let {isSignUpAllowed} = AuthModuleHooks.useAuthMethods() let form = ReactFinalForm.useForm() let {email: isMagicLinkEnabled} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom diff --git a/src/entryPoints/AuthModule/Common/CommonAuthForm.res b/src/entryPoints/AuthModule/Common/CommonAuthForm.res index 329cf97ca..7f08a0346 100644 --- a/src/entryPoints/AuthModule/Common/CommonAuthForm.res +++ b/src/entryPoints/AuthModule/Common/CommonAuthForm.res @@ -4,7 +4,7 @@ module EmailPasswordForm = { @react.component let make = (~setAuthType) => { open CommonInputFields - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let {email} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom
diff --git a/src/entryPoints/AuthModule/Common/CommonAuthHooks.res b/src/entryPoints/AuthModule/Common/CommonAuthHooks.res index cb1e7d37e..b086e6a3a 100644 --- a/src/entryPoints/AuthModule/Common/CommonAuthHooks.res +++ b/src/entryPoints/AuthModule/Common/CommonAuthHooks.res @@ -1,7 +1,7 @@ let useNote = (authType, setAuthType, isMagicLinkEnabled) => { open UIUtils open CommonAuthTypes - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let authId = HyperSwitchEntryUtils.getSessionData(~key="auth_id", ()) let getFooterLinkComponent = (~btnText, ~authType, ~path) => {
{ - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (seconds, setSeconds) = React.useState(_ => 30) let isDisabled = seconds > 0 diff --git a/src/entryPoints/AuthModule/TwoFaAuth/TwoFaAuth.res b/src/entryPoints/AuthModule/TwoFaAuth/TwoFaAuth.res index d75048602..43cedd0e2 100644 --- a/src/entryPoints/AuthModule/TwoFaAuth/TwoFaAuth.res +++ b/src/entryPoints/AuthModule/TwoFaAuth/TwoFaAuth.res @@ -18,6 +18,8 @@ let make = (~setAuthStatus, ~authType, ~setAuthType) => { let (email, setEmail) = React.useState(_ => "") let featureFlagValues = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let authId = HyperSwitchEntryUtils.getSessionData(~key="auth_id", ()) + let domain = HyperSwitchEntryUtils.getSessionData(~key="domain", ()) + let { isMagicLinkEnabled, isSignUpAllowed, @@ -38,14 +40,14 @@ let make = (~setAuthStatus, ~authType, ~setAuthType) => { | _ => "Register failed, Try again" } } - + Js.log2(domain, "domain") let getUserWithEmail = async body => { try { let url = getURL( ~entityName=USERS, ~userType=#CONNECT_ACCOUNT, ~methodType=Post, - ~queryParamerters=Some(`auth_id=${authId}`), + ~queryParamerters=Some(`auth_id=${authId}&domain=${domain}`), (), ) let res = await updateDetails(url, body, Post, ()) diff --git a/src/entryPoints/EntryPointUtils.res b/src/entryPoints/EntryPointUtils.res index 2ebd34232..1d50c8046 100644 --- a/src/entryPoints/EntryPointUtils.res +++ b/src/entryPoints/EntryPointUtils.res @@ -18,9 +18,7 @@ module ContextWrapper = { - - children - + children diff --git a/src/entryPoints/HyperSwitchEntry.res b/src/entryPoints/HyperSwitchEntry.res index e70a1ef6d..76165042e 100644 --- a/src/entryPoints/HyperSwitchEntry.res +++ b/src/entryPoints/HyperSwitchEntry.res @@ -9,23 +9,7 @@ module HyperSwitchEntryComponent = { let setFeatureFlag = HyperswitchAtom.featureFlagAtom->Recoil.useSetRecoilState let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Loading) let featureFlagDetails = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom - let defaultGlobalConfig: HyperSwitchConfigTypes.customStyle = { - primaryColor: "#006DF9", - primaryHover: "#005ED6", - sidebar: "#242F48", - } - - let configTheme = (uiConfg: JSON.t) => { - open LogicUtils - let dict = uiConfg->getDictFromJsonObject->getDictfromDict("theme") - let {primaryColor, primaryHover, sidebar} = defaultGlobalConfig - let value: HyperSwitchConfigTypes.customStyle = { - primaryColor: dict->getString("primary_color", primaryColor), - primaryHover: dict->getString("primary_hover_color", primaryHover), - sidebar: dict->getString("sidebar_color", sidebar), - } - Window.appendStyle(value) - } + let {configCustomDomainTheme} = React.useContext(ThemeProvider.themeContext) let configureFavIcon = (faviconUrl: option) => { try { @@ -76,7 +60,7 @@ module HyperSwitchEntryComponent = { let res = await fetchDetails(apiURL) let featureFlags = res->FeatureFlagUtils.featureFlagType setFeatureFlag(_ => featureFlags) - let _ = res->configTheme + let _ = res->configCustomDomainTheme let _ = res->configURL // Delay added on Expecting feature flag recoil gets updated await HyperSwitchUtils.delay(1000) diff --git a/src/genericUtils/BreadCrumbNavigation.res b/src/genericUtils/BreadCrumbNavigation.res index 06cec299e..0010a95a1 100644 --- a/src/genericUtils/BreadCrumbNavigation.res +++ b/src/genericUtils/BreadCrumbNavigation.res @@ -19,7 +19,7 @@ let make = ( ~commonTextClass="", ~linkTextClass="", ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let prefix = LogicUtils.useUrlPrefix() let showPopUp = PopUpState.useShowPopUp() let pathLength = path->Array.length diff --git a/src/libraries/HeadlessUI.res b/src/libraries/HeadlessUI.res index bf26b7384..2aba40b8d 100644 --- a/src/libraries/HeadlessUI.res +++ b/src/libraries/HeadlessUI.res @@ -447,7 +447,7 @@ module SelectBoxHeadlessUI = { ~deSelectAllowed=true, ~dropdownWidth="w-52", ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let transformedOptions = SelectBox.useTransformed(options) let dropdownPositionClass = switch dropdownPosition { | Left => "right-0" diff --git a/src/screens/Analytics/Analytics.res b/src/screens/Analytics/Analytics.res index f1a759be0..43e51a90e 100644 --- a/src/screens/Analytics/Analytics.res +++ b/src/screens/Analytics/Analytics.res @@ -99,7 +99,7 @@ module TableWrapper = { ~formatData=None, ) => { let {globalUIConfig: {font: {textColor}, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let customFilter = Recoil.useRecoilValueFromAtom(AnalyticsAtoms.customFilterAtom) let {filterValueJson} = React.useContext(FilterContext.filterContext) diff --git a/src/screens/Analytics/ErrorReasons.res b/src/screens/Analytics/ErrorReasons.res index 9bfe6b7a5..e315e09e9 100644 --- a/src/screens/Analytics/ErrorReasons.res +++ b/src/screens/Analytics/ErrorReasons.res @@ -70,7 +70,7 @@ let tableEntity = EntityType.makeEntity( @react.component let make = (~errors: array) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (showModal, setShowModal) = React.useState(_ => false) let (offset, setOffset) = React.useState(_ => 0) let defaultSort: Table.sortedObject = { diff --git a/src/screens/Analytics/HomePageOverview/HomePageOverviewComponent.res b/src/screens/Analytics/HomePageOverview/HomePageOverviewComponent.res index 1a08f8995..09a80b5b7 100644 --- a/src/screens/Analytics/HomePageOverview/HomePageOverviewComponent.res +++ b/src/screens/Analytics/HomePageOverview/HomePageOverviewComponent.res @@ -4,7 +4,7 @@ module ConnectorOverview = { @react.component let make = () => { open ConnectorUtils - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let userPermissionJson = Recoil.useRecoilValueFromAtom(HyperswitchAtom.userPermissionAtom) let connectorsList = HyperswitchAtom.connectorListAtom @@ -180,7 +180,7 @@ module OverviewInfo = { @react.component let make = () => { let getURL = useGetURL() - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let {sampleData} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let updateDetails = useUpdateMethod() let showToast = ToastState.useShowToast() diff --git a/src/screens/Analytics/Logs/LogUtils/ApiDetailsComponent.res b/src/screens/Analytics/Logs/LogUtils/ApiDetailsComponent.res index 7a1b8b555..b8337d4fd 100644 --- a/src/screens/Analytics/Logs/LogUtils/ApiDetailsComponent.res +++ b/src/screens/Analytics/Logs/LogUtils/ApiDetailsComponent.res @@ -12,7 +12,7 @@ let make = ( ~nameToURLMapper, ~filteredKeys=[], ) => { - let {globalUIConfig: {border: {borderColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {border: {borderColor}}} = React.useContext(ThemeProvider.themeContext) let headerStyle = "text-sm font-medium text-gray-700 break-all" let logType = dataDict->getLogType let apiName = switch logType { diff --git a/src/screens/Connectors/ConnectPayPalFlow/ConnectPayPal.res b/src/screens/Connectors/ConnectPayPalFlow/ConnectPayPal.res index 8202e5dea..52ace474e 100644 --- a/src/screens/Connectors/ConnectPayPalFlow/ConnectPayPal.res +++ b/src/screens/Connectors/ConnectPayPalFlow/ConnectPayPal.res @@ -12,7 +12,7 @@ let preRequisiteList = [ module PayPalCreateNewAccountModal = { @react.component let make = (~butttonDisplayText, ~actionUrl, ~setScreenState) => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let initializePayPalWindow = () => { try { Window.payPalCreateAccountWindow() @@ -69,7 +69,7 @@ module LandingScreen = { let make = (~configuartionType, ~setConfigurationType) => { let { globalUIConfig: {backgroundColor, font: {textColor}, border: {borderColor}}, - } = React.useContext(ConfigContext.configContext) + } = React.useContext(ThemeProvider.themeContext) let getBlockColor = value => configuartionType === value ? `${borderColor.primaryNormal} ${backgroundColor} bg-opacity-10 ` diff --git a/src/screens/Connectors/ConnectorAccountDetailsHelper.res b/src/screens/Connectors/ConnectorAccountDetailsHelper.res index 524e1afaa..181ac1723 100644 --- a/src/screens/Connectors/ConnectorAccountDetailsHelper.res +++ b/src/screens/Connectors/ConnectorAccountDetailsHelper.res @@ -267,7 +267,7 @@ module CashToCodeSelectBox = { ~selectedConnector, ) => { open LogicUtils - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let p2RegularTextStyle = `${HSwitchUtils.getTextClass((P2, Medium))} text-grey-700 opacity-50` let (showWalletConfigurationModal, setShowWalletConfigurationModal) = React.useState(_ => false) let (country, setSelectedCountry) = React.useState(_ => "") @@ -437,7 +437,7 @@ module ConnectorConfigurationFields = { module BusinessProfileRender = { @react.component let make = (~isUpdateFlow: bool, ~selectedConnector) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let {setDashboardPageState} = React.useContext(GlobalProvider.defaultContext) let businessProfiles = Recoil.useRecoilValueFromAtom(HyperswitchAtom.businessProfilesAtom) let defaultBusinessProfile = businessProfiles->MerchantAccountUtils.getValueFromBusinessProfile @@ -592,7 +592,7 @@ module ConnectorHeaderWrapper = { ~connectorType=ConnectorTypes.Processor, ) => { open ConnectorUtils - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let connectorNameFromType = connector->getConnectorNameTypeFromString() let setShowModalFunction = switch handleShowModal { | Some(func) => func diff --git a/src/screens/Connectors/ConnectorUIUtils/IntegrationHelp.res b/src/screens/Connectors/ConnectorUIUtils/IntegrationHelp.res index ee99be061..169c564c8 100644 --- a/src/screens/Connectors/ConnectorUIUtils/IntegrationHelp.res +++ b/src/screens/Connectors/ConnectorUIUtils/IntegrationHelp.res @@ -1,7 +1,7 @@ module Render = { @react.component let make = (~connector, ~showModal, ~setShowModal) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let integrationSteps = switch connector->ConnectorUtils.getConnectorNameTypeFromString() { | Processors(STRIPE) =>
diff --git a/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res b/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res index a667ea6bc..554e92c2c 100644 --- a/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res +++ b/src/screens/Connectors/ConnectorUIUtils/PaymentMethod.res @@ -31,7 +31,7 @@ module CardRenderer = { ~setMetaData, ~connector, ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (showWalletConfigurationModal, setShowWalletConfigurationModal) = React.useState(_ => false) let (selectedWallet, setSelectedWallet) = React.useState(_ => Dict.make()->itemProviderMapper) let selectedAll = isSelectedAll(paymentMethodsEnabled, provider, paymentMethod) diff --git a/src/screens/Connectors/ConnectorUIUtils/SuggestedActionHelper.res b/src/screens/Connectors/ConnectorUIUtils/SuggestedActionHelper.res index 4b44e7d1b..963066599 100644 --- a/src/screens/Connectors/ConnectorUIUtils/SuggestedActionHelper.res +++ b/src/screens/Connectors/ConnectorUIUtils/SuggestedActionHelper.res @@ -10,7 +10,7 @@ module SuggestedAction = { module StripSendingCreditCard = { @react.component let make = () => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) <>
{ - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) <>
{ - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) <>
getDictFromJsonObject diff --git a/src/screens/Connectors/Wallets/WalletHelper.res b/src/screens/Connectors/Wallets/WalletHelper.res index 39ff07585..113af929c 100644 --- a/src/screens/Connectors/Wallets/WalletHelper.res +++ b/src/screens/Connectors/Wallets/WalletHelper.res @@ -61,7 +61,7 @@ module Card = { @react.component let make = (~heading="", ~isSelected=false, ~children: React.element) => { let {globalUIConfig: {font: {textColor}, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) <>
{ let {globalUIConfig: {backgroundColor, font: {textColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let bgColor = "bg-white" let stepColor = `${backgroundColor} text-white py-px px-2` diff --git a/src/screens/Disputes/Disputes.res b/src/screens/Disputes/Disputes.res index 4cb69dfbb..1af1b8548 100644 --- a/src/screens/Disputes/Disputes.res +++ b/src/screens/Disputes/Disputes.res @@ -4,7 +4,7 @@ open PageLoaderWrapper let make = () => { let getURL = useGetURL() let {globalUIConfig: {font: {textColor}, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let {branding} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let (screenState, setScreenState) = React.useState(_ => Loading) diff --git a/src/screens/Disputes/DisputesEntity.res b/src/screens/Disputes/DisputesEntity.res index 894646d81..710ee2925 100644 --- a/src/screens/Disputes/DisputesEntity.res +++ b/src/screens/Disputes/DisputesEntity.res @@ -25,7 +25,7 @@ let allColumns = [ let useGetStatus = dispute => { open DisputesUtils - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let orderStatusLabel = dispute.dispute_status->String.toUpperCase let fixedCss = "text-sm text-white font-bold p-1.5 rounded-lg" switch dispute.dispute_status->disputeStatusVariantMapper { diff --git a/src/screens/Disputes/ShowDisputes.res b/src/screens/Disputes/ShowDisputes.res index bea450657..6d39c87e2 100644 --- a/src/screens/Disputes/ShowDisputes.res +++ b/src/screens/Disputes/ShowDisputes.res @@ -4,7 +4,7 @@ module DisputesNoteComponent = { @react.component let make = (~disputesData: DisputeTypes.disputes) => { let {globalUIConfig: {font: {textColor}, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let connectorTypeFromName = disputesData.connector->getConnectorNameTypeFromString() let dashboardLink = { diff --git a/src/screens/Disputes/UploadEvidenceForDisputes.res b/src/screens/Disputes/UploadEvidenceForDisputes.res index 7295c9947..f3e78803a 100644 --- a/src/screens/Disputes/UploadEvidenceForDisputes.res +++ b/src/screens/Disputes/UploadEvidenceForDisputes.res @@ -11,7 +11,7 @@ module EvidenceUploadForm = { @react.component let make = (~uploadEvidenceType, ~index, ~fileUploadedDict, ~setFileUploadedDict) => { open LogicUtils - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let handleBrowseChange = (event, uploadEvidenceType) => { let target = ReactEvent.Form.target(event) let fileDict = @@ -211,7 +211,7 @@ module DisputesInfoBarComponent = { open PageLoaderWrapper let getURL = useGetURL() let {globalUIConfig: {font: {textColor}, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let fetchDetails = useGetMethod() let updateDetails = useUpdateMethod() diff --git a/src/screens/Home/HomeV2.res b/src/screens/Home/HomeV2.res index af1f5cf2d..cf7fd6da6 100644 --- a/src/screens/Home/HomeV2.res +++ b/src/screens/Home/HomeV2.res @@ -5,7 +5,7 @@ module HomePageHorizontalStepper = { @react.component let make = (~stepperItemsArray: array, ~className="") => { let {globalUIConfig: {backgroundColor, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let enumDetails = Recoil.useRecoilValueFromAtom(HyperswitchAtom.enumVariantAtom) let typedValueOfEnum = enumDetails->LogicUtils.safeParse->QuickStartUtils.getTypedValueFromDict diff --git a/src/screens/Home/QuickStart/IntegrateYourApp/IntegrateFromScratch.res b/src/screens/Home/QuickStart/IntegrateYourApp/IntegrateFromScratch.res index e1d779752..e4dc9d393 100644 --- a/src/screens/Home/QuickStart/IntegrateYourApp/IntegrateFromScratch.res +++ b/src/screens/Home/QuickStart/IntegrateYourApp/IntegrateFromScratch.res @@ -12,7 +12,7 @@ let make = ( ~setPlatform, ~markAsDone, ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (currentStep, setCurrentStep) = React.useState(_ => DownloadTestAPIKey) let {setQuickStartPageState} = React.useContext(GlobalProvider.defaultContext) let isLastStep = currentStep === DisplayPaymentConfirmation diff --git a/src/screens/Home/QuickStart/QuickStartUIUtils.res b/src/screens/Home/QuickStart/QuickStartUIUtils.res index 3a086c136..09af15bea 100644 --- a/src/screens/Home/QuickStart/QuickStartUIUtils.res +++ b/src/screens/Home/QuickStart/QuickStartUIUtils.res @@ -69,7 +69,7 @@ module VerticalChoiceTile = { ) => { let { globalUIConfig: {backgroundColor, font: {textColor}, border: {borderColor}}, - } = React.useContext(ConfigContext.configContext) + } = React.useContext(ThemeProvider.themeContext) let getBlockColor = value => choiceState === value ? `${borderColor.primaryNormal} ${backgroundColor} bg-opacity-10 ` @@ -137,7 +137,7 @@ module HorizontalChoiceTile = { ) => { let { globalUIConfig: {backgroundColor, font: {textColor}, border: {borderColor}}, - } = React.useContext(ConfigContext.configContext) + } = React.useContext(ThemeProvider.themeContext) let getBlockColor = value => choiceState === value ? `${borderColor.primaryNormal} ${backgroundColor} bg-opacity-10 ` @@ -222,7 +222,7 @@ module SelectConnectorGrid = { let { globalUIConfig: {backgroundColor, font: {textColor}, border: {borderColor}}, - } = React.useContext(ConfigContext.configContext) + } = React.useContext(ThemeProvider.themeContext) let typedConnectedConnectorList = HyperswitchAtom.connectorListAtom ->Recoil.useRecoilValueFromAtom diff --git a/src/screens/Order/OrderEntity.res b/src/screens/Order/OrderEntity.res index 5b5c7fa31..d7d3659e2 100644 --- a/src/screens/Order/OrderEntity.res +++ b/src/screens/Order/OrderEntity.res @@ -532,7 +532,7 @@ let getHeading = (colType: colType) => { } let useGetStatus = order => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let orderStatusLabel = order.status->String.toUpperCase let fixedStatusCss = "text-sm text-white font-bold px-3 py-2 rounded-md" switch order.status->HSwitchOrderUtils.statusVariantMapper { diff --git a/src/screens/Order/ShowOrder.res b/src/screens/Order/ShowOrder.res index 117314168..801978d1f 100644 --- a/src/screens/Order/ShowOrder.res +++ b/src/screens/Order/ShowOrder.res @@ -557,7 +557,7 @@ module AuthenticationDetails = { module FraudRiskBanner = { @react.component let make = (~frmMessage: frmMessage, ~refElement: React.ref>) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
diff --git a/src/screens/Payouts/PayoutsEntity.res b/src/screens/Payouts/PayoutsEntity.res index e36722dad..621bb696a 100644 --- a/src/screens/Payouts/PayoutsEntity.res +++ b/src/screens/Payouts/PayoutsEntity.res @@ -255,7 +255,7 @@ let allColumns = [ ] let useGetStatus = order => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let orderStatusLabel = order.status->String.toUpperCase let fixedCss = "text-sm text-white font-bold p-1.5 rounded-lg" switch order.status->statusVariantMapper { diff --git a/src/screens/PostLoginScreen/PostLoginScreen.res b/src/screens/PostLoginScreen/PostLoginScreen.res index d299e1047..2b3c5b716 100644 --- a/src/screens/PostLoginScreen/PostLoginScreen.res +++ b/src/screens/PostLoginScreen/PostLoginScreen.res @@ -5,7 +5,7 @@ module SurveyComponent = { let make = (~currentStep, ~setCurrentStep, ~currentQuestionDict, ~setCarouselDirection) => { let { globalUIConfig: {backgroundColor, border: {borderColor}, font: {textColor}}, - } = React.useContext(ConfigContext.configContext) + } = React.useContext(ThemeProvider.themeContext) let currentQuestionValue = ReactFinalForm.useField(currentQuestionDict.key).input.value->LogicUtils.getStringFromJson("") let isNextButtonEnabled = currentQuestionValue->LogicUtils.isNonEmptyString diff --git a/src/screens/Refunds/RefundEntity.res b/src/screens/Refunds/RefundEntity.res index 422d81794..5919b8ddd 100644 --- a/src/screens/Refunds/RefundEntity.res +++ b/src/screens/Refunds/RefundEntity.res @@ -48,7 +48,7 @@ let allColumns = [ ] let useGetStatus = order => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let orderStatusLabel = order.status->String.toUpperCase let fixedCss = "text-sm text-white font-bold p-1.5 rounded-lg" switch order.status->statusVariantMapper { diff --git a/src/screens/Routing/ActiveRouting.res b/src/screens/Routing/ActiveRouting.res index 4e013ec22..448715c2a 100644 --- a/src/screens/Routing/ActiveRouting.res +++ b/src/screens/Routing/ActiveRouting.res @@ -26,7 +26,7 @@ module ActionButtons = { @react.component let make = (~routeType: routingType, ~onRedirectBaseUrl) => { let {globalUIConfig: {font: {textColor}, border: {borderColor}}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let mixpanelEvent = MixpanelHook.useSendEvent() let userPermissionJson = Recoil.useRecoilValueFromAtom(HyperswitchAtom.userPermissionAtom) diff --git a/src/screens/Routing/AdvancedRouting/RoutingPreviewer.res b/src/screens/Routing/AdvancedRouting/RoutingPreviewer.res index eb6c29924..f147ad546 100644 --- a/src/screens/Routing/AdvancedRouting/RoutingPreviewer.res +++ b/src/screens/Routing/AdvancedRouting/RoutingPreviewer.res @@ -3,7 +3,7 @@ open RoutingTypes module SimplePreview = { @react.component let make = (~gateways) => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) Array.length > 0}>
@@ -31,7 +31,7 @@ module SimplePreview = { module GatewayView = { @react.component let make = (~gateways, ~connectorList=?) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let getGatewayName = name => { switch connectorList { | Some(list) => diff --git a/src/screens/Routing/DefaultRouting.res b/src/screens/Routing/DefaultRouting.res index d00ac453f..c84850c2e 100644 --- a/src/screens/Routing/DefaultRouting.res +++ b/src/screens/Routing/DefaultRouting.res @@ -16,7 +16,7 @@ let make = (~urlEntityName, ~baseUrlForRedirection) => { let (defaultRoutingResponse, setDefaultRoutingResponse) = React.useState(_ => []) let modalObj = RoutingUtils.getModalObj(DEFAULTFALLBACK, "default") let typedConnectorValue = HyperswitchAtom.connectorListAtom->Recoil.useRecoilValueFromAtom - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let settingUpConnectorsState = routingRespArray => { let profileList = routingRespArray->Array.filter(value => diff --git a/src/screens/Routing/PriorityRouting.res b/src/screens/Routing/PriorityRouting.res index 44e51019b..751c7e969 100644 --- a/src/screens/Routing/PriorityRouting.res +++ b/src/screens/Routing/PriorityRouting.res @@ -19,7 +19,7 @@ module SimpleRoutingView = { ~baseUrlForRedirection, ) => { let getURL = useGetURL() - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let nameFromForm = ReactFinalForm.useField(`name`).input.value let descriptionFromForm = ReactFinalForm.useField(`description`).input.value let modalObj = RoutingUtils.getModalObj(PRIORITY, "priority") diff --git a/src/screens/RoutingRevamp/AdvancedRouting.res b/src/screens/RoutingRevamp/AdvancedRouting.res index 2b2559ce7..3183b05db 100644 --- a/src/screens/RoutingRevamp/AdvancedRouting.res +++ b/src/screens/RoutingRevamp/AdvancedRouting.res @@ -159,7 +159,7 @@ module Wrapper = { ~isFrom3ds=false, ~isFromSurcharge=false, ) => { - let {globalUIConfig: {border: {borderColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {border: {borderColor}}} = React.useContext(ThemeProvider.themeContext) let showToast = ToastState.useShowToast() let isMobileView = MatchMedia.useMobileChecker() let (isExpanded, setIsExpanded) = React.useState(_ => true) @@ -352,7 +352,7 @@ module RuleBasedUI = { ~setCurrentRouting, ~baseUrlForRedirection, ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let rulesJsonPath = `algorithm.data.rules` let ruleInput = ReactFinalForm.useField(rulesJsonPath).input let (rules, setRules) = React.useState(_ => ruleInput.value->getArrayFromJson([])) diff --git a/src/screens/RoutingRevamp/AdvancedRoutingUIUtils.res b/src/screens/RoutingRevamp/AdvancedRoutingUIUtils.res index 5589d36c4..b49655dfb 100644 --- a/src/screens/RoutingRevamp/AdvancedRoutingUIUtils.res +++ b/src/screens/RoutingRevamp/AdvancedRoutingUIUtils.res @@ -5,7 +5,7 @@ open FormRenderer module LogicalOps = { @react.component let make = (~id) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let logicalOpsInput = ReactFinalForm.useField(`${id}.logical`).input React.useEffect0(() => { diff --git a/src/screens/RoutingRevamp/Previewers/RulePreviewer.res b/src/screens/RoutingRevamp/Previewers/RulePreviewer.res index 27a24d70e..2f2fe2866 100644 --- a/src/screens/RoutingRevamp/Previewers/RulePreviewer.res +++ b/src/screens/RoutingRevamp/Previewers/RulePreviewer.res @@ -4,7 +4,7 @@ open AdvancedRoutingUtils module GatewayView = { @react.component let make = (~gateways) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
{gateways ->Array.mapWithIndex((ruleGateway, index) => { @@ -31,7 +31,7 @@ module GatewayView = { module ThreedsTypeView = { @react.component let make = (~threeDsType) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
{threeDsType->LogicUtils.capitalizeString->React.string} @@ -42,7 +42,7 @@ module ThreedsTypeView = { module SurchargeCompressedView = { @react.component let make = (~surchargeType, ~surchargeTypeValue, ~surchargePercentage) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
{`${surchargeType} -> ${surchargeTypeValue->Float.toString} | Tax on Surcharge -> ${surchargePercentage @@ -57,7 +57,7 @@ module SurchargeCompressedView = { @react.component let make = (~ruleInfo: algorithmData, ~isFrom3ds=false, ~isFromSurcharge=false) => { open LogicUtils - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext)
diff --git a/src/screens/SelfServe/HSwitchProdOnboarding/ChooseConnector.res b/src/screens/SelfServe/HSwitchProdOnboarding/ChooseConnector.res index 9250c0908..16cfc998b 100644 --- a/src/screens/SelfServe/HSwitchProdOnboarding/ChooseConnector.res +++ b/src/screens/SelfServe/HSwitchProdOnboarding/ChooseConnector.res @@ -6,7 +6,7 @@ let subheaderText = "text-base font-semibold text-grey-700" let make = (~selectedConnector, ~setSelectedConnector, ~pageView, ~setPageView) => { let { globalUIConfig: {backgroundColor, font: {textColor}, border: {borderColor}}, - } = React.useContext(ConfigContext.configContext) + } = React.useContext(ThemeProvider.themeContext) let getBlockColor = connector => { open ConnectorTypes switch (selectedConnector, connector) { diff --git a/src/screens/SelfServe/HSwitchProdOnboarding/LiveEndpointsSetup.res b/src/screens/SelfServe/HSwitchProdOnboarding/LiveEndpointsSetup.res index 1c09ca1d7..64dddf337 100644 --- a/src/screens/SelfServe/HSwitchProdOnboarding/LiveEndpointsSetup.res +++ b/src/screens/SelfServe/HSwitchProdOnboarding/LiveEndpointsSetup.res @@ -116,7 +116,7 @@ let make = (~pageView, ~setPageView, ~previewState: option { let {globalUIConfig: {font: {textColor}, backgroundColor}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let stepColor = @@ -87,7 +87,7 @@ module CheckListSection = { module ProgressBar = { @react.component let make = (~progressState) => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext)
{ let subTextStyle = "text-base font-normal text-grey-700 opacity-50" let useGetWarningBlockForConnector = connectorName => { open ConnectorTypes - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let hightlightedText = `text-base font-normal ${textColor.primaryNormal} underline` switch connectorName { | Processors(STRIPE) => diff --git a/src/screens/SelfServe/HSwitchSandboxOnboarding/IntegrationDocs.res b/src/screens/SelfServe/HSwitchSandboxOnboarding/IntegrationDocs.res index f91fbe288..488d62ca5 100644 --- a/src/screens/SelfServe/HSwitchSandboxOnboarding/IntegrationDocs.res +++ b/src/screens/SelfServe/HSwitchSandboxOnboarding/IntegrationDocs.res @@ -108,7 +108,7 @@ let make = ( ) => { open UserOnboardingUtils open UserOnboardingTypes - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let (tabIndex, setTabIndex) = React.useState(_ => 0) let (frontEndLang, setFrontEndLang) = React.useState(_ => currentRoute === SampleProjects ? #ChooseLanguage : #ReactJs diff --git a/src/screens/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res b/src/screens/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res index a69a5ee68..d8c7052af 100644 --- a/src/screens/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res +++ b/src/screens/SelfServe/HSwitchSandboxOnboarding/UserOnboardingUIUtils.res @@ -5,7 +5,7 @@ open LogicUtils module ProgressBar = { @react.component let make = (~tabs, ~tabIndex) => { - let {globalUIConfig: {backgroundColor}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {backgroundColor}} = React.useContext(ThemeProvider.themeContext) let defaultStyle = currentIndex => { currentIndex < tabIndex + 1 ? `${backgroundColor} h-1.5 w-full` @@ -565,7 +565,7 @@ module Section = { module CreatePayment = { @react.component let make = (~currentRoute, ~tabIndex, ~defaultEditorStyle, ~backEndLang, ~theme) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) setShowModal(_ => true)} @@ -127,7 +127,7 @@ module ExternalUser = { open UIUtils let {merchant_id: defaultMerchantId} = CommonAuthHooks.useCommonAuthInfo()->Option.getOr(CommonAuthHooks.defaultAuthInfo) - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let switchMerchantList = Recoil.useRecoilValueFromAtom(HyperswitchAtom.switchMerchantListAtom) let merchantDetailsTypedValue = HSwitchUtils.useMerchantDetailsValue() let defaultSelectedMerchantType = { diff --git a/src/screens/UserManagement/InviteUsers.res b/src/screens/UserManagement/InviteUsers.res index ce539793c..a6f24c3da 100644 --- a/src/screens/UserManagement/InviteUsers.res +++ b/src/screens/UserManagement/InviteUsers.res @@ -6,7 +6,7 @@ module InviteEmailForm = { open APIUtils open UIUtils let getURL = useGetURL() - let {globalUIConfig: {border: {borderColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {border: {borderColor}}} = React.useContext(ThemeProvider.themeContext) let fetchDetails = useGetMethod() let {email} = HyperswitchAtom.featureFlagAtom->Recoil.useRecoilValueFromAtom let (roleListData, setRoleListData) = React.useState(_ => []) diff --git a/src/screens/Utils/HSSelfServeSidebar.res b/src/screens/Utils/HSSelfServeSidebar.res index b54d39c49..78196c196 100644 --- a/src/screens/Utils/HSSelfServeSidebar.res +++ b/src/screens/Utils/HSSelfServeSidebar.res @@ -16,7 +16,7 @@ type sidebarOption = { let make = (~heading, ~sidebarOptions: array=[]) => { let {setDashboardPageState} = React.useContext(GlobalProvider.defaultContext) let {globalUIConfig: {font: {textColor}, backgroundColor}} = React.useContext( - ConfigContext.configContext, + ThemeProvider.themeContext, ) let handleBackButton = _ => { setDashboardPageState(_ => #HOME) diff --git a/src/screens/componentsDemo/CardTable.res b/src/screens/componentsDemo/CardTable.res index 34a77af89..9a02745e6 100644 --- a/src/screens/componentsDemo/CardTable.res +++ b/src/screens/componentsDemo/CardTable.res @@ -43,7 +43,7 @@ module CardDetails = { ~isBorderEnabled=true, ~isAnalyticsModule, ) => { - let {globalUIConfig: {font: {textColor}}} = React.useContext(ConfigContext.configContext) + let {globalUIConfig: {font: {textColor}}} = React.useContext(ThemeProvider.themeContext) let onCardClick = _ev => { switch onRowClick { | Some(fn) => fn(rowIndex + offset)