feat(front): add login form buttons

This commit is contained in:
Ciarán Ainsworth 2023-11-12 21:50:20 +00:00 committed by Ciarán Ainsworth
parent bcab719010
commit f5c76d5f65
No known key found for this signature in database
2 changed files with 15 additions and 10 deletions

View File

@ -7,6 +7,8 @@ import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useStore } from '~/store' import { useStore } from '~/store'
import { FwButton } from '@funkwhale/ui'
import PasswordInput from '~/components/forms/PasswordInput.vue' import PasswordInput from '~/components/forms/PasswordInput.vue'
interface Props { interface Props {
@ -137,11 +139,13 @@ const submit = async () => {
{{ $t('components.auth.LoginForm.message.redirect', { domain: $store.getters['instance/domain'] }) }} {{ $t('components.auth.LoginForm.message.redirect', { domain: $store.getters['instance/domain'] }) }}
</p> </p>
</template> </template>
<button <fw-button
:class="['ui', {'loading': isLoading}, 'right', 'floated', buttonClasses, 'button']" color="primary"
:is-loading="isLoading"
class="right floated"
type="submit" type="submit"
> >
{{ $t('components.auth.LoginForm.button.login') }} {{ $t('components.auth.LoginForm.button.login') }}
</button> </fw-button>
</form> </form>
</template> </template>

View File

@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue' import { computed } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { FwButton } from '@funkwhale/ui'
const { t } = useI18n() const { t } = useI18n()
const labels = computed(() => ({ const labels = computed(() => ({
@ -24,12 +25,12 @@ const labels = computed(() => ({
<p> <p>
{{ $t('components.auth.Logout.message.loggedIn', { username: $store.state.auth.username }) }} {{ $t('components.auth.Logout.message.loggedIn', { username: $store.state.auth.username }) }}
</p> </p>
<button <fw-button
class="ui button" color="secondary"
@click="$store.dispatch('auth/logout')" @click="$store.dispatch('auth/logout')"
> >
{{ $t('components.auth.Logout.button.logout') }} {{ $t('components.auth.Logout.button.logout') }}
</button> </fw-button>
</div> </div>
<div <div
v-else v-else
@ -38,12 +39,12 @@ const labels = computed(() => ({
<h2> <h2>
{{ $t('components.auth.Logout.header.unauthenticated') }} {{ $t('components.auth.Logout.header.unauthenticated') }}
</h2> </h2>
<router-link <fw-button
to="/login" color="primary"
class="ui button" @click="$router.push('/login')"
> >
{{ $t('components.auth.Logout.link.login') }} {{ $t('components.auth.Logout.link.login') }}
</router-link> </fw-button>
</div> </div>
</section> </section>
</main> </main>