diff --git a/src/apps/components/HorizontalSpacer/HorizontalSpacer.stories.tsx b/src/apps/components/HorizontalSpacer/HorizontalSpacer.stories.tsx index 2bc42bab160..753f337665b 100644 --- a/src/apps/components/HorizontalSpacer/HorizontalSpacer.stories.tsx +++ b/src/apps/components/HorizontalSpacer/HorizontalSpacer.stories.tsx @@ -15,7 +15,7 @@ const HelperWrapper: React.FC = ({ children }) => ( const Text: React.FC = () => {"<- The spacer is here"}; -storiesOf("Generic / Horizontal Spacer", module) +storiesOf("Generics / Horizontal Spacer", module) .addDecorator(Decorator) .add("without", () => ( diff --git a/src/channels/components/ShippingZonesCard/ShippingZoneItem.tsx b/src/channels/components/ShippingZonesCard/ShippingZoneItem.tsx index 895c4dc0f1f..6927fe2475c 100644 --- a/src/channels/components/ShippingZonesCard/ShippingZoneItem.tsx +++ b/src/channels/components/ShippingZonesCard/ShippingZoneItem.tsx @@ -1,21 +1,9 @@ import { Divider, Typography } from "@material-ui/core"; -import { makeStyles } from "@material-ui/core/styles"; import { ChannelShippingZone } from "@saleor/channels/pages/ChannelDetailsPage/types"; import DeletableItem from "@saleor/components/DeletableItem"; import React from "react"; -const useStyles = makeStyles( - theme => ({ - container: { - paddingLeft: theme.spacing(3), - display: "flex", - flexDirection: "row", - justifyContent: "space-between", - alignItems: "center" - } - }), - { name: "ShippingZoneItem" } -); +import useStyles from "./styles"; interface ShippingZoneItemProps { zone: ChannelShippingZone; diff --git a/src/channels/components/ShippingZonesCard/ShippingZonesCard.tsx b/src/channels/components/ShippingZonesCard/ShippingZonesCard.tsx index 090e050f221..91971bc1171 100644 --- a/src/channels/components/ShippingZonesCard/ShippingZonesCard.tsx +++ b/src/channels/components/ShippingZonesCard/ShippingZonesCard.tsx @@ -6,13 +6,13 @@ import { Typography } from "@material-ui/core"; import CardTitle from "@saleor/components/CardTitle"; -import { makeStyles } from "@saleor/macaw-ui"; import React from "react"; import { defineMessages, useIntl } from "react-intl"; import ShippingZoneItem from "./ShippingZoneItem"; import ShippingZonesCardListFooter from "./ShippingZonesCardListFooter"; import ShippingZonesListHeader from "./ShippingZonesListHeader"; +import { useExpanderStyles } from "./styles"; import { ShippingZonesProps } from "./types"; const messages = defineMessages({ @@ -27,26 +27,6 @@ const messages = defineMessages({ } }); -const useExpanderStyles = makeStyles( - () => ({ - // empty expanded needed for mui to use root styles - expanded: {}, - root: { - boxShadow: "none", - - "&:before": { - content: "none" - }, - - "&$expanded": { - margin: 0, - border: "none" - } - } - }), - { name: "ShippingZonesCardExpander" } -); - type ShippingZonesCardProps = ShippingZonesProps; const ShippingZonesCard: React.FC = props => { diff --git a/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx b/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx index 1755fbcbe36..4affd5b0b8f 100644 --- a/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx +++ b/src/channels/components/ShippingZonesCard/ShippingZonesCardListFooter.tsx @@ -6,6 +6,7 @@ import { mapNodeToChoice } from "@saleor/utils/maps"; import React, { useEffect, useRef, useState } from "react"; import { defineMessages } from "react-intl"; +import useStyles from "./styles"; import { ShippingZonesProps } from "./types"; const messages = defineMessages({ @@ -24,6 +25,8 @@ const ShippingZonesCardListFooter: React.FC = addShippingZone, shippingZones }) => { + const classes = useStyles(); + const [isChoicesSelectShown, setIsChoicesSelectShown] = useState(false); const shippingZonesRef = useRef(shippingZones); @@ -49,7 +52,7 @@ const ShippingZonesCardListFooter: React.FC = return isChoicesSelectShown ? ( -
+
({ + expanded: {}, + root: { + boxShadow: "none", + padding: theme.spacing(1, 4), + + "&:before": { + content: "none" + }, + + "&$expanded": { + margin: 0, + border: "none" + } + } + }), + { name: "Expander" } +); + +const useStyles = makeStyles( + theme => ({ + container: { + padding: theme.spacing(1, 0), + display: "flex", + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center" + }, + root: { + paddingRight: theme.spacing(1) + } + }), + { name: "ShippingZonesCard" } +); + +export default useStyles; diff --git a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx index 71c220cbb4c..aac5a17dec3 100644 --- a/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx +++ b/src/components/AssignAttributeDialog/AssignAttributeDialog.tsx @@ -51,6 +51,7 @@ const useStyles = makeStyles( loadMoreLoaderContainer: { alignItems: "center", display: "flex", + marginTop: theme.spacing(2), height: theme.spacing(3), justifyContent: "center" }, @@ -146,7 +147,7 @@ const AssignAttributeDialog: React.FC = ({ id={scrollableTargetId} > = ({ return (
= ({ <>
({ - ...prevVal, - [currVal.id]: { - availableLabel: "Available", - availableSecondLabel: "Will become available", - hiddenSecondLabel: "Will become published" - } - }), - {} as Messages - )} + messages={{ + availableLabel: "Available", + availableSecondLabel: "Will become available", + unavailableLabel: "Lorem Ipsum", + visibleSecondLabel: "Dolor Sit Amet", + hiddenSecondLabel: "Will become published", + hiddenLabel: "Hidden", + visibleLabel: "Visible", + availableDateText: "available from 07/30/2020", + setAvailabilityDateLabel: "xd4" + }} /> )); diff --git a/src/components/ChannelsAvailabilityCard/styles.ts b/src/components/ChannelsAvailabilityCard/styles.ts index 3e721a5ac13..335254af956 100644 --- a/src/components/ChannelsAvailabilityCard/styles.ts +++ b/src/components/ChannelsAvailabilityCard/styles.ts @@ -57,13 +57,16 @@ export const useStyles = makeStyles( position: "relative" }, label: { - lineHeight: 1.2, - marginBottom: 5, - marginTop: 0 + lineHeight: 1.2 }, listingLabel: { marginTop: 9 }, + radioLabel: { + "& > span": { + padding: theme.spacing(0, 0.5) + } + }, rotate: { transform: "rotate(180deg)" }, diff --git a/src/components/DeletableItem/DeletableItem.tsx b/src/components/DeletableItem/DeletableItem.tsx index ed28b6a11c0..b37d59a14b5 100644 --- a/src/components/DeletableItem/DeletableItem.tsx +++ b/src/components/DeletableItem/DeletableItem.tsx @@ -1,34 +1,18 @@ -import { makeStyles } from "@material-ui/core/styles"; -import TrashIcon from "@saleor/icons/Trash"; +import { DeleteIcon, IconButton } from "@saleor/macaw-ui"; import React from "react"; -const useStyles = makeStyles( - theme => ({ - container: { - cursor: "pointer", - padding: theme.spacing(3), - display: "flex", - justifyContent: "center", - alignItems: "center" - } - }), - { name: "DeletableItem" } -); - interface DeletableItemProps { onDelete: (id: string) => void; id: string; } const DeletableItem: React.FC = ({ onDelete, id }) => { - const classes = useStyles({}); - const handleDelete = () => onDelete(id); return ( -
- -
+ + + ); }; diff --git a/src/components/FilterBar/FilterBar.tsx b/src/components/FilterBar/FilterBar.tsx index caa17342ee3..61cff2f3dda 100644 --- a/src/components/FilterBar/FilterBar.tsx +++ b/src/components/FilterBar/FilterBar.tsx @@ -22,12 +22,12 @@ const useStyles = makeStyles( borderBottom: `1px solid ${theme.palette.divider}`, display: "flex", flexWrap: "wrap", - padding: theme.spacing(1, 3) + padding: theme.spacing(1, 4) }, tabActionButton: { marginLeft: theme.spacing(2), - paddingLeft: theme.spacing(3), - paddingRight: theme.spacing(3) + paddingLeft: theme.spacing(4), + paddingRight: theme.spacing(4) } }), { diff --git a/src/components/LinkChoice/LinkChoice.tsx b/src/components/LinkChoice/LinkChoice.tsx index 149297b28ff..d975cfc68dc 100644 --- a/src/components/LinkChoice/LinkChoice.tsx +++ b/src/components/LinkChoice/LinkChoice.tsx @@ -23,7 +23,8 @@ const useStyles = makeStyles( menuItem: { "&:not(:last-of-type)": { marginBottom: theme.spacing() - } + }, + borderRadius: 4 }, paper: { padding: theme.spacing() diff --git a/src/components/Metadata/MetadataCard.tsx b/src/components/Metadata/MetadataCard.tsx index 0b91611f717..d3e5cd9dd65 100644 --- a/src/components/Metadata/MetadataCard.tsx +++ b/src/components/Metadata/MetadataCard.tsx @@ -203,7 +203,7 @@ const MetadataCard: React.FC = ({ )} - + - + node.onChange({ id: node.id as any, diff --git a/src/navigation/components/MenuList/MenuList.tsx b/src/navigation/components/MenuList/MenuList.tsx index c3503a409b3..f2abcdc6d72 100644 --- a/src/navigation/components/MenuList/MenuList.tsx +++ b/src/navigation/components/MenuList/MenuList.tsx @@ -41,7 +41,7 @@ const useStyles = makeStyles( colTitle: {} }, colAction: { - width: 80 + width: 84 }, colItems: { textAlign: "right" diff --git a/src/pages/components/PageList/PageList.tsx b/src/pages/components/PageList/PageList.tsx index fe5b3d1c36e..82ac394b328 100644 --- a/src/pages/components/PageList/PageList.tsx +++ b/src/pages/components/PageList/PageList.tsx @@ -170,13 +170,13 @@ const PageList: React.FC = props => { onChange={() => toggle(page.id)} /> - + {maybe(() => page.title, )} - - + + {maybe(() => page.slug, )} - - + + {maybe( () => ( = props => { ), )} - + ); }, diff --git a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx index 0601d22a3c5..9ea11d7f891 100644 --- a/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx +++ b/src/productTypes/components/ProductTypeAttributes/ProductTypeAttributes.tsx @@ -27,7 +27,7 @@ const useStyles = makeStyles( "&:last-child": { paddingRight: 0 }, - width: 80 + width: 84 }, colGrab: { width: 60 @@ -104,6 +104,7 @@ const ProductTypeAttributes: React.FC = props => { } toolbar={