Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[entry2-web/2745] 네비게이션 탭에 따라 페이지가 달라지도록 수정 #316

Merged
merged 2 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions src/components/popup/Contents/Projects/EmptyContents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,27 @@ import { EMIT_TYPES as Types } from '@constants';
import { triggerEvent } from '@actions/index';
import { closePopup } from '@actions/popup';

const Index = ({ makeProject }) => {
const getResultMent = (type) => {
switch (type) {
case 'projects':
return (
<div>
{CommonUtils.getLang('Menus.no_project_1')}
<br />
{CommonUtils.getLang('Menus.no_project_2')}
</div>
);
break;
case 'favorites':
return <div>{CommonUtils.getLang('Menus.no_marked_project')}</div>;
break;
default:
return <div>not supported type</div>;
break;
}
};

const Index = ({ makeProject, type }) => {
const theme = Theme.getStyle('popup');
return (
<section className={classname(theme.pop_content, theme.art_content)}>
Expand All @@ -16,19 +36,17 @@ const Index = ({ makeProject }) => {
<h2 className={theme.blind}>{CommonUtils.getLang('Menus.my_project')}</h2>
<div className={theme.result_box}>
<div className={classname(theme.thmb, theme.imico_pop_mywrite_thmb)} />
<p className={theme.result_dsc}>
{CommonUtils.getLang('Menus.no_project_1')}
<br />
{CommonUtils.getLang('Menus.no_project_2')}
</p>
<div className={theme.pop_btn_box}>
<div
className={theme.active}
onClick={CommonUtils.handleClick(makeProject)}
>
{CommonUtils.getLang('Menus.make_project')}
<p className={theme.result_dsc}>{getResultMent(type)}</p>
{type !== 'favorites' && (
<div className={theme.pop_btn_box}>
<div
className={theme.active}
onClick={CommonUtils.handleClick(makeProject)}
>
{CommonUtils.getLang('Menus.make_project')}
</div>
</div>
</div>
)}
</div>
</div>
</section>
Expand All @@ -42,7 +60,4 @@ const mapDispatchToProps = (dispatch) => ({
},
});

export default connect(
null,
mapDispatchToProps
)(Index);
export default connect(null, mapDispatchToProps)(Index);
7 changes: 2 additions & 5 deletions src/components/popup/Contents/Projects/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Index = ({ type, data = [], avatarImage, closePopup, submit, fetch }) => {
}, [type]);

if (totalCount === 0) {
return <EmptyContents />;
return <EmptyContents type={type} />;
}
return (
<>
Expand Down Expand Up @@ -73,7 +73,4 @@ const mapDispatchToProps = (dispatch) => ({
closePopup: () => dispatch(closePopup()),
});

export default connect(
null,
mapDispatchToProps
)(Index);
export default connect(null, mapDispatchToProps)(Index);
2 changes: 2 additions & 0 deletions src/components/popup/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class Popup extends Component {
break;
}
case 'projects':
view = <Projects type={selected} data={data} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 굳이 나눈이유가 있을까요?

break;
case 'favorites':
view = <Projects type={selected} data={data} />;
break;
Expand Down