fix. 템플릿 데이터 수정에 따른 fe 소스 수정
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import type {
|
||||
PageDataValue,
|
||||
PageDataComponent,
|
||||
PageDataResourceGroupType,
|
||||
} from '#layers/types/api/pageData'
|
||||
|
||||
/**
|
||||
@@ -19,6 +20,44 @@ export const getLayoutType = (
|
||||
return pageData?.page_type === 1 ? 'default' : 'promotion'
|
||||
}
|
||||
|
||||
/**
|
||||
* 이미지 타입인지 확인합니다.
|
||||
* @param type 리소스 그룹 타입
|
||||
* @returns 이미지 타입 여부
|
||||
*/
|
||||
export const isTypeImage = (type: PageDataResourceGroupType): boolean => {
|
||||
return (
|
||||
type === 'IMG_COMM' || type === 'IMG_LANG' || type === 'IMG_COMM_GLOBAL'
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 비디오 타입인지 확인합니다.
|
||||
* @param type 리소스 그룹 타입
|
||||
* @returns 비디오 타입 여부
|
||||
*/
|
||||
export const isTypeVideo = (type: PageDataResourceGroupType): boolean => {
|
||||
return type === 'VID'
|
||||
}
|
||||
|
||||
/**
|
||||
* 텍스트 타입인지 확인합니다.
|
||||
* @param type 리소스 그룹 타입
|
||||
* @returns 텍스트 타입 여부
|
||||
*/
|
||||
export const isTypeText = (type: PageDataResourceGroupType): boolean => {
|
||||
return type === 'TXT'
|
||||
}
|
||||
|
||||
/**
|
||||
* 버튼 타입인지 확인합니다.
|
||||
* @param type 리소스 그룹 타입
|
||||
* @returns 버튼 타입 여부
|
||||
*/
|
||||
export const isTypeButton = (type: PageDataResourceGroupType): boolean => {
|
||||
return type === 'BTN'
|
||||
}
|
||||
|
||||
/**
|
||||
* 그룹의 첫 번째 데이터를 반환합니다.
|
||||
* @param source props.components 또는 group 객체
|
||||
|
||||
Reference in New Issue
Block a user