Skip to content

Commit

Permalink
v2.5.4
Browse files Browse the repository at this point in the history
v2.5.4
  • Loading branch information
yougyung authored Oct 20, 2023
2 parents 691f8d3 + e6bb1c2 commit 39608fd
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/routers/main-page/main-page.component.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Component from '../../core/component';
import Modal from '../../components/modal/modal.component';
import ModalNotice from '../../components/modal-notice/modal-notice.component';
import Maintitle from '../../components/main-title/main-title.component';
import MainBtn from '../../components/button/button.component';
import GNB from '../../components/GNB/GNB.component';
Expand Down Expand Up @@ -28,47 +27,20 @@ const [sizeAttr, srcsetAttr] = getResponseiveImage(sizes, `${IMAGE_URL}/images/m
const [roundSizeAttr, roundSrcsetAttr] = getResponseiveImage(roundSizes, `${IMAGE_URL}/images/round-logo.svg`);

export default class MainPage extends Component {
initState() {
this.state = {
isModalShow: typeof window !== 'undefined' ? sessionStorage.getItem('notice') !== 'done' : null,
};
}

toggleModal() {
if (this.state.isModalShow) {
sessionStorage.setItem('notice', 'done');
}
this.setState({
isModalShow: !this.state.isModalShow,
});
}

template() {
const gnb = this.addChild(GNB);
const maintitle = this.addChild(Maintitle);
const startBtn = this.addChild(MainBtn);
const modalNoticeContainer = this.addChild(Modal);
const modalNoticeContent = this.addChild(ModalNotice);

return (props) => {
if (props) this.setProps(props);

const modalProps = {
isModalShow: this.state.isModalShow,
toggleModal: this.toggleModal.bind(this),
contentComponent: modalNoticeContent,
width: 1000,
padding: 55,
key: 'update',
};

return `
<div class="main-page">
<div class="main-page__gnb-container">
${gnb.render()}
</div>
<div class="main-page__body" >
${modalNoticeContainer.render(modalProps)}
<img class="main-page__background-img" sizes="${sizeAttr}" srcset="${srcsetAttr}" alt="main-page__background-img"/>
<img class="main-page__round-logo" sizes="${roundSizeAttr}" srcset="${roundSrcsetAttr}" alt="main-page__round-logo" />
<div class="main-page__content">
Expand Down

0 comments on commit 39608fd

Please sign in to comment.