From 3446ea0f20c2246e8089f376f6e4e1f40b01c25e Mon Sep 17 00:00:00 2001 From: zyhou Date: Wed, 12 Jun 2019 14:49:40 +0200 Subject: [PATCH 1/2] Use makeStyles hooks on examples demo --- .../src/categories/LinkToRelatedProducts.js | 11 +- .../demo/src/configuration/Configuration.js | 18 +- examples/demo/src/dashboard/CardIcon.js | 21 +- examples/demo/src/dashboard/MonthlyRevenue.js | 11 +- examples/demo/src/dashboard/NbNewOrders.js | 11 +- examples/demo/src/dashboard/Welcome.js | 11 +- examples/demo/src/layout/AppBar.js | 35 ++-- examples/demo/src/orders/MobileGrid.js | 11 +- examples/demo/src/orders/OrderEdit.js | 70 ++++--- examples/demo/src/orders/OrderList.js | 19 +- examples/demo/src/products/GridList.js | 125 ++++++------ examples/demo/src/products/Poster.js | 23 ++- examples/demo/src/products/ProductCreate.js | 121 +++++------ examples/demo/src/products/ProductEdit.js | 120 +++++------ examples/demo/src/products/ProductList.js | 11 +- examples/demo/src/products/ThumbnailField.js | 13 +- examples/demo/src/reviews/ReviewEdit.js | 99 ++++----- .../demo/src/reviews/ReviewEditToolbar.js | 62 +++--- examples/demo/src/reviews/ReviewFilter.js | 61 +++--- .../demo/src/reviews/ReviewListDesktop.js | 41 ++-- examples/demo/src/reviews/ReviewListMobile.js | 150 +++++++------- .../src/segments/LinkToRelatedCustomers.js | 11 +- examples/demo/src/visitors/MobileGrid.js | 12 +- examples/demo/src/visitors/SegmentInput.js | 17 +- examples/demo/src/visitors/VisitorCreate.js | 81 ++++---- examples/demo/src/visitors/VisitorEdit.js | 188 ++++++++++-------- examples/demo/src/visitors/VisitorList.js | 73 +++---- 27 files changed, 748 insertions(+), 678 deletions(-) diff --git a/examples/demo/src/categories/LinkToRelatedProducts.js b/examples/demo/src/categories/LinkToRelatedProducts.js index a7c27f338cb..a706dee34d5 100644 --- a/examples/demo/src/categories/LinkToRelatedProducts.js +++ b/examples/demo/src/categories/LinkToRelatedProducts.js @@ -1,22 +1,23 @@ import React from 'react'; import Button from '@material-ui/core/Button'; -import { withStyles } from '@material-ui/core/styles'; +import { makeStyles } from '@material-ui/core/styles'; import { Link } from 'react-router-dom'; import { useTranslate } from 'react-admin'; import { stringify } from 'query-string'; import products from '../products'; -const styles = { +const useStyles = makeStyles({ icon: { paddingRight: '0.5em' }, link: { display: 'inline-flex', alignItems: 'center', }, -}; +}); -const LinkToRelatedProducts = ({ classes, record }) => { +const LinkToRelatedProducts = ({ record }) => { const translate = useTranslate(); + const classes = useStyles(); return (