diff --git a/src/entryPoints/hyperswitch/HyperSwitchApp.res b/src/entryPoints/hyperswitch/HyperSwitchApp.res index c30e406ee..d4b39faa1 100644 --- a/src/entryPoints/hyperswitch/HyperSwitchApp.res +++ b/src/entryPoints/hyperswitch/HyperSwitchApp.res @@ -4,19 +4,6 @@ open HSLocalStorage open HSwitchGlobalVars open APIUtils -module FeatureFlagEnabledComponent = { - @react.component - let make = (~isEnabled, ~children) => { - let {setDashboardPageState} = React.useContext(GlobalProvider.defaultContext) - let updateRoute = () => { - setDashboardPageState(_ => #HOME) - RescriptReactRouter.replace("/home") - React.null - } - <> {isEnabled ? children : updateRoute()} - } -} - @react.component let make = () => { let url = RescriptReactRouter.useUrl() @@ -249,11 +236,11 @@ let make = () => { {switch url.path { | list{"home"} => - + {featureFlagDetails.quickStart ? : } - + | list{"fraud-risk-management", ...remainingPath} => - + { renderNewForm={() => } renderShow={_ => } /> - + | list{"connectors", ...remainingPath} => { renderShow={id => } /> | list{"customers", ...remainingPath} => - + { renderList={() => } renderShow={id => } /> - + | list{"routing", ...remainingPath} => { | list{"analytics-user-journey"} => - + - + | list{"monitoring"} => comingSoonPage | list{"developer-api-keys"} => | list{"developer-system-metrics"} => @@ -366,31 +352,31 @@ let make = () => { } /> | list{"recon"} => - + - + | list{"sdk"} => - + - + | list{"3ds"} => | list{"surcharge"} => - + - + | list{"account-settings"} => - + - + | list{"account-settings", "profile"} => | list{"business-details"} => - + - + | list{"business-profiles"} => - + - + | list{"quick-start"} => determineQuickStartPageState() | list{"woocommerce"} => determineWooCommerce() | list{"stripe-plus-paypal"} => determineStripePlusPayPal() diff --git a/src/utils/AccessControl.res b/src/utils/AccessControl.res new file mode 100644 index 000000000..93d9c0951 --- /dev/null +++ b/src/utils/AccessControl.res @@ -0,0 +1,11 @@ +@react.component +let make = (~isEnabled, ~children) => { + let {setDashboardPageState} = React.useContext(GlobalProvider.defaultContext) + + let updateRoute = () => { + setDashboardPageState(_ => #HOME) + RescriptReactRouter.replace("/home") + React.null + } + isEnabled ? children : updateRoute() +}