koel/resources/assets/js/components/ui/ScreenControlsToggler.vue

22 lines
591 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
<span v-if="isMobile.phone" class="text-orange" data-testid="controls-toggler" @click="$emit('toggleControls')">
<i v-if="showingControls" class="fa fa-angle-up toggler"/>
<i v-else class="fa fa-angle-down toggler"/>
2022-04-15 14:24:30 +00:00
</span>
</template>
2022-04-15 17:00:08 +00:00
<script lang="ts" setup>
2022-04-15 14:24:30 +00:00
import isMobile from 'ismobilejs'
2022-04-15 17:00:08 +00:00
import { toRefs } from 'vue'
2022-04-15 14:24:30 +00:00
const props = withDefaults(defineProps<{ showingControls?: boolean }>(), { showingControls: true })
2022-04-15 17:00:08 +00:00
const { showingControls } = toRefs(props)
2022-04-15 14:24:30 +00:00
</script>
<style lang="scss" scoped>
.toggler {
font-size: 1rem;
margin-left: 4px;
}
</style>