Skip to content

Commit

Permalink
Refactor LoadingButton
Browse files Browse the repository at this point in the history
  • Loading branch information
jtklein committed Sep 30, 2024
1 parent a34f1ee commit 0d6a2d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 0 additions & 5 deletions src/app/AlignmentCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,7 @@ function _ModelTestButton({ alignment }) {
}
return (
<LoadingButton
variant="contained"
color="default"
style={{ marginLeft: 10 }}
classes={{
root: classes.primaryButton,
}}
loading={alignment.modeltestLoading}
onClick={alignment.runModelTest}
disabled={alignment.modeltestDisabled}
Expand Down
5 changes: 0 additions & 5 deletions src/app/Raxml.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ class Raxml extends React.Component {
</Button>
) : null}
<LoadingButton
variant="contained"
color="default"
classes={{
root: classes.primaryButton,
}}
loading={run.running}
disabled={run.startDisabled}
onClick={run.start}
Expand Down
10 changes: 9 additions & 1 deletion src/app/components/LoadingButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ function LoadingButton(props) {
return (
<div className={clsx(classes.wrapper, className)}>
<Button
variant="contained"
disabled={disabled}
classes={{
root: classes.primaryButton,
}}
{...buttonProps}
>
{ props.children }
</Button>
{loading && (
<CircularProgress size={24} className={classes.progress} {...progressProps} />
<CircularProgress
size={24}
className={classes.progress}
{...progressProps}
/>
)}
</div>
);
Expand Down

0 comments on commit 0d6a2d3

Please sign in to comment.