kgabryje commented on code in PR #37459:
URL: https://github.com/apache/superset/pull/37459#discussion_r2841348791


##########
superset-frontend/src/dashboard/components/Header/index.tsx:
##########
@@ -139,83 +196,68 @@ const StyledUndoRedoButton = styled(Button)`
   }
 `;
 
-const undoRedoStyle = (theme: {
-  colorIcon: string;
-  colorIconHover: string;
-}) => css`
+const undoRedoStyle = (theme: SupersetTheme) => css`
   color: ${theme.colorIcon};
   &:hover {
     color: ${theme.colorIconHover};
   }
 `;
 
-const undoRedoEmphasized = (theme: { colorIcon: string }) => css`
+const undoRedoEmphasized = (theme: SupersetTheme) => css`
   color: ${theme.colorIcon};
 `;
 
-const undoRedoDisabled = (theme: { colorTextDisabled: string }) => css`
+const undoRedoDisabled = (theme: SupersetTheme) => css`
   color: ${theme.colorTextDisabled};
 `;
 
-const saveBtnStyle = (theme: { sizeUnit: number }) => css`
+const saveBtnStyle = (theme: SupersetTheme) => css`
   min-width: ${theme.sizeUnit * 17}px;
   height: ${theme.sizeUnit * 8}px;
   span > :first-of-type {
     margin-right: 0;
   }
 `;
 
-const discardBtnStyle = (theme: { sizeUnit: number }) => css`
+const discardBtnStyle = (theme: SupersetTheme) => css`
   min-width: ${theme.sizeUnit * 22}px;
   height: ${theme.sizeUnit * 8}px;
 `;
 
-const discardChanges = (): void => {
+const discardChanges = () => {
   const url = new URL(window.location.href);
 
   url.searchParams.delete('edit');
   window.location.assign(url);
 };
 
-interface PropertiesChanges {
-  slug?: string;
-  jsonMetadata?: string;
-  certifiedBy?: string;
-  certificationDetails?: string;
-  owners?: DashboardInfo['owners'];
-  roles?: DashboardInfo['roles'];
-  tags?: DashboardInfo['tags'];
-  themeId?: number | null;
-  css?: string;
-  title?: string;
-}
-
-const Header = (): ReactElement => {
+const Header = (): JSX.Element => {
   const dispatch = useDispatch();
+  const store = useStore<HeaderRootState>();
   const [didNotifyMaxUndoHistoryToast, setDidNotifyMaxUndoHistoryToast] =
-    useState<boolean>(false);
-  const [emphasizeUndo, setEmphasizeUndo] = useState<boolean>(false);
-  const [emphasizeRedo, setEmphasizeRedo] = useState<boolean>(false);
-  const [showingPropertiesModal, setShowingPropertiesModal] =
-    useState<boolean>(false);
-  const [showingRefreshModal, setShowingRefreshModal] =
-    useState<boolean>(false);
-  const [showingEmbedModal, setShowingEmbedModal] = useState<boolean>(false);
-  const [showingReportModal, setShowingReportModal] = useState<boolean>(false);
+    useState(false);
+  const [emphasizeUndo, setEmphasizeUndo] = useState(false);
+  const [emphasizeRedo, setEmphasizeRedo] = useState(false);
+  const [showingPropertiesModal, setShowingPropertiesModal] = useState(false);
+  const [showingRefreshModal, setShowingRefreshModal] = useState(false);
+  const [showingEmbedModal, setShowingEmbedModal] = useState(false);
+  const [showingReportModal, setShowingReportModal] = useState(false);
   const [currentReportDeleting, setCurrentReportDeleting] =
-    useState<ReportObject | null>(null);
-  const dashboardInfo = useSelector((state: RootState) => state.dashboardInfo);
+    useState<AlertObject | null>(null);
+  const dashboardInfo = useSelector(
+    (state: HeaderRootState) => state.dashboardInfo,
+  );
   const layout = useSelector(
-    (state: RootState) => state.dashboardLayout.present,
+    (state: HeaderRootState) => state.dashboardLayout.present,
   );
   const undoLength = useSelector(
-    (state: RootState) => state.dashboardLayout.past.length,
+    (state: HeaderRootState) => state.dashboardLayout.past.length,
   );
   const redoLength = useSelector(
-    (state: RootState) => state.dashboardLayout.future.length,
+    (state: HeaderRootState) => state.dashboardLayout.future.length,
   );
-  const dataMask = useSelector((state: RootState) => state.dataMask);
-  const user = useSelector((state: RootState) => state.user);
+  const dataMask = useSelector((state: HeaderRootState) => state.dataMask);

Review Comment:
   I think datamask is not actually used? Like its passed to 
useHeaderActionsDropdownMenu, but its not really using datamask



-- 
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