-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de17e7d
commit 094a443
Showing
6 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { $ } from '@/utils'; | ||
import { _ } from '@/utils/customFx'; | ||
|
||
const notification = (label, classname) => { | ||
const notificationTpl = ` | ||
<div class='notification-container ${classname}'> | ||
<p>${label} 되었습니다.</p> | ||
</div> | ||
`; | ||
|
||
//prettier-ignore | ||
const renderNotification = () => | ||
_.go( | ||
notificationTpl, | ||
$.el, | ||
$.append($.qs('#root'))); | ||
|
||
const toggleShow = (target) => target.classList.toggle('show'); | ||
|
||
const showNotification = () => { | ||
const notificationDiv = $.qs('.notification-container'); | ||
toggleShow(notificationDiv); | ||
setTimeout(() => { | ||
toggleShow(notificationDiv); | ||
}, 2000); | ||
}; | ||
|
||
//prettier-ignore | ||
const notificationEvent = async () => { | ||
_.go( | ||
renderNotification(), | ||
() => showNotification); | ||
}; | ||
|
||
return notificationEvent; | ||
}; | ||
|
||
export default notification; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters