From dab5dca61530c0742161bee3304766c4ff7bbf1b Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Fri, 20 Dec 2019 17:03:20 +0100 Subject: [PATCH] Visual improvements --- src/components/Filter/Filter.tsx | 9 +----- src/components/FilterBar/FilterBar.tsx | 43 ++++++++++++++------------ src/components/SearchBar/SearchBar.tsx | 43 ++++++++++++++------------ 3 files changed, 47 insertions(+), 48 deletions(-) diff --git a/src/components/Filter/Filter.tsx b/src/components/Filter/Filter.tsx index dbe8cd1e4..fd49209f1 100644 --- a/src/components/Filter/Filter.tsx +++ b/src/components/Filter/Filter.tsx @@ -4,7 +4,6 @@ import Popper from "@material-ui/core/Popper"; import { makeStyles } from "@material-ui/core/styles"; import { fade } from "@material-ui/core/styles/colorManipulator"; import Typography from "@material-ui/core/Typography"; -import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown"; import classNames from "classnames"; import React from "react"; import { FormattedMessage } from "react-intl"; @@ -97,14 +96,8 @@ const Filter: React.FC = props => { onClick={() => setFilterMenuOpened(!isFilterMenuOpened)} > - + - extends FilterProps, @@ -20,14 +19,15 @@ export interface FilterBarProps const useStyles = makeStyles( theme => ({ root: { + borderBottom: `1px solid ${theme.palette.divider}`, display: "flex", flexWrap: "wrap", padding: theme.spacing(1, 3) }, - tabActions: { - borderBottom: `1px solid ${theme.palette.divider}`, - padding: theme.spacing(1, 3, 2), - textAlign: "right" + tabActionButton: { + marginLeft: theme.spacing(2), + paddingLeft: theme.spacing(3), + paddingRight: theme.spacing(3) } }), { @@ -93,30 +93,33 @@ const FilterBar: React.FC = props => { placeholder={searchPlaceholder} onSearchChange={onSearchChange} /> - - {displayTabAction === null ? ( -
- ) : ( -
- {displayTabAction === "save" ? ( - + {displayTabAction && + (displayTabAction === "save" ? ( + ) : ( displayTabAction === "delete" && ( - + ) - )} -
- )} + ))} + ); }; diff --git a/src/components/SearchBar/SearchBar.tsx b/src/components/SearchBar/SearchBar.tsx index 9636c5ac0..17c66b4bb 100644 --- a/src/components/SearchBar/SearchBar.tsx +++ b/src/components/SearchBar/SearchBar.tsx @@ -1,11 +1,10 @@ import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import makeStyles from "@material-ui/core/styles/makeStyles"; +import Button from "@material-ui/core/Button"; import { SearchPageProps, TabPageProps } from "@saleor/types"; import FilterTabs, { FilterTab } from "../TableFilter"; -import Link from "../Link"; -import Hr from "../Hr"; import SearchInput from "./SearchInput"; export interface SearchBarProps extends SearchPageProps, TabPageProps { @@ -16,14 +15,15 @@ export interface SearchBarProps extends SearchPageProps, TabPageProps { const useStyles = makeStyles( theme => ({ root: { + borderBottom: `1px solid ${theme.palette.divider}`, display: "flex", flexWrap: "wrap", padding: theme.spacing(1, 3) }, - tabActions: { - borderBottom: `1px solid ${theme.palette.divider}`, - padding: theme.spacing(1, 3, 2), - textAlign: "right" + tabActionButton: { + marginLeft: theme.spacing(2), + paddingLeft: theme.spacing(3), + paddingRight: theme.spacing(3) } }), { @@ -81,30 +81,33 @@ const SearchBar: React.FC = props => { placeholder={searchPlaceholder} onSearchChange={onSearchChange} /> - - {displayTabAction === null ? ( -
- ) : ( -
- {displayTabAction === "save" ? ( - + {displayTabAction && + (displayTabAction === "save" ? ( + ) : ( displayTabAction === "delete" && ( - + ) - )} -
- )} + ))} + ); };