diff --git a/frontend/src/metabase/browse/components/SchemaBrowser.jsx b/frontend/src/metabase/browse/components/SchemaBrowser.jsx index 7ce937668fd1734e2532b65fb4df98c2e12b90e7..0302a4b5f92e2e9227a68be5f86c729dd7a03dfa 100644 --- a/frontend/src/metabase/browse/components/SchemaBrowser.jsx +++ b/frontend/src/metabase/browse/components/SchemaBrowser.jsx @@ -3,7 +3,7 @@ import cx from "classnames"; import { t } from "ttag"; import TableBrowser from "metabase/browse/containers/TableBrowser"; -import BrowserCrumbs from "metabase/components/BrowserCrumbs"; +import { BrowserCrumbs } from "metabase/components/BrowserCrumbs"; import Card from "metabase/components/Card"; import EntityItem from "metabase/components/EntityItem"; import { Grid } from "metabase/components/Grid"; diff --git a/frontend/src/metabase/browse/components/TableBrowser/TableBrowser.jsx b/frontend/src/metabase/browse/components/TableBrowser/TableBrowser.jsx index 5e49d16d503314c0b40275b1063be81294a4b26c..08b68df2e69f9c4d739ea17a0c110019a344903d 100644 --- a/frontend/src/metabase/browse/components/TableBrowser/TableBrowser.jsx +++ b/frontend/src/metabase/browse/components/TableBrowser/TableBrowser.jsx @@ -2,7 +2,7 @@ import PropTypes from "prop-types"; import { Fragment } from "react"; import { t } from "ttag"; -import BrowserCrumbs from "metabase/components/BrowserCrumbs"; +import { BrowserCrumbs } from "metabase/components/BrowserCrumbs"; import EntityItem from "metabase/components/EntityItem"; import Database from "metabase/entities/databases"; import { color } from "metabase/lib/colors"; diff --git a/frontend/src/metabase/components/BrowserCrumbs/BrowserCrumbs.jsx b/frontend/src/metabase/components/BrowserCrumbs/BrowserCrumbs.tsx similarity index 73% rename from frontend/src/metabase/components/BrowserCrumbs/BrowserCrumbs.jsx rename to frontend/src/metabase/components/BrowserCrumbs/BrowserCrumbs.tsx index 3620976789c73df280c4e5a4edfc49719b5c5689..15803a4ff6b7b19c052a91f967345f9ea15f30df 100644 --- a/frontend/src/metabase/components/BrowserCrumbs/BrowserCrumbs.jsx +++ b/frontend/src/metabase/components/BrowserCrumbs/BrowserCrumbs.tsx @@ -1,5 +1,5 @@ -/* eslint-disable react/prop-types */ import cx from "classnames"; +import type { ReactNode } from "react"; import CS from "metabase/css/core/index.css"; @@ -12,16 +12,23 @@ import { // TODO: merge with Breadcrumbs -const Crumb = ({ children }) => ( +const Crumb = ({ children }: { children: ReactNode }) => ( <h5 - className={cx(CS.textUppercase, "text-medium")} + className={cx(CS.textUppercase, CS.textMedium)} style={{ fontWeight: 900 }} > {children} </h5> ); -const BrowserCrumbs = ({ crumbs }) => ( +type BrowserCrumbsType = { + crumbs: { + title: string | ReactNode; + to?: string; + }[]; +}; + +export const BrowserCrumbs = ({ crumbs }: BrowserCrumbsType) => ( <BrowserCrumbsRoot data-testid="browsercrumbs"> {crumbs .filter(c => c) @@ -41,5 +48,3 @@ const BrowserCrumbs = ({ crumbs }) => ( ))} </BrowserCrumbsRoot> ); - -export default BrowserCrumbs; diff --git a/frontend/src/metabase/components/BrowserCrumbs/index.jsx b/frontend/src/metabase/components/BrowserCrumbs/index.jsx deleted file mode 100644 index 7f3a845944bff854ae486022db80663e92ae5fce..0000000000000000000000000000000000000000 --- a/frontend/src/metabase/components/BrowserCrumbs/index.jsx +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./BrowserCrumbs"; diff --git a/frontend/src/metabase/components/BrowserCrumbs/index.tsx b/frontend/src/metabase/components/BrowserCrumbs/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a79716629a72c9d5e8af2b17fd1e313fddc502fe --- /dev/null +++ b/frontend/src/metabase/components/BrowserCrumbs/index.tsx @@ -0,0 +1 @@ +export * from "./BrowserCrumbs"; diff --git a/frontend/src/metabase/containers/UserCollectionList.tsx b/frontend/src/metabase/containers/UserCollectionList.tsx index 9d7ac3c3659048ab393dc5254ba335b4497db583..f202d50fe7058514f3908d26f49547e1d7eccd17 100644 --- a/frontend/src/metabase/containers/UserCollectionList.tsx +++ b/frontend/src/metabase/containers/UserCollectionList.tsx @@ -1,5 +1,5 @@ import { useUserListQuery } from "metabase/common/hooks"; -import BrowserCrumbs from "metabase/components/BrowserCrumbs"; +import { BrowserCrumbs } from "metabase/components/BrowserCrumbs"; import Card from "metabase/components/Card"; import { Grid } from "metabase/components/Grid"; import PaginationControls from "metabase/components/PaginationControls";