Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: showcase workspace state in actions dropdown #3133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix loading button
  • Loading branch information
Kira-Pilot committed Jul 25, 2022
commit affe143438cdf0bb17c6103998d9f8ccab3a8bdd
4 changes: 1 addition & 3 deletions site/src/components/LoadingButton/LoadingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface LoadingButtonProps extends ButtonProps {
loading?: boolean
/** An optional label to display with the loading spinner */
loadingLabel?: string
classProp?: string
}

/**
Expand All @@ -22,14 +21,13 @@ export const LoadingButton: FC<LoadingButtonProps> = ({
loading = false,
loadingLabel,
children,
classProp,
...rest
}) => {
const styles = useStyles({ hasLoadingLabel: !!loadingLabel })
const hidden = loading ? { opacity: 0 } : undefined

return (
<Button {...rest} disabled={rest.disabled || loading} className={classProp}>
<Button {...rest} disabled={rest.disabled || loading}>
<span style={hidden}>{children}</span>
{loading && (
<div className={styles.loader}>
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/WorkspaceActions/ActionCtas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const ActionLoadingButton: FC<LoadingProps> = ({ label }) => {
<LoadingButton
loading
loadingLabel={label}
classProp={combineClasses([styles.loadingButton, styles.actionButton])}
className={combineClasses([styles.loadingButton, styles.actionButton])}
/>
)
}
Expand Down