korbit-ai[bot] commented on code in PR #32006:
URL: https://github.com/apache/superset/pull/32006#discussion_r1931469661


##########
superset-frontend/src/views/App.tsx:
##########
@@ -69,34 +70,36 @@ const LocationPathnameLogger = () => {
   return <></>;
 };
 
-const App = () => (
-  <Router>
-    <ScrollToTop />
-    <LocationPathnameLogger />
-    <RootContextProviders>
-      <GlobalStyles />
-      <Menu
-        data={bootstrapData.common.menu_data}
-        isFrontendRoute={isFrontendRoute}
-      />
-      <Switch>
-        {routes.map(({ path, Component, props = {}, Fallback = Loading }) => (
-          <Route path={path} key={path}>
-            <Suspense fallback={<Fallback />}>
-              <Layout.Content>
-                <div style={{ padding: '16px' }}>
-                  <ErrorBoundary>
+const App = () => {
+  const theme = useTheme();
+
+  return (
+    <Router>
+      <ScrollToTop />
+      <LocationPathnameLogger />
+      <RootContextProviders>
+        <GlobalStyles />
+        <Menu
+          data={bootstrapData.common.menu_data}
+          isFrontendRoute={isFrontendRoute}
+        />
+        <Switch>
+          {routes.map(({ path, Component, props = {}, Fallback = Loading }) => 
(
+            <Route path={path} key={path}>
+              <Suspense fallback={<Fallback />}>
+                <Layout.Content>
+                  <ErrorBoundary style={{ margin: theme.sizeUnit * 4 }}>

Review Comment:
   ### Unsafe Theme Property Access <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   No type checking or fallback for theme.sizeUnit which could be undefined
   
   ###### Why this matters
   If theme.sizeUnit is undefined, the multiplication operation will result in 
NaN, causing unexpected styling behavior.
   
   ###### Suggested change ∙ *Feature Preview*
   Add a fallback value for theme.sizeUnit:
   ```tsx
   style={{ margin: (theme?.sizeUnit ?? 8) * 4 }}
   ```
   
   
   </details>
   
   <sub>💡 Does this comment miss the mark? [Tell us 
why](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/dac7017a-96cb-443d-8926-7907059ff387?suggestedFixEnabled=true)
 and Korbit will adapt to your team’s feedback.
   💬 Chat with Korbit by mentioning @korbit-ai.
   </sub>
   
   <!--- korbi internal id:464ccbbb-782b-459f-9f21-7061a455528f -->
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to