Visual improvements

This commit is contained in:
dominik-zeglen 2020-09-08 12:14:13 +02:00
parent e8a69cd9fc
commit 3d571e3f4f
3 changed files with 18 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import Portal from "@material-ui/core/Portal";
import { makeStyles } from "@material-ui/core/styles"; import { makeStyles } from "@material-ui/core/styles";
import useWindowScroll from "@saleor/hooks/useWindowScroll"; import useWindowScroll from "@saleor/hooks/useWindowScroll";
import { buttonMessages } from "@saleor/intl"; import { buttonMessages } from "@saleor/intl";
import classNames from "classnames";
import React from "react"; import React from "react";
import { useIntl } from "react-intl"; import { useIntl } from "react-intl";
@ -17,12 +18,21 @@ import Container from "../Container";
const useStyles = makeStyles( const useStyles = makeStyles(
theme => ({ theme => ({
applyShadow: {
"&$card": {
boxShadow: "0px 6px 30px rgba(0, 0, 0, 0.16)"
}
},
button: { button: {
marginRight: theme.spacing(1) marginRight: theme.spacing(1)
}, },
cancelButton: { cancelButton: {
marginRight: theme.spacing(2) marginRight: theme.spacing(2)
}, },
card: {
boxShadow: "0px 0px 0px rgba(0, 0, 0, 0.16)",
transition: theme.transitions.duration.shortest + "ms"
},
content: { content: {
"&:last-child": { "&:last-child": {
paddingBottom: theme.spacing(2) paddingBottom: theme.spacing(2)
@ -88,7 +98,11 @@ export const SaveButtonBar: React.FC<SaveButtonBarProps> = props => {
<Portal container={anchor.current}> <Portal container={anchor.current}>
<div className={classes.root} {...rest}> <div className={classes.root} {...rest}>
<Container> <Container>
<Card elevation={scrolledToBottom ? 0 : 16}> <Card
className={classNames(classes.card, {
[classes.applyShadow]: !scrolledToBottom
})}
>
<CardContent className={classes.content}> <CardContent className={classes.content}>
{!!onDelete && ( {!!onDelete && (
<Button <Button

View file

@ -75,7 +75,7 @@ const useStyles = makeStyles(
rootActive: { rootActive: {
"&$root": { "&$root": {
background: theme.palette.background.paper, background: theme.palette.background.paper,
boxShadow: `9px 9px 20px 0 ${theme.palette.grey[300]}`, boxShadow: "0px 6px 30px rgba(0, 0, 0, 0.16)",
color: theme.palette.primary.main color: theme.palette.primary.main
} }
}, },

View file

@ -28,7 +28,8 @@ const useStyles = makeStyles(
}, },
root: { root: {
transition: "width 0.5s ease", transition: "width 0.5s ease",
width: menuWidth width: menuWidth,
zIndex: 100
}, },
rootShrink: { rootShrink: {
width: shrunkMenuWidth width: shrunkMenuWidth