Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
import * as React from 'react';
|
|
import Button from '@mui/material/Button';
|
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
import Switch from '@mui/material/Switch';
|
|
import SaveIcon from '@mui/icons-material/Save';
|
|
import SendIcon from '@mui/icons-material/Send';
|
|
|
|
export default function FullWidthLoadingButtonsTransition() {
|
|
const [loading, setLoading] = React.useState(true);
|
|
function handleClick() {
|
|
setLoading(true);
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<FormControlLabel
|
|
sx={{
|
|
display: 'block',
|
|
}}
|
|
control={
|
|
<Switch
|
|
checked={loading}
|
|
onChange={() => setLoading(!loading)}
|
|
name="loading"
|
|
color="primary"
|
|
/>
|
|
}
|
|
label="Loading"
|
|
/>
|
|
<Button onClick={handleClick} loading={loading} variant="outlined" fullWidth>
|
|
Fetch data
|
|
</Button>
|
|
<Button
|
|
onClick={handleClick}
|
|
endIcon={<SendIcon />}
|
|
loading={loading}
|
|
loadingPosition="end"
|
|
variant="contained"
|
|
fullWidth
|
|
>
|
|
Send
|
|
</Button>
|
|
<Button
|
|
color="secondary"
|
|
onClick={handleClick}
|
|
loading={loading}
|
|
loadingPosition="start"
|
|
startIcon={<SaveIcon />}
|
|
variant="contained"
|
|
fullWidth
|
|
>
|
|
Save
|
|
</Button>
|
|
</div>
|
|
);
|
|
}
|