diff --git a/client/components/CubePreview.js b/client/components/CubePreview.js index 6f77c1fe8..4b8fd4ace 100644 --- a/client/components/CubePreview.js +++ b/client/components/CubePreview.js @@ -16,57 +16,38 @@ * * Modified from the original version in CubeCobra. See LICENSE.CubeCobra for more information. */ -import React, { useCallback, useState } from 'react'; +import React from 'react'; +import { Card, CardActionArea, CardContent, CardMedia, Link, Typography } from '@mui/material'; import CubePropType from '@cubeartisan/client/proptypes/CubePropType.js'; - -import { Card } from 'reactstrap'; - -import AspectRatioBox from '@cubeartisan/client/components/AspectRatioBox.js'; - import { getCubeDescription, getCubeId } from '@cubeartisan/client/utils/Util.js'; -const CubePreview = ({ cube }) => { - const [hover, setHover] = useState(false); - const handleMouseOver = useCallback((event) => setHover(!event.target.getAttribute('data-sublink')), []); - const handleMouseOut = useCallback(() => setHover(false), []); - const handleClick = useCallback( - (event) => { - if (!event.target.getAttribute('data-sublink')) { - window.location.href = `/cube/${encodeURIComponent(getCubeId(cube))}`; - } - }, - [cube], - ); - - return ( - - - - Art by {cube.image_artist} - - - +const CubePreview = ({ cube }) => ( + + + + + + Art by {cube.image_artist} + + {cube.name} - - {getCubeDescription(cube)} - - Designed by{' '} - - {cube.owner_name} - - - - - ); -}; + + + {getCubeDescription(cube)} + + + Designed by {cube.owner_name} + + + + +); CubePreview.propTypes = { cube: CubePropType.isRequired, diff --git a/client/components/layouts/MainLayout.js b/client/components/layouts/MainLayout.js index 8df77e30a..b5b8c96d3 100644 --- a/client/components/layouts/MainLayout.js +++ b/client/components/layouts/MainLayout.js @@ -30,23 +30,24 @@ import SiteAppBar from '@cubeartisan/client/components/SiteAppBar.js'; * @type ComponentType */ const MainLayout = ({ children, loginCallback }) => ( - - - + <> + + + + + + {children} + + + + + - - - {children} - - - - - - + > ); MainLayout.propTypes = { children: PropTypes.node.isRequired, diff --git a/client/components/wrappers/Suspense.js b/client/components/wrappers/Suspense.js index ff3020caa..4026f608e 100644 --- a/client/components/wrappers/Suspense.js +++ b/client/components/wrappers/Suspense.js @@ -1,10 +1,10 @@ import React, { Suspense as ReactSuspense } from 'react'; import PropTypes from 'prop-types'; -import { Spinner } from 'reactstrap'; +import { CircularProgress } from '@mui/material'; -const Suspense = ({ ...props }) => { +const Suspense = ({ fallback, ...props }) => { if (typeof window !== 'undefined') { - return ; + return ; } return null; }; @@ -12,7 +12,6 @@ Suspense.propTypes = { fallback: PropTypes.node, }; Suspense.defaultProps = { - fallback: , + fallback: , }; - export default Suspense; diff --git a/loosely-type-checked-files.json b/loosely-type-checked-files.json index 80078f6c0..5924baaf1 100644 --- a/loosely-type-checked-files.json +++ b/loosely-type-checked-files.json @@ -17,6 +17,7 @@ "client/components/CompareView.js", "client/components/CubeCompareNavbar.js", "client/components/CubeListNavbar.js", + "client/components/CubePreview.js", "client/components/CubeSearchNavBar.js", "client/components/CubesCard.js", "client/components/CustomPackCard.js", @@ -52,8 +53,10 @@ "client/components/contexts/UserContext.js", "client/components/hoc/WithAutocard.js", "client/components/hoc/WithFoilOverlay.js", + "client/components/hoc/WithModal.js", "client/components/layouts/UserLayout.js", "client/components/markdown/ExternalLink.js", + "client/components/markdown/Markdown.js", "client/components/markdown/MarkdownCardImage.js", "client/components/markdown/MarkdownCardLink.js", "client/components/modals/AddGroupToCubeModal.js", @@ -71,12 +74,13 @@ "client/components/modals/LoginModal.js", "client/components/modals/ResizeModal.js", "client/components/modals/SampleHandModal.js", - "client/components/wrappers/Suspense.js", "client/drafting/createdraft.js", "client/drafting/draftutil.js", "client/filtering/FuncOperations.js", "client/generated/filtering/cardFilters.js", + "client/pages/AdminCommentsPage.js", "client/pages/ArticlePage.js", + "client/pages/ArticlesPage.js", "client/pages/BlogPostPage.js", "client/pages/BrowsePackagesPage.js", "client/pages/BulkUploadPage.js", @@ -103,9 +107,12 @@ "client/pages/LoginPage.js", "client/pages/LostPasswordPage.js", "client/pages/PasswordResetPage.js", + "client/pages/PodcastEpisodePage.js", "client/pages/PodcastPage.js", + "client/pages/PodcastsPage.js", "client/pages/RecentDraftsPage.js", "client/pages/RegisterPage.js", + "client/pages/SearchPage.js", "client/pages/UserAccountPage.js", "client/pages/UserBlogPage.js", "client/pages/UserCubePage.js", diff --git a/typings/client/components/CubePreview.d.ts.map b/typings/client/components/CubePreview.d.ts.map index 3a11152c3..0da7282d1 100644 --- a/typings/client/components/CubePreview.d.ts.map +++ b/typings/client/components/CubePreview.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"CubePreview.d.ts","sourceRoot":"","sources":["../../../client/components/CubePreview.js"],"names":[],"mappings":";AA4BA;;gBAwCC"} \ No newline at end of file +{"version":3,"file":"CubePreview.d.ts","sourceRoot":"","sources":["../../../client/components/CubePreview.js"],"names":[],"mappings":";AAwBA;;gBAyBC"} \ No newline at end of file diff --git a/typings/client/components/layouts/MainLayout.d.ts.map b/typings/client/components/layouts/MainLayout.d.ts.map index 8626e55ee..27e296f86 100644 --- a/typings/client/components/layouts/MainLayout.d.ts.map +++ b/typings/client/components/layouts/MainLayout.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MainLayout.d.ts","sourceRoot":"","sources":["../../../../client/components/layouts/MainLayout.js"],"names":[],"mappings":";wBA2Bc,OAAO,OAAO,EAAE,SAAS;4BACzB,OAAO,OAAO,EAAE,iBAAiB,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAFhG;;;;GAIG;AACH,0BAFS,aAAa,CAoBpB"} \ No newline at end of file +{"version":3,"file":"MainLayout.d.ts","sourceRoot":"","sources":["../../../../client/components/layouts/MainLayout.js"],"names":[],"mappings":";wBA2Bc,OAAO,OAAO,EAAE,SAAS;4BACzB,OAAO,OAAO,EAAE,iBAAiB,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAFhG;;;;GAIG;AACH,0BAFS,aAAa,CAqBpB"} \ No newline at end of file diff --git a/typings/client/components/wrappers/Suspense.d.ts b/typings/client/components/wrappers/Suspense.d.ts index ef7141fe4..31fa652c5 100644 --- a/typings/client/components/wrappers/Suspense.d.ts +++ b/typings/client/components/wrappers/Suspense.d.ts @@ -1,6 +1,7 @@ export default Suspense; -declare function Suspense({ ...props }: { +declare function Suspense({ fallback, ...props }: { [x: string]: any; + fallback: any; }): JSX.Element; declare namespace Suspense { namespace propTypes { diff --git a/typings/client/components/wrappers/Suspense.d.ts.map b/typings/client/components/wrappers/Suspense.d.ts.map index e74a960e0..cbdc022da 100644 --- a/typings/client/components/wrappers/Suspense.d.ts.map +++ b/typings/client/components/wrappers/Suspense.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Suspense.d.ts","sourceRoot":"","sources":["../../../../client/components/wrappers/Suspense.js"],"names":[],"mappings":";AAIA;;gBAKC"} \ No newline at end of file +{"version":3,"file":"Suspense.d.ts","sourceRoot":"","sources":["../../../../client/components/wrappers/Suspense.js"],"names":[],"mappings":";AAIA;;;gBAKC"} \ No newline at end of file