| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Button, |
| | | useTranslate, |
| | | } from 'react-admin'; |
| | | import { Fab, useMediaQuery } from '@mui/material'; |
| | | import ContentAdd from '@mui/icons-material/Add'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import { Link } from 'react-router-dom'; |
| | | import { Button, useTranslate } from "react-admin"; |
| | | import { Fab, useMediaQuery } from "@mui/material"; |
| | | import ContentAdd from "@mui/icons-material/Add"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import { Link } from "react-router-dom"; |
| | | |
| | | const MyCreateButton = (props) => { |
| | | const translate = useTranslate(); |
| | | |
| | | const isSmall = useMediaQuery((theme) => |
| | | theme.breakpoints.down('md') |
| | | ); |
| | | const isSmall = useMediaQuery((theme) => theme.breakpoints.down("md")); |
| | | |
| | | return isSmall ? ( |
| | | <StyledFab |
| | |
| | | {defaultIcon} |
| | | </StyledButton> |
| | | ); |
| | | } |
| | | }; |
| | | |
| | | const label = 'ra.action.create'; |
| | | const PREFIX = 'RaCreateButton'; |
| | | const label = "ra.action.create"; |
| | | const PREFIX = "RaCreateButton"; |
| | | const defaultIcon = <ContentAdd />; |
| | | |
| | | export const CreateButtonClasses = { |
| | |
| | | [`&.${CreateButtonClasses.floating}`]: { |
| | | color: theme.palette.getContrastText(theme.palette.primary.main), |
| | | margin: 0, |
| | | top: 'auto', |
| | | top: "auto", |
| | | right: 20, |
| | | bottom: 60, |
| | | left: 'auto', |
| | | position: 'fixed', |
| | | left: "auto", |
| | | position: "fixed", |
| | | zIndex: 1000, |
| | | }, |
| | | })); |