Skip to content

Commit

Permalink
Merge pull request #451 from entrylabs/develop
Browse files Browse the repository at this point in the history
master <= develop
  • Loading branch information
Tnks2U authored Aug 27, 2024
2 parents 5f04ed3 + d970167 commit 7d5b4bb
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"rimraf": "^2.6.2",
"safe-umd-webpack-plugin": "^4.0.0",
"sass-loader": "^7.1.0",
"style-loader": "0.19.0",
"styled-components": "^3.4.2",
"sw-precache-webpack-plugin": "0.11.4",
"url-loader": "0.6.2",
Expand Down Expand Up @@ -139,6 +138,7 @@
"react-slick": "^0.23.2",
"redux-form": "^7.4.2",
"reselect": "^4.0.0",
"style-loader": "^4.0.0",
"xlsx": "^0.16.9"
},
"files": [
Expand Down
25 changes: 13 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/assets/entry/scss/popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,8 @@
font-size: 14px;
color: #000;
letter-spacing: -0.32px;
line-height: 16px;
line-height: 1.29;
white-space: pre-line;
}
.caution_dsc:before {
position: absolute;
Expand Down
4 changes: 4 additions & 0 deletions src/components/popup/Contents/Select/BigICON/Item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const Index = ({
select,
deselect,
useLangKey = true,
allowDuplicate = true,
}) => {
const theme = Theme.getStyle('popup');
const { imageName, sponserText, linkBox } = item;
Expand All @@ -31,6 +32,9 @@ const Index = ({
selected.splice(index, 1);
}
} else {
if (!allowDuplicate && selected.length >= 0) {
selected = [];
}
selected.push(item, () => select(item));
}
applySelected(selected);
Expand Down
47 changes: 37 additions & 10 deletions src/components/popup/Contents/Select/BigICON/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo } from 'react';
import { useEffect, useMemo, useState } from 'react';
import Item from './Item';
import { CommonUtils } from '@utils/Common';
import Theme from '@utils/Theme';
Expand All @@ -8,9 +8,24 @@ import { connect } from 'react-redux';
import { triggerEvent } from '@actions/index';
import { EMIT_TYPES as Types } from '@constants';

const ALERT_MSG_KEY = {
aiUtilize: 'template.aiUtilize_block_descriptions',
hw_lite: 'template.hardware_lite_descriptions',
'entry-js': 'template.expansion_block_descriptions',
};

const Index = (props) => {
const theme = Theme.getStyle('popup');
const { data = [], imageBaseUrl, applySelected, submit, selected, HeaderButtonPortal, popupAlertMessage } = props;
const {
data = [],
imageBaseUrl,
applySelected,
submit,
selected,
HeaderButtonPortal,
popupAlertMessage,
} = props;
const [itemSelected, setItemSelected] = useState(true);

useEffect(() => {
applySelected(data.filter((item) => item.active));
Expand All @@ -23,22 +38,26 @@ const Index = (props) => {
return false;
});

const alertMsgKey = useMemo(() => {
const popupType = useMemo(() => {
if (imageBaseUrl.includes('aiUtilize')) {
return 'template.aiUtilize_block_descriptions';
return 'aiUtilize';
} else if (imageBaseUrl.includes('hw_lite')) {
return 'template.hardware_lite_descriptions';
return 'hw_lite';
} else if (imageBaseUrl.includes('entry-js')) {
return 'template.expansion_block_descriptions';
return 'entry-js';
} else {
console.error('Error, incorrect imageBaseUrl : ', imageBaseUrl);
}
}, [imageBaseUrl]);

const isHwLite = popupType === 'hw_lite';

return (
<div className={classname(theme.section_content, theme.extend_content)}>
<h2 className={theme.blind}>BIG ICON LIST</h2>
<p className={theme.caution_dsc}>{popupAlertMessage || CommonUtils.getLang(alertMsgKey)}</p>
<p className={theme.caution_dsc}>
{popupAlertMessage || CommonUtils.getLang(ALERT_MSG_KEY[popupType])}
</p>
<div className={theme.extend_block}>
<ul className={theme.list}>
{data.map((item) => (
Expand All @@ -47,17 +66,25 @@ const Index = (props) => {
item={item}
imageBaseUrl={imageBaseUrl}
useLangKey={useLangKey}
allowDuplicate={isHwLite ? false : true} // 수정
/>
))}
</ul>
</div>
<HeaderButtonPortal>
<a
className={theme.btn}
className={`${theme.btn} ${
isHwLite && selected.length <= 1 ? theme.disabled : ''
}`}
role="button"
onClick={CommonUtils.handleClick(() => submit({ selected }))}
onClick={CommonUtils.handleClick(() => {
if (itemSelected) {
submit({ selected });
setItemSelected(false);
}
})}
>
{CommonUtils.getLang('Buttons.load')}
{CommonUtils.getLang(isHwLite ? 'Buttons.select' : 'Buttons.load')}
</a>
</HeaderButtonPortal>
</div>
Expand Down

0 comments on commit 7d5b4bb

Please sign in to comment.