feat(front): add fw buttons to radio pages

This commit is contained in:
Ciarán Ainsworth 2023-11-12 22:28:24 +01:00
parent d686b6ced8
commit bcab719010
No known key found for this signature in database
3 changed files with 21 additions and 18 deletions

View File

@ -11,6 +11,8 @@ import { syncRef } from '@vueuse/core'
import { sortedUniq } from 'lodash-es' import { sortedUniq } from 'lodash-es'
import { useStore } from '~/store' import { useStore } from '~/store'
import { FwButton } from '@funkwhale/ui'
import axios from 'axios' import axios from 'axios'
import $ from 'jquery' import $ from 'jquery'
@ -153,13 +155,13 @@ const paginateOptions = computed(() => sortedUniq([12, 25, 50, paginateBy.value]
<h3 class="ui header"> <h3 class="ui header">
{{ $t('components.library.Radios.header.user') }} {{ $t('components.library.Radios.header.user') }}
</h3> </h3>
<router-link <fw-button
v-if="isAuthenticated" v-if="isAuthenticated"
class="ui success button" color="primary"
to="/library/radios/build" @click="$router.push('/library/radios/build')"
> >
{{ $t('components.library.Radios.button.create') }} {{ $t('components.library.Radios.button.create') }}
</router-link> </fw-button>
<div class="ui hidden divider" /> <div class="ui hidden divider" />
<form <form
:class="['ui', {'loading': isLoading}, 'form']" :class="['ui', {'loading': isLoading}, 'form']"

View File

@ -5,6 +5,8 @@ import { useI18n } from 'vue-i18n'
import { useStore } from '~/store' import { useStore } from '~/store'
import { computed } from 'vue' import { computed } from 'vue'
import { FwButton } from '@funkwhale/ui'
interface Props { interface Props {
customRadioId?: number | null customRadioId?: number | null
type?: string type?: string
@ -74,14 +76,11 @@ const toggleRadio = () => {
</script> </script>
<template> <template>
<button <fw-button
:class="['ui', 'primary', {'inverted': running}, 'icon', 'labeled', 'button']" :outline="running"
icon="bi-broadcast"
@click="toggleRadio" @click="toggleRadio"
> >
<i
class="ui feed icon"
role="button"
/>
{{ buttonLabel }} {{ buttonLabel }}
</button> </fw-button>
</template> </template>

View File

@ -5,6 +5,7 @@ import { ref, computed } from 'vue'
import { useStore } from '~/store' import { useStore } from '~/store'
import RadioButton from './Button.vue' import RadioButton from './Button.vue'
import { FwButton } from '@funkwhale/ui'
interface Props { interface Props {
type: string type: string
@ -60,18 +61,19 @@ const customRadioId = computed(() => props.customRadio?.id ?? null)
/> />
<div class="ui hidden divider" /> <div class="ui hidden divider" />
<radio-button <radio-button
class="right floated button"
:type="type" :type="type"
class="right floated"
:custom-radio-id="customRadioId" :custom-radio-id="customRadioId"
:object-id="objectId" :object-id="objectId"
/> />
<router-link <fw-button
v-if="$store.state.auth.authenticated && type === 'custom' && radio.user.id === $store.state.auth.profile?.id" v-if="$store.state.auth.authenticated && type === 'custom' && radio.user.id === $store.state.auth.profile?.id"
class="ui success button right floated" color="secondary"
:to="{name: 'library.radios.edit', params: {id: customRadioId }}" class="right floated"
> icon="bi-pencil"
{{ $t('components.radios.Card.button.edit') }} title="{{ $t('components.radios.Card.button.edit') }}"
</router-link> @click="$router.push({name: 'library.radios.edit', params: {id: customRadioId }})"
/>
</div> </div>
</div> </div>
</template> </template>