[251019] fix: Resolve warnings-1

🕐 커밋 시간: 2025. 10. 19. 23:37:25

📊 변경 통계:
  • 총 파일: 18개
  • 추가: +347줄
  • 삭제: -449줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/components/VideoPlayer/MediaPlayer.jsx
  ~ com.twin.app.shoptime/src/utils/fp.js
  ~ com.twin.app.shoptime/src/utils/helperMethods.js
  ~ com.twin.app.shoptime/src/utils/lodashFpEx.js
  ~ com.twin.app.shoptime/src/utils/spotlight-utils.js
  ~ com.twin.app.shoptime/src/views/DetailPanel/DetailPanel.jsx
  ~ com.twin.app.shoptime/src/views/DetailPanel/DetailPanelSkeleton/DetailPanelSkeleton.jsx
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerItemCard/PlayerItemCard.jsx
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerOverlay/PlayerOverlayContents.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/SearchPanel.new.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/SearchResults.new.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ItemCard.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ShowCard.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/TInput/TInput.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/VoiceInputOverlay/VoiceInputOverlay.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/VoiceInputOverlay/modes/VoicePromptScreen.jsx
  ~ com.twin.app.shoptime/src/views/SearchPanel/VoiceInputOverlay/modes/VoiceResponse.jsx
  ~ com.twin.app.shoptime/src/views/UserReview/ShowUserReviews.jsx

🔧 함수 변경 내용:
  📊 Function-level changes summary across 18 files:
    • Functions added: 8
    • Functions modified: 14
    • Functions deleted: 17
  📋 By language:
    • javascript: 18 files, 39 function changes

🔧 주요 변경 내용:
  • UI 컴포넌트 아키텍처 개선
  • 공통 유틸리티 함수 최적화

Performance: 코드 최적화로 성능 개선 기대
This commit is contained in:
2025-10-19 23:37:30 +09:00
parent edbc7628c7
commit f70e2b1a21
18 changed files with 746 additions and 866 deletions

View File

@@ -42,20 +42,20 @@ import Announce from '@enact/ui/AnnounceDecorator/Announce';
import ComponentOverride from '@enact/ui/ComponentOverride';
import { FloatingLayerDecorator } from '@enact/ui/FloatingLayer';
import { FloatingLayerContext } from '@enact/ui/FloatingLayer/FloatingLayerDecorator';
import Marquee from '@enact/ui/Marquee';
// import Marquee from '@enact/ui/Marquee';
import Slottable from '@enact/ui/Slottable';
import Touchable from '@enact/ui/Touchable';
import { panel_names } from '../../utils/Config';
// import { panel_names } from '../../utils/Config';
import { $L } from '../../utils/helperMethods';
import { SpotlightIds } from '../../utils/SpotlightIds';
import Loader from '../Loader/Loader';
import { MediaControls, MediaSlider, secondsToTime, Times } from '../MediaPlayer';
import PlayerOverlayContents from '../../views/PlayerPanel/PlayerOverlay/PlayerOverlayContents';
import FeedbackContent from './FeedbackContent';
import FeedbackTooltip from './FeedbackTooltip';
// import FeedbackTooltip from './FeedbackTooltip';
import Media from './Media';
import MediaTitle from './MediaTitle';
// import MediaTitle from './MediaTitle';
import Overlay from './Overlay';
import TReactPlayer from './TReactPlayer';
import Video from './Video';
@@ -78,7 +78,7 @@ const calcNumberValueOfPlaybackRate = (rate) => {
const pbArray = String(rate).split('/');
return pbArray.length > 1 ? parseInt(pbArray[0]) / parseInt(pbArray[1]) : parseInt(rate);
};
const SpottableBtn = Spottable('button');
// const SpottableBtn = Spottable('button');
const SpottableDiv = Touchable(Spottable('div'));
const RootContainer = SpotlightContainerDecorator(
{
@@ -113,7 +113,7 @@ const getDurFmt = (locale) => {
const forwardWithState = (type) => adaptEvent(call('addStateToEvent'), forwardWithPrevent(type));
const forwardToggleMore = forward('onToggleMore');
// const forwardToggleMore = forward('onToggleMore');
// provide forwarding of events on media controls
const forwardControlsAvailable = forward('onControlsAvailable');
@@ -2001,6 +2001,20 @@ const VideoPlayerBase = class extends React.Component {
}));
};
onSpotlightFocus = () => {
this.showControls();
if (this.state.lastFocusedTarget) {
setTimeout(() => {
Spotlight.focus(this.state.lastFocusedTarget);
});
} else {
setTimeout(() => {
Spotlight.focus(SpotlightIds.PLAYER_TAB_BUTTON);
});
}
};
slider5WayPressJob = new Job(() => {
this.setState({ slider5WayPressed: false });
}, 200);
@@ -2087,9 +2101,9 @@ const VideoPlayerBase = class extends React.Component {
className,
modalClassName,
disabled,
infoComponents,
backButton,
promotionTitle,
// infoComponents,
// backButton,
// promotionTitle,
initialJumpDelay,
jumpDelay,
@@ -2105,14 +2119,14 @@ const VideoPlayerBase = class extends React.Component {
spotlightDisabled,
spotlightId,
style,
thumbnailComponent,
thumbnailSrc,
title,
// thumbnailComponent,
// thumbnailSrc,
// title,
introTime,
onClickSkipIntro,
onIntroDisabled,
// onClickSkipIntro,
// onIntroDisabled,
videoComponent: VideoComponent,
cameraSettingsButton,
// cameraSettingsButton,
onBackButton,
panelInfo,
selectedIndex,
@@ -2129,18 +2143,18 @@ const VideoPlayerBase = class extends React.Component {
disclaimer,
liveTotalTime,
currentLiveTimeSeconds,
themeProductInfos,
detailThemeProductImageLength,
// themeProductInfos,
// detailThemeProductImageLength,
videoVerticalVisible,
handleIndicatorDownClick,
handleIndicatorUpClick,
orderPhnNo,
// orderPhnNo,
captionEnable,
countryCode,
setCurrentTime,
setIsVODPaused,
// setCurrentTime,
// setIsVODPaused,
qrCurrentItem,
modalScale,
// modalScale,
...mediaProps
} = this.props;
@@ -2222,27 +2236,15 @@ const VideoPlayerBase = class extends React.Component {
}
}
// eslint-disable-next-line no-unused-vars
const isQRCodeVisible = playListInfo && qrCurrentItem && !thumbnailUrl && !panelInfo.modal;
const onSpotlightFocus = () => {
this.showControls();
if (this.state.lastFocusedTarget) {
setTimeout(() => {
Spotlight.focus(this.state.lastFocusedTarget);
});
} else {
setTimeout(() => {
Spotlight.focus(SpotlightIds.PLAYER_TAB_BUTTON);
});
}
};
// MediaPanel에서는 setIsVODPaused 사용 안 함 (PlayerPanel 전용)
// if (panelInfo?.shptmBanrTpNm === 'VOD' || panelInfo?.shptmBanrTpNm === 'MEDIA') {
// setIsVODPaused(this.state.paused);
// }
// eslint-disable-next-line no-unused-vars
const getVideoPhoneNumberClassNames = () => {
const isQVC =
panelInfo?.chanId === 'USQVC' ||
@@ -2393,7 +2395,7 @@ const VideoPlayerBase = class extends React.Component {
playbackRate={this.pulsedPlaybackRate || this.selectPlaybackRate(this.speedIndex)}
playbackState={this.pulsedPlaybackState || this.prevCommand}
visible={this.state.miniFeedbackVisible && !noMiniFeedback}
></FeedbackContent>
/>
<ControlsContainer
className={classNames(
@@ -2453,7 +2455,7 @@ const VideoPlayerBase = class extends React.Component {
value={this.state.proportionPlayed}
visible={this.state.mediaSliderVisible}
type={type}
></MediaSlider>
/>
)}
</div>
)}
@@ -2483,11 +2485,11 @@ const VideoPlayerBase = class extends React.Component {
holdConfig={controlsHandleAboveHoldConfig}
onDown={this.handleControlsHandleAboveDown}
onKeyUp={this.handleControlsHandleAboveKeyUp}
onSpotlightDown={onSpotlightFocus}
onSpotlightUp={onSpotlightFocus}
onSpotlightRight={onSpotlightFocus}
onSpotlightLeft={onSpotlightFocus}
onClick={onSpotlightFocus}
onSpotlightDown={this.onSpotlightFocus}
onSpotlightUp={this.onSpotlightFocus}
onSpotlightRight={this.onSpotlightFocus}
onSpotlightLeft={this.onSpotlightFocus}
onClick={this.onSpotlightFocus}
selectionKeys={controlsHandleAboveSelectionKeys}
spotlightDisabled={this.state.mediaControlsVisible || spotlightDisabled}
/>