skyouc
2025-03-11 0edbe07e9355fc22d6fbc55a70f2230a4b30101a
rsf-admin/src/page/components/MyCreateButton.jsx
@@ -1,19 +1,13 @@
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
@@ -35,10 +29,10 @@
            {defaultIcon}
        </StyledButton>
    );
}
};
const label = 'ra.action.create';
const PREFIX = 'RaCreateButton';
const label = "ra.action.create";
const PREFIX = "RaCreateButton";
const defaultIcon = <ContentAdd />;
export const CreateButtonClasses = {
@@ -53,11 +47,11 @@
    [`&.${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,
    },
}));