Skip to content

Commit

Permalink
feat(FE) : 로그아웃화면 이벤트 수정(#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
SUMMERLOVE7 committed Feb 20, 2023
1 parent 974e04b commit 76d25f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions client/src/components/common/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ const header = (props) => {
</header>
`;

const logoutEvent = (target) => {
toggleActive(target);
const logoutEvent = () => {
modal('로그아웃', 'logout')();

const logoutModal = $.qs('.outside-modal-container');
toggleActive(logoutModal);
};

const openMenuEvent = () => {
Expand All @@ -50,9 +53,6 @@ const header = (props) => {

toggleActive(trigger);
toggleActive(menuTarget);

const logoutButton = $.qs('.logout-button');
logoutButton.addEventListener('click', toggleActive());
};

const toggleActive = (target) => target.classList.toggle('active');
Expand All @@ -79,7 +79,13 @@ const header = (props) => {
() => sideMenu()(),
() => $.qs('.trigger'),
$.on('click', openMenuEvent),
() => modal("로그아웃", "logout")());
() => $.qs('.logout-button'),
$.on('click', logoutEvent),
// () => $.qs('.modal-button'),
// $.on('click', navigate('/')),
// () => $.qs('.cancel-button'),
// $.on('click', navigate('/card'))
);

return appendHeader;
};
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/common/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { _ } from '@/utils/customFx';

const logout = (label, classname) => {
const logoutTpl = `
<div class='outside-modal-container outside-${classname} active'>
<section class='modal-section-wrapper ${classname}'>
<div class='outside-modal-container outside-${classname}'>
<section class='modal-section-wrapper ${classname}-wrapper'>
<section class='modal-section ${classname}'>
<div class='modal-text-container'>
<h4 class='modal-text'>${label}</h4>
Expand Down

0 comments on commit 76d25f3

Please sign in to comment.