mealie/frontend/components/Layout/LayoutParts/TheSnackbar.vue
Michael Genson 2c5e5a8421
feat: Public Recipe Browser (#2525)
* fixed incorrect var ref

* added public recipe pagination route

* refactored frontend public/explore API

* fixed broken public cards

* hid context menu from cards when public

* fixed public app header

* fixed random recipe

* added public food, category, tag, and tool routes

* not sure why I thought that would work

* added public organizer/foods stores

* disabled clicking on tags/categories

* added public link to profile page

* linting

* force a 404 if the group slug is missing or invalid

* oops

* refactored to fit sidebar into explore

* fixed invalid logic for app header

* removed most sidebar options from public

* added backend routes for public cookbooks

* added explore cookbook pages/apis

* codegen

* added backend tests

* lint

* fixes v-for keys

* I do not understand but sure why not

---------

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2023-09-14 06:01:24 -08:00

58 lines
1.6 KiB
Vue

<template>
<div class="text-center">
<v-snackbar v-model="toastAlert.open" top :color="toastAlert.color" timeout="2000" @input="toastAlert.open = false">
<v-icon dark left>
{{ icon }}
</v-icon>
{{ toastAlert.title }}
{{ toastAlert.text }}
<template #action="{ attrs }">
<v-btn text v-bind="attrs" @click="toastAlert.open = false"> {{ $t('general.close') }} </v-btn>
</template>
</v-snackbar>
<v-snackbar
content-class="py-2"
dense
bottom
right
:value="toastLoading.open"
:timeout="-1"
:color="toastLoading.color"
@input="toastLoading.open = false"
>
<div class="d-flex flex-column align-center justify-start" @click="toastLoading.open = false">
<div class="mb-2 mt-0 text-subtitle-1 text-center">
{{ toastLoading.text }}
</div>
<v-progress-linear indeterminate color="white darken-2"></v-progress-linear>
</div>
</v-snackbar>
</div>
</template>
<script lang="ts">
import { computed, defineComponent } from "@nuxtjs/composition-api";
import { toastAlert, toastLoading } from "~/composables/use-toast";
export default defineComponent({
setup() {
const icon = computed(() => {
switch (toastAlert.color) {
case "error":
return "mdi-alert";
case "success":
return "mdi-check-bold";
case "info":
return "mdi-information-outline";
default:
return "mdi-alert";
}
});
return { icon, toastAlert, toastLoading };
},
});
</script>