Skip to content

Commit

Permalink
more refactoring...
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Oct 23, 2023
1 parent 0af42f9 commit a32a1d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion addon/components/badge.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="status-badge {{safe-dasherize @status}}-status-badge" ...attributes>
<div class="status-badge {{safe-dasherize (or @status @type)}}-status-badge" ...attributes>
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium leading-4 whitespace-no-wrap {{@spanClass}}">
<svg class="mr-1.5 h-2 w-2 {{if @hideStatusDot "hidden"}}" fill="currentColor" viewBox="0 0 8 8">
<circle cx="4" cy="4" r="3"></circle>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/modal/layouts/confirm.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
<div class="modal-body-container flex {{if @options.body 'items-start' 'items-center'}}">
<div class="px-6 py-4 flex {{if @options.body 'items-start' 'items-center'}}">
<div class="flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto bg-red-100 rounded-full sm:mx-0 sm:h-10 sm:w-10">
{{#if @options.icon}}
<FaIcon @icon={{@options.icon}} @size={{@options.iconSize}} @spin={{@options.iconSpin}} @flip={{@options.iconFlip}} class={{@options.iconClass}} />
Expand Down
19 changes: 12 additions & 7 deletions addon/components/overlay.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { later } from '@ember/runloop';

export default class OverlayComponent extends Component {
@tracked overlayNode;
Expand Down Expand Up @@ -34,13 +35,17 @@ export default class OverlayComponent extends Component {

const { isOpen } = this.args;

setTimeout(() => {
this.isOpen = isOpen ?? true;

if (typeof this.args?.onLoad === 'function') {
this.args.onLoad(this.context);
}
}, 600);
later(
this,
() => {
this.isOpen = isOpen ?? true;

if (typeof this.args?.onLoad === 'function') {
this.args.onLoad(this.context);
}
},
600
);
}

@action setupNode(property, node) {
Expand Down

0 comments on commit a32a1d5

Please sign in to comment.