Skip to content

Commit

Permalink
feat(elements): introduce a loading-spinner-container shadow part
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoern-m committed Nov 9, 2023
1 parent 8f5fa52 commit 9dfcfbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/elements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ The following parts are available:
- `divider-text` - the divider text
- `divider-line` - the line before and after the `divider-text`
- `form-item` - the container of a form item, e.g. an input field or a button
- `loading-spinner-container` - a container that wraps texts or icons to be replaced by a loading spinner.

#### Examples

Expand Down
7 changes: 5 additions & 2 deletions frontend/elements/src/components/icons/LoadingSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ const LoadingSpinner = ({
secondary,
hasIcon,
}: Props) => {
const partName = "loading-spinner-container";

return (
<Fragment>
{isLoading ? (
<div className={styles.loadingSpinnerWrapper}>
<div className={styles.loadingSpinnerWrapper} part={partName}>
<Icon name={"spinner"} secondary={secondary} />
</div>
) : isSuccess ? (
<div className={styles.loadingSpinnerWrapper}>
<div className={styles.loadingSpinnerWrapper} part={partName}>
<Icon name={"checkmark"} secondary={secondary} fadeOut={fadeOut} />
</div>
) : (
<div
part={partName}
className={
hasIcon
? styles.loadingSpinnerWrapperIcon
Expand Down

0 comments on commit 9dfcfbb

Please sign in to comment.