diff --git a/layers/components/atoms/Button/Circle.vue b/layers/components/atoms/Button/Circle.vue index e4d7157..e252760 100644 --- a/layers/components/atoms/Button/Circle.vue +++ b/layers/components/atoms/Button/Circle.vue @@ -3,7 +3,7 @@ interface props { type?: 'button' | 'link' to?: string target?: '_self' | '_blank' - bgColor?: string + backgroundColor?: string srOnly?: string } @@ -11,7 +11,7 @@ const props = withDefaults(defineProps(), { type: 'button', to: '', target: '_self', - bgColor: '', + backgroundColor: '', srOnly: '', }) @@ -34,8 +34,8 @@ const componentProps = computed(() => { const buttonStyle = computed(() => { const style: Record = {} - if (props.bgColor) { - style.backgroundColor = props.bgColor + if (props.backgroundColor) { + style.backgroundColor = props.backgroundColor } return style }) diff --git a/layers/components/atoms/Button/Play.vue b/layers/components/atoms/Button/Play.vue index 946a705..bfe37ff 100644 --- a/layers/components/atoms/Button/Play.vue +++ b/layers/components/atoms/Button/Play.vue @@ -2,27 +2,33 @@ import type { TrackingObject } from '#layers/types/api/common' interface Props { - bgColor?: string + category?: 'system' | 'image' + backgroundColor?: string tracking: TrackingObject } -const props = defineProps() +const props = withDefaults(defineProps(), { category: 'system' }) const { locale } = useI18n() const { sendLog } = useAnalytics() -const handlePlayClick = () => { - sendLog(locale.value, props.tracking) -} +const buttonClasses = computed(() => [ + 'btn-play', + props.category === 'system' ? 'play-icon' : 'play-image', +]) + +const buttonStyle = computed(() => + props.category === 'system' && props.backgroundColor + ? { backgroundColor: props.backgroundColor } + : {} +) + +const onClick = () => sendLog(locale.value, props.tracking)