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

22 lines
587 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
2022-06-10 10:47:46 +00:00
<span v-if="isMobile.phone" class="text-orange" data-testid="controls-toggle" @click="$emit('toggleControls')">
<i v-if="showingControls" class="fa fa-angle-up toggle"/>
<i v-else class="fa fa-angle-down toggle"/>
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>
2022-06-10 10:47:46 +00:00
.toggle {
2022-04-15 14:24:30 +00:00
font-size: 1rem;
margin-left: 4px;
}
</style>