Skip to content

Commit

Permalink
refactor: remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
abdmmar committed Dec 26, 2021
1 parent 06cd2ae commit 02bc1a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
4 changes: 1 addition & 3 deletions src/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,12 @@ toast.dismiss = function (toastId) {
* @param {string} message.success
* @param {string} message.error
* @param {object} options
* @param {string} options.icon
* @param {number} options.duration
* @returns {Promise}
*/
toast.promise = async function (
promise,
message = { loading: '', success: '', error: '' },
options = { icon: '', duration: '' }
options
) {
const id = toast.loading(message.loading, { ...options });

Expand Down
3 changes: 1 addition & 2 deletions src/wc-toast-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class WCToastContent extends HTMLElement {

connectedCallback() {
this.message = this.getAttribute('message');
this.shadowRoot.querySelector('slot[name="message"]').innerHTML = this.message;
this.shadowRoot.querySelector('slot[name="content"]').innerHTML = this.message;
}

static template() {
Expand All @@ -25,7 +25,6 @@ export default class WCToastContent extends HTMLElement {
font-size: var(--wc-toast-font-size);
}
</style>
<slot name="message"></slot>
<slot name="content"></slot>
`;
}
Expand Down
23 changes: 2 additions & 21 deletions src/wc-toast.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
/**
* Available toast position:
* - top-left
* - top-right
* - top-center
* - bottom-left
* - bottom-right
* - bottom-center
*/
export default class WCToast extends HTMLElement {
constructor() {
super();
Expand Down Expand Up @@ -35,14 +26,6 @@ export default class WCToast extends HTMLElement {
}
}

/**
* This method is to arrange the toast position based on the position attribute.
* @param {string} position
* @returns {void}
* @memberof WCToast
* @example
* this.arrangeToastPosition('top-left');
*/
arrangeToastPosition(position) {
const top = position.includes('top');
const verticalStyle = { top: top && 0, bottom: !top && 0 };
Expand Down Expand Up @@ -99,11 +82,9 @@ export default class WCToast extends HTMLElement {
flex-direction: var(--wc-toast-direction);
justify-content: flex-end;
gap: 16px;
will-change: transform;
transition: all 230ms cubic-bezier(0.21, 1.02, 0.73, 1);
}
.wc-toast-wrapper * {
pointer-events: auto;
pointer-events: none;
}
</style>
<div class="wc-toast-container">
Expand Down

0 comments on commit 02bc1a4

Please sign in to comment.