Skip to content

Commit

Permalink
Merge pull request #219 from CityOfDetroit/clean-up.spinner
Browse files Browse the repository at this point in the history
Clean-up.Spinner
  • Loading branch information
maxatdetroit authored Aug 5, 2024
2 parents ddf1b29 + 3d9f418 commit e1cfb68
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/components/atoms/Spinner/Spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export default class Image extends HTMLElement {
this.shadowRoot.appendChild(spinnerStyles);
// image attributes

const spinnerType = this.getAttribute('data-type');
const spinnerType = this.getAttribute('type');

const spinnerSize = this.getAttribute('size');

const spinnerSize = this.getAttribute('data-size');
const backgroundColor = this.getAttribute('background-color');

const backgroundColor = this.getAttribute('data-background-color');

const displayType = this.getAttribute('data-display-type');
const displayType = this.getAttribute('display-type');
let spinnerSizeClass;

// TODO: Fix old ESLint errors - see issue #1099
Expand Down
25 changes: 21 additions & 4 deletions src/stories/spinner.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,33 @@ export default {
control: { type: 'select' },
options: ['sm', 'md'],
},
backgroundColor: {
control: { type: 'select' },
options: [
'primary',
'secondary',
'success',
'info',
'warning',
'danger',
'light',
'dark',
],
},
backgroundColor: COMMON_STORY_ARGS.bootstrapColor,
},
};
// Template
const Template = (args) => {
const spinner = document.createElement('cod-spinner');
spinner.setAttribute('data-type', args.type);
spinner.setAttribute('data-background-color', args.backgroundColor);
spinner.setAttribute('data-size', args.size);
spinner.setAttribute('data-display-type', args.displayType);
spinner.setAttribute('type', args.type);
spinner.setAttribute('background-color', args.backgroundColor);
if (args.size){
spinner.setAttribute('size', args.size);
}
if (args.displayType){
spinner.setAttribute('display-type', args.displayType);
}
return spinner;
};

Expand Down

0 comments on commit e1cfb68

Please sign in to comment.