refactor. 코드 간소화 및 불필요한 props 제거

This commit is contained in:
clkim
2026-03-23 15:04:30 +09:00
parent 8c2b98369a
commit e457209024
4 changed files with 7 additions and 17 deletions

View File

@@ -1,15 +1,12 @@
<script setup lang="ts">
import type { ColorObject, TrackingObject } from '#layers/types/api/common'
interface Props {
backgroundColor: ColorObject
}
const props = defineProps<Props>()
import type { TrackingObject } from '#layers/types/api/common'
const { locale } = useI18n()
const { y: windowY } = useWindowScroll({ behavior: 'smooth' })
const { sendLog } = useAnalytics()
const pageDataStore = usePageDataStore()
const { topBtnColorJson } = storeToRefs(pageDataStore)
const analytics = {
action_type: 'click',
@@ -19,7 +16,7 @@ const analytics = {
const showBtn = computed(() => windowY.value > 0)
const backgroundColor = computed(
() => getColorCodeFromData(props.backgroundColor, 'none') ?? 'var(--primary)'
() => getColorCodeFromData(topBtnColorJson.value, 'none') ?? 'var(--primary)'
)
const handleScrollToTop = () => {

View File

@@ -28,9 +28,7 @@ const lnbList = computed<Record<string, PageDataLnbMenu>>(
)
const isShowLnb = computed(() => {
return Boolean(
pageData.value?.use_lnb &&
breakpoints.value.isDesktop &&
Object.keys(lnbList.value).length > 0
breakpoints.value.isDesktop && Object.keys(lnbList.value).length > 0
)
})
const activeColor = computed(

View File

@@ -19,7 +19,6 @@ const {
isUseSnsBtn,
isUseLnb,
isLoginRequired,
topBtnColorJson,
} = storeToRefs(pageDataStore)
const { gameMetaTag } = storeToRefs(gameDataStore)
@@ -105,10 +104,7 @@ onMounted(() => {
<ClientOnly>
<BlocksLnb v-if="isUseLnb" />
<div v-if="isUseTopBtn" class="utile-wrap">
<BlocksButtonScrollTop
v-if="isUseTopBtn"
:background-color="topBtnColorJson"
/>
<BlocksButtonScrollTop v-if="isUseTopBtn" />
</div>
</ClientOnly>
<BlocksSns v-if="isUseSnsBtn" />

View File

@@ -117,7 +117,6 @@ onBeforeUnmount(() => {
alt="main image"
/>
<AtomsButtonPlay
v-if="playingSlideIndex !== index"
class="btn-play"
:background-color="
getColorCodeFromData(videoPlayData?.display, 'none')