mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
eslint
This commit is contained in:
parent
cc79470bd4
commit
91af908327
File diff suppressed because it is too large
Load Diff
|
|
@ -104,7 +104,10 @@ function LoginForm (){
|
|||
}
|
||||
|
||||
useEffect(() => {
|
||||
refreshCaptcha()
|
||||
if (loginCaptcha){
|
||||
refreshCaptcha()
|
||||
}
|
||||
|
||||
},[])
|
||||
|
||||
const login = e=>{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
import React from "react";
|
||||
import { makeStyles, useTheme } from "@material-ui/core";
|
||||
import Button from "@material-ui/core/Button";
|
||||
import SpeedDial from "@material-ui/lab/SpeedDial";
|
||||
import SpeedDialIcon from "@material-ui/lab/SpeedDialIcon";
|
||||
import SpeedDialAction from "@material-ui/lab/SpeedDialAction";
|
||||
import FileCopyIcon from "@material-ui/icons/FileCopyOutlined";
|
||||
import SaveIcon from "@material-ui/icons/Save";
|
||||
import PrintIcon from "@material-ui/icons/Print";
|
||||
import ShareIcon from "@material-ui/icons/Share";
|
||||
import FavoriteIcon from "@material-ui/icons/Favorite";
|
||||
import EditIcon from "@material-ui/icons/Edit";
|
||||
import AddIcon from "@material-ui/icons/Add";
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
fab: {
|
||||
margin: 0,
|
||||
top: "auto",
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left: "auto",
|
||||
zIndex: 5,
|
||||
position: "fixed"
|
||||
}
|
||||
}));
|
||||
|
||||
const actions = [
|
||||
{ icon: <FileCopyIcon />, name: "Copy" },
|
||||
{ icon: <SaveIcon />, name: "Save" },
|
||||
{ icon: <PrintIcon />, name: "Print" },
|
||||
{ icon: <ShareIcon />, name: "Share" },
|
||||
{ icon: <FavoriteIcon />, name: "Like" }
|
||||
];
|
||||
|
||||
export default function UploadButton() {
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [hidden, setHidden] = React.useState(false);
|
||||
|
||||
const theme = useTheme();
|
||||
const classes = useStyles();
|
||||
const transitionDuration = {
|
||||
enter: theme.transitions.duration.enteringScreen,
|
||||
exit: theme.transitions.duration.leavingScreen
|
||||
};
|
||||
|
||||
const handleVisibility = () => {
|
||||
setHidden(prevHidden => !prevHidden);
|
||||
};
|
||||
|
||||
const handleOpen = () => {
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<SpeedDial
|
||||
ariaLabel="SpeedDial openIcon example"
|
||||
className={classes.fab}
|
||||
hidden={hidden}
|
||||
icon={<SpeedDialIcon openIcon={<EditIcon />} />}
|
||||
onClose={handleClose}
|
||||
onOpen={handleOpen}
|
||||
open={open}
|
||||
>
|
||||
{actions.map(action => (
|
||||
<SpeedDialAction
|
||||
key={action.name}
|
||||
icon={action.icon}
|
||||
tooltipTitle={action.name}
|
||||
onClick={handleClose}
|
||||
/>
|
||||
))}
|
||||
</SpeedDial>
|
||||
);
|
||||
}
|
||||
|
|
@ -7,7 +7,6 @@ import AddIcon from '@material-ui/icons/AddCircleOutline';
|
|||
import MusicIcon from '@material-ui/icons/MusicNote';
|
||||
import DeleteIcon from '@material-ui/icons/Delete';
|
||||
import { isWidthDown } from '@material-ui/core/withWidth';
|
||||
|
||||
import {
|
||||
withStyles,
|
||||
Dialog,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import scriptLoader from "../loader/index.js";
|
|||
import { connect } from "react-redux";
|
||||
import { refreshFileList, refreshStorage } from "../actions/index";
|
||||
import FileList from "./Upload/FileList.js";
|
||||
import UploadButton from "./Upload/Fab.js";
|
||||
import Auth from "../middleware/Auth"
|
||||
|
||||
let loaded = false;
|
||||
|
|
@ -116,12 +117,22 @@ class UploaderCompoment extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
// componentDidMount() {
|
||||
// // const { isScriptLoaded, isScriptLoadSucceed } = this.props
|
||||
// // if (isScriptLoaded && isScriptLoadSucceed) {
|
||||
// // }
|
||||
componentDidMount() {
|
||||
this.prev = window.scrollY;
|
||||
window.addEventListener('scroll', e => this.handleNavigation(e));
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
handleNavigation = (e) => {
|
||||
const window = e.currentTarget;
|
||||
|
||||
if (this.prev > window.scrollY) {
|
||||
console.log("scrolling up");
|
||||
} else if (this.prev < window.scrollY) {
|
||||
console.log("scrolling down");
|
||||
}
|
||||
this.prev = window.scrollY;
|
||||
};
|
||||
|
||||
onError() {}
|
||||
|
||||
|
|
@ -136,6 +147,7 @@ class UploaderCompoment extends Component {
|
|||
inRef={this.setRef.bind(this)}
|
||||
cancelUpload={this.cancelUpload.bind(this)}
|
||||
/>
|
||||
<UploadButton/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue