diff --git a/locale/defaultMessages.json b/locale/defaultMessages.json index 5a8624870..99f7ef488 100644 --- a/locale/defaultMessages.json +++ b/locale/defaultMessages.json @@ -4847,6 +4847,9 @@ "context": "title", "string": "Reserved stock" }, + "X7jl6w": { + "string": "Orders" + }, "X8qjg3": { "context": "inactive", "string": "Inactive" diff --git a/src/home/components/HomeAnalyticsCard/HomeAnalyticsCard.tsx b/src/home/components/HomeAnalyticsCard/HomeAnalyticsCard.tsx index 38d8caa9d..d97a24363 100644 --- a/src/home/components/HomeAnalyticsCard/HomeAnalyticsCard.tsx +++ b/src/home/components/HomeAnalyticsCard/HomeAnalyticsCard.tsx @@ -1,92 +1,39 @@ -import { Card, CardContent, Typography } from "@material-ui/core"; -import { IconProps } from "@material-ui/core/Icon"; -import { makeStyles } from "@saleor/macaw-ui"; -import { vars } from "@saleor/macaw-ui/next"; +import { Box, Text } from "@saleor/macaw-ui/next"; import React from "react"; import { FormattedMessage } from "react-intl"; -const useStyles = makeStyles( - theme => ({ - cardContent: { - display: "grid", - gridColumnGap: theme.spacing(3), - gridTemplateColumns: "1fr 64px", - border: `1px solid ${vars.colors.border.neutralPlain}`, - borderRadius: vars.borderRadius[3], - }, - cardSpacing: { - [theme.breakpoints.down("sm")]: { - marginBottom: theme.spacing(1), - }, - marginBottom: theme.spacing(3), - }, - cardSubtitle: { - fontSize: 12, - height: "20px", - lineHeight: 0.9, - }, - cardTitle: { - fontSize: 20, - fontWeight: 500 as 500, - }, - icon: { - color: theme.palette.primary.contrastText, - fontSize: 54, - margin: ".5rem .3rem", - }, - iconBackground: { - backgroundColor: theme.palette.background.default, - borderRadius: "8px", - color: "white", - fontSize: "54px", - height: "100%", - padding: "10px 5px 0px 5px", - width: "100%", - }, - value: { - textAlign: "right", - }, - }), - { name: "HomeAnalyticsCard" }, -); - interface HomeAnalyticsCardProps { testId?: string; - icon: React.ReactElement; title: string; children?: React.ReactNode; } const HomeAnalyticsCard: React.FC = props => { - const { children, title, icon, testId } = props; - - const classes = useStyles(props); + const { children, title, testId } = props; return ( - - -
- - {title} - - - - - - {children} - -
-
{icon}
-
-
+ + + + {title} + + + + + + + {children} + + ); }; HomeAnalyticsCard.displayName = "HomeAnalyticsCard"; diff --git a/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx b/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx index 51a338885..29f8a12b7 100644 --- a/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx +++ b/src/home/components/HomeNotificationTable/HomeNotificationTable.tsx @@ -12,6 +12,7 @@ import { } from "@material-ui/core"; import KeyboardArrowRight from "@material-ui/icons/KeyboardArrowRight"; import { makeStyles } from "@saleor/macaw-ui"; +import { vars } from "@saleor/macaw-ui/next"; import React from "react"; import { useIntl } from "react-intl"; @@ -21,13 +22,22 @@ const useStyles = makeStyles( () => ({ arrowIcon: { textAlign: "right", - width: 100, + width: "100%", + display: "flex", + alignItems: "center", + justifyContent: "flex-end", }, tableCard: { overflow: "hidden", + borderRadius: 0, }, tableRow: { cursor: "pointer", + /* Table to be replaced with Box */ + "& .MuiTableCell-root": { + paddingLeft: `${vars.space[8]} !important`, + paddingRight: `${vars.space[8]} !important`, + }, }, cardContent: { padding: 0, diff --git a/src/home/components/HomePage/HomePage.tsx b/src/home/components/HomePage/HomePage.tsx index d9b9f5905..db28c6f43 100644 --- a/src/home/components/HomePage/HomePage.tsx +++ b/src/home/components/HomePage/HomePage.tsx @@ -6,39 +6,16 @@ import RequirePermissions from "@dashboard/components/RequirePermissions"; import Skeleton from "@dashboard/components/Skeleton"; import { HomeQuery, PermissionEnum } from "@dashboard/graphql"; import { RelayToFlat } from "@dashboard/types"; -import { makeStyles } from "@saleor/macaw-ui"; import { Box } from "@saleor/macaw-ui/next"; import React from "react"; +import { useIntl } from "react-intl"; -import Orders from "../../../icons/Orders"; -import Sales from "../../../icons/Sales"; import HomeActivityCard from "../HomeActivityCard"; import HomeAnalyticsCard from "../HomeAnalyticsCard"; import HomeHeader from "../HomeHeader"; import HomeNotificationTable from "../HomeNotificationTable/HomeNotificationTable"; import HomeProductListCard from "../HomeProductListCard"; - -const useStyles = makeStyles( - theme => ({ - cardContainer: { - display: "grid", - gridColumnGap: theme.spacing(3), - gridTemplateColumns: "1fr 1fr", - [theme.breakpoints.down("sm")]: { - gridColumnGap: theme.spacing(1), - }, - [theme.breakpoints.down("xs")]: { - gridTemplateColumns: "1fr", - }, - }, - icon: { - "& path": { - fill: theme.palette.primary.main, - }, - }, - }), - { name: "HomePage" }, -); +import { homePageMessages } from "./messages"; export interface HomePageProps { activities: RelayToFlat; @@ -72,8 +49,7 @@ const HomePage: React.FC = props => { productsOutOfStock = 0, noChannel, } = props; - - const classes = useStyles(props); + const intl = useIntl(); return ( @@ -84,17 +60,15 @@ const HomePage: React.FC = props => { -
+ - } > {noChannel ? ( 0 @@ -105,15 +79,8 @@ const HomePage: React.FC = props => { )} - } > {noChannel ? ( 0 @@ -123,7 +90,7 @@ const HomePage: React.FC = props => { )} -
+